liupopo 2 years ago
parent
commit
597defe0c7
  1. 2
      yxt_supervise/supervise-report/supervise-report-api/src/main/java/com/yxt/supervise/report/api/reportsalesdaylog/MyHandler.java
  2. 10
      yxt_supervise/supervise-report/supervise-report-api/src/main/java/com/yxt/supervise/report/api/reportsalesdaylog/ReportSalesDayLog.java
  3. 34
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaygather/ReportSalesDayGatherMapper.java
  4. 13
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaygather/ReportSalesDayGatherService.java
  5. 7
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaylog/ReportSalesDayLogMapper.java
  6. 27
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaylog/ReportSalesDayLogRest.java
  7. 9
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaylog/ReportSalesDayLogService.java
  8. 13
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaystore/ReportSalesDayStoreMapper.java
  9. 18
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaystore/ReportSalesDayStoreService.java
  10. 5
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaystoreproduct/ReportSalesDayStoreProductMapper.java
  11. 14
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaystoreproduct/ReportSalesDayStoreProductService.java
  12. 13
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaytobaccostore/ReportSalesDayTobaccoStoreMapper.java
  13. 2
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaytobaccostore/ReportSalesDayTobaccoStoreMapper.xml
  14. 22
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaytobaccostore/ReportSalesDayTobaccoStoreService.java
  15. 4
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaytobaccostoreproduct/ReportSalesDayTobaccoStoreProductMapper.java
  16. 12
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaytobaccostoreproduct/ReportSalesDayTobaccoStoreProductService.java
  17. 9
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/thread/ReportThread.java

2
yxt_supervise/supervise-report/supervise-report-api/src/main/java/com/yxt/supervise/report/api/reportsalesdaylog/MyHandler.java

@ -12,8 +12,6 @@ import java.util.List;
* 合并单元格处理类 * 合并单元格处理类
*/ */
public class MyHandler extends AbstractMergeStrategy { public class MyHandler extends AbstractMergeStrategy {
/** /**
* 合并开始行 * 合并开始行
*/ */

10
yxt_supervise/supervise-report/supervise-report-api/src/main/java/com/yxt/supervise/report/api/reportsalesdaylog/ReportSalesDayLog.java

@ -1,5 +1,6 @@
package com.yxt.supervise.report.api.reportsalesdaylog; package com.yxt.supervise.report.api.reportsalesdaylog;
import com.yxt.common.core.domain.BaseEntity;
import lombok.Data; import lombok.Data;
/** /**
@ -7,8 +8,15 @@ import lombok.Data;
* @date 2023/4/21 15:27 * @date 2023/4/21 15:27
*/ */
@Data @Data
public class ReportSalesDayLog { public class ReportSalesDayLog extends BaseEntity {
//单据日期
private String orderDate; private String orderDate;
//文件完整路径
private String fullUrl; private String fullUrl;
//文件相对路径
private String filePath; private String filePath;
//上报时间
private String reportTime;
//编号
private String serialNumber;
} }

34
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaygather/ReportSalesDayGatherMapper.java

@ -21,25 +21,25 @@ import java.util.Map;
public interface ReportSalesDayGatherMapper extends BaseMapper<ReportSalesDayGather> { public interface ReportSalesDayGatherMapper extends BaseMapper<ReportSalesDayGather> {
List<ReportSalesDayGatherVo> getReportSalesDayGather(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayGather> qw); List<ReportSalesDayGatherVo> getReportSalesDayGather(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayGather> qw);
List<ReportSalesDayGatherVo> getAllReportSalesDayGather(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayGather> qw); List<ReportSalesDayGatherVo> getAllReportSalesDayGather(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayGather> qw);
@Delete("delete from supervise_supplychain.gd_sales_reportday where orderDate=#{orderDate} ") @Delete("delete from report_sales_day_gather where orderDate=#{orderDate} ")
void clearByOrderDate(@Param("orderDate") String orderDate); void clearByOrderDate(@Param("orderDate") String orderDate);
@Select("select CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount from ( " + @Select("select CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount from ( " +
" select gs.saleNum,gs.salePrice from supervise_supplychain.gd_sales gs left join supervise_supplychain.store_index si on gs.storeCode=si.code " + " select gs.saleNum,gs.salePrice from gd_sales gs left join store_index si on gs.storeCode=si.code " +
" where gs.dataDate=#{dataDate} and si.`type` ='连网连锁店' ) t ") " where gs.dataDate=#{dataDate} and si.`type` ='连网连锁店' ) t ")
double amountOfLsdOnDay(@Param("dataDate") String orderDate); double amountOfLsdOnDay(@Param("dataDate") String orderDate);
@Select("select CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount from ( " + @Select("select CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount from ( " +
" select gs.saleNum,gs.salePrice from supervise_supplychain.gd_sales gs left join supervise_supplychain.store_index si on gs.storeCode=si.code " + " select gs.saleNum,gs.salePrice from gd_sales gs left join store_index si on gs.storeCode=si.code " +
" where gs.dataDate=#{dataDate} and si.`type` ='连锁内加盟' ) t ") " where gs.dataDate=#{dataDate} and si.`type` ='连锁内加盟' ) t ")
double amountOfLsnjmOnDay(@Param("dataDate") String orderDate); double amountOfLsnjmOnDay(@Param("dataDate") String orderDate);
@Select("SELECT CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount FROM supervise_supplychain.gd_wholesale where dataDate=#{dataDate} ") @Select("SELECT CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount FROM gd_wholesale where dataDate=#{dataDate} ")
double amountOfPszxDay(String orderDate); double amountOfPszxDay(String orderDate);
@Select("SELECT CONVERT(IFNULL(sum(colq16),0),DECIMAL(12,2)) as amount FROM supervise_supplychain.gd_instorage_jmd where orderDate=#{orderDate} ") @Select("SELECT CONVERT(IFNULL(sum(colq16),0),DECIMAL(12,2)) as amount FROM gd_instorage_jmd where orderDate=#{orderDate} ")
double amountOfLswjmDay(@Param("orderDate") String orderDate); double amountOfLswjmDay(@Param("orderDate") String orderDate);
@Select("SELECT CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount FROM supervise_supplychain.gd_sales_yc where dataDate=#{dataDate}") @Select("SELECT CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount FROM gd_sales_yc where dataDate=#{dataDate}")
double amountOfYcDay(@Param("dataDate") String orderDate); double amountOfYcDay(@Param("dataDate") String orderDate);
@Select("select CONVERT(IFNULL(sum(t.colq16),0),DECIMAL(12,2)) as amount from ( " + @Select("select CONVERT(IFNULL(sum(t.colq16),0),DECIMAL(12,2)) as amount from ( " +
" select gig.* from supervise_supplychain.gd_instorage_yc gig left join supervise_supplychain.store_index si on gig.colb1=si.code " + " select gig.* from gd_instorage_yc gig left join store_index si on gig.colb1=si.code " +
" where gig.orderDate=#{orderDate} and (si.`type` ='连锁外加盟(销配结算)' OR si.`type` ='连锁外加盟(销配结算)' ) ) t ") " where gig.orderDate=#{orderDate} and (si.`type` ='连锁外加盟(销配结算)' OR si.`type` ='连锁外加盟(销配结算)' ) ) t ")
double amountOfDayJmd(@Param("orderDate") String orderDate); double amountOfDayJmd(@Param("orderDate") String orderDate);
@Select("SELECT t.*, " + @Select("SELECT t.*, " +
@ -53,15 +53,15 @@ public interface ReportSalesDayGatherMapper extends BaseMapper<ReportSalesDayGat
" 1 as ee, " + " 1 as ee, " +
" CONVERT(SUM(packageTotalPrice),DECIMAL(12,2)) billtotalprice, " + " CONVERT(SUM(packageTotalPrice),DECIMAL(12,2)) billtotalprice, " +
" ( " + " ( " +
" SELECT CONVERT(IFNULL(SUM(colq16),0),DECIMAL(12,2)) FROM supervise_supplychain.gd_instorage gic LEFT JOIN supervise_supplychain.product_information PI ON pi.code=gic.colh7 " + " SELECT CONVERT(IFNULL(SUM(colq16),0),DECIMAL(12,2)) FROM gd_instorage gic LEFT JOIN product_information PI ON pi.code=gic.colh7 " +
" WHERE gic.supplierCodeUnified=pr.supplierOnlyCode " + " WHERE gic.supplierCodeUnified=pr.supplierOnlyCode " +
// " AND pi.categoryKey IN(SELECT categoryKey FROM `restricted_category`) " + // " AND pi.categoryKey IN(SELECT categoryKey FROM `restricted_category`) " +
// " AND pi.brandsid IN(SELECT CODE FROM `restricted_brand`) " + // " AND pi.brandsid IN(SELECT CODE FROM `restricted_brand`) " +
" ) prodvalue, " + " ) prodvalue, " +
" MAX(pr.`arrivalDate`) arrivaldate " + " MAX(pr.`arrivalDate`) arrivaldate " +
" FROM supervise_supplychain.supplier_bank_info sbi " + " FROM supplier_bank_info sbi " +
" LEFT JOIN supervise_supplychain.purchase_requisition pr ON pr.supplierOnlyCode=sbi.codeUnified " + " LEFT JOIN purchase_requisition pr ON pr.supplierOnlyCode=sbi.codeUnified " +
" LEFT JOIN supervise_supplychain.purchase_requisition_pro prp ON pr.sid=prp.mainsid " + " LEFT JOIN purchase_requisition_pro prp ON pr.sid=prp.mainsid " +
" WHERE pr.purchaseState=1 AND pr.bankState=1 AND sbi.`purchaseRequisition`=1 AND sbi.`bankState`=1 " + " WHERE pr.purchaseState=1 AND pr.bankState=1 AND sbi.`purchaseRequisition`=1 AND sbi.`bankState`=1 " +
" GROUP BY pr.supplierOnlyCode ORDER BY sbi.name " + " GROUP BY pr.supplierOnlyCode ORDER BY sbi.name " +
") t ") ") t ")
@ -69,16 +69,16 @@ public interface ReportSalesDayGatherMapper extends BaseMapper<ReportSalesDayGat
@Select("SELECT prt.code, " + @Select("SELECT prt.code, " +
"CONVERT(SUM(prs.price),DECIMAL(12,2)) ddje, " + "CONVERT(SUM(prs.price),DECIMAL(12,2)) ddje, " +
"prt.purchasedate,prt.arrivaldate, " + "prt.purchasedate,prt.arrivaldate, " +
"(SELECT IFNULL(CONVERT(SUM(giyy.colq16),DECIMAL(12,2)),0) FROM supervise_supplychain.gd_instorage_yc giyy WHERE giyy.purchasedate=prt.purchasedate ) dddhjz , " + "(SELECT IFNULL(CONVERT(SUM(giyy.colq16),DECIMAL(12,2)),0) FROM gd_instorage_yc giyy WHERE giyy.purchasedate=prt.purchasedate ) dddhjz , " +
"IFNULL(CONVERT((CONVERT(SUM(prs.price),DECIMAL(12,2))-(SELECT IFNULL(CONVERT(SUM(giyy.colq16),DECIMAL(12,2)),0) FROM supervise_supplychain.gd_instorage_yc giyy WHERE giyy.purchasedate=prt.purchasedate )),DECIMAL(12,2)),0) zthjz " + "IFNULL(CONVERT((CONVERT(SUM(prs.price),DECIMAL(12,2))-(SELECT IFNULL(CONVERT(SUM(giyy.colq16),DECIMAL(12,2)),0) FROM gd_instorage_yc giyy WHERE giyy.purchasedate=prt.purchasedate )),DECIMAL(12,2)),0) zthjz " +
"FROM " + "FROM " +
"supervise_supplychain.purchase_requisition_store prs " + " purchase_requisition_store prs " +
"LEFT JOIN " + "LEFT JOIN " +
"supervise_supplychain.purchase_requisition_tobacco prt ON prt.sid=prs.mainsid " + " purchase_requisition_tobacco prt ON prt.sid=prs.mainsid " +
"GROUP BY prt.code; ") "GROUP BY prt.code; ")
List<Map<String, Object>> ycddmxb(); List<Map<String, Object>> ycddmxb();
@Select("select IFNULL(sum(prodValue),0) from supervise_supplychain.gd_inventory_ok") @Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok")
double amountCurrent(); double amountCurrent();
@Select("select IFNULL(sum(prodValue),0) from supervise_supplychain.gd_inventory_yc") @Select("select IFNULL(sum(prodValue),0) from gd_inventory_yc")
double amountYcCurrent(); double amountYcCurrent();
} }

13
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaygather/ReportSalesDayGatherService.java

@ -24,10 +24,7 @@ import org.springframework.stereotype.Service;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* @author wangpengfei * @author wangpengfei
@ -70,13 +67,17 @@ public class ReportSalesDayGatherService extends MybatisBaseService<ReportSalesD
* @param excelWriter * @param excelWriter
* @param SalesVos * @param SalesVos
*/ */
public void exportReportSalesDayStore(ExcelWriter excelWriter, List<ReportSalesDayGatherVo> SalesVos){ public void exportReportSalesDayStore(Map<String, Object> map,ExcelWriter excelWriter, List<ReportSalesDayGatherVo> SalesVos){
WriteSheet writeSheet = EasyExcel.writerSheet(0).build(); WriteSheet writeSheet = EasyExcel.writerSheet(0).build();
// 填写配置,forceNewRow true表示自动创建一行,后面的数据后移 // 填写配置,forceNewRow true表示自动创建一行,后面的数据后移
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
//填写数据 //填写数据
excelWriter.fill(SalesVos, fillConfig, writeSheet); excelWriter.fill(SalesVos, fillConfig, writeSheet);
if(SalesVos.size()>0){
map.put("serialNumber",SalesVos.get(0).getSerialNumber());
map.put("reportTime",SalesVos.get(0).getReportTime());
}
excelWriter.fill(map, writeSheet);
} }
public ReportSalesDayGather fetchByOrderDate(String orderDate) { public ReportSalesDayGather fetchByOrderDate(String orderDate) {
QueryWrapper<ReportSalesDayGather> qw = new QueryWrapper<>(); QueryWrapper<ReportSalesDayGather> qw = new QueryWrapper<>();

7
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaylog/ReportSalesDayLogMapper.java

@ -22,12 +22,13 @@ public interface ReportSalesDayLogMapper extends BaseMapper<ReportSalesDayLog> {
List<ReportSalesDayLogVo> getAllReportSalesDayLog(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayLog> qw); List<ReportSalesDayLogVo> getAllReportSalesDayLog(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayLog> qw);
//获取入库log //获取入库log
@Select("select count(1) from supervise_supplychain.gd_instorage_log where orderDate=@{orderDate}") @Select("select count(1) from supervise_supplychain.gd_instorage_log where orderDate=#{orderDate}")
int getInstorageLog(@Param("orderDate") String orderDate); int getInstorageLog(@Param("orderDate") String orderDate);
//获取库存log //获取库存log
@Select("select count(1) from supervise_supplychain.gd_inventory_log where orderDate=@{orderDate}") @Select("select count(1) from supervise_supplychain.gd_inventory_log where orderDate=#{orderDate}")
int getInventoryLog(@Param("orderDate") String orderDate); int getInventoryLog(@Param("orderDate") String orderDate);
//获取销售log //获取销售log
@Select("select count(1) from supervise_supplychain.gd_sales_log where orderDate=@{orderDate}") @Select("select count(1) from supervise_supplychain.gd_sales_log where orderDate=#{orderDate}")
int getSalesLog(@Param("orderDate") String orderDate); int getSalesLog(@Param("orderDate") String orderDate);
} }

27
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaylog/ReportSalesDayLogRest.java

@ -1,5 +1,6 @@
package com.yxt.supervise.report.biz.reportsalesdaylog; package com.yxt.supervise.report.biz.reportsalesdaylog;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -76,17 +78,19 @@ public class ReportSalesDayLogRest {
* @param orderDate * @param orderDate
* @throws IOException * @throws IOException
*/ */
@PostMapping("/SalesReport")
public void SalesReport(String orderDate) throws IOException { public void SalesReport(String orderDate) throws IOException {
String xlsxpath = xlsxtmplPath + "销售汇总日报表"+orderDate+".xlsx"; String xlsxpath = xlsxtmplPath + "销售汇总日报表"+orderDate+".xlsx";
// 创建ExcelWriterBuilder // 创建ExcelWriterBuilder
ExcelWriterBuilder excelWriterBuilder = EasyExcel.write(xlsxpath).withTemplate(TEMPLATE_FILE_NAME); ExcelWriterBuilder excelWriterBuilder = EasyExcel.write(xlsxpath).withTemplate(TEMPLATE_FILE_NAME);
ExcelWriter excelWriter = excelWriterBuilder.build(); ExcelWriter excelWriter = excelWriterBuilder.build();
Map<String, Object> map =new HashMap<>();
// 写入list之前的数据 // 写入list之前的数据
reportSalesDayGatherService.exportReportSalesDayStore(excelWriter,reportSalesDayGatherService.getAllReportSalesDayGather(orderDate)); reportSalesDayGatherService.exportReportSalesDayStore(map,excelWriter,reportSalesDayGatherService.getAllReportSalesDayGather(orderDate));
reportSalesDayStoreService.exportReportSalesDayStore(excelWriter,reportSalesDayStoreService.getAllReportSalesDayStore(orderDate)); reportSalesDayStoreService.exportReportSalesDayStore(map,excelWriter,reportSalesDayStoreService.getAllReportSalesDayStore(orderDate));
reportSalesDayStoreProductService.exportReportSalesDayStoreProduct(excelWriter,reportSalesDayStoreProductService.getAllReportSalesDayStoreProduct(orderDate)); reportSalesDayStoreProductService.exportReportSalesDayStoreProduct(map,excelWriter,reportSalesDayStoreProductService.getAllReportSalesDayStoreProduct(orderDate));
reportSalesDayTobaccoStoreService.exportReportSalesDayTobaccoStore(excelWriter,reportSalesDayTobaccoStoreService.getAllReportSalesDayTobaccoStore(orderDate)); reportSalesDayTobaccoStoreService.exportReportSalesDayTobaccoStore(map,excelWriter,reportSalesDayTobaccoStoreService.getAllReportSalesDayTobaccoStore(orderDate));
reportSalesDayTobaccoStoreProductService.exportReportSalesDayTobaccoStoreProduct(excelWriter,reportSalesDayTobaccoStoreProductService.getAllReportSalesDayTobaccoStoreProduct(orderDate)); reportSalesDayTobaccoStoreProductService.exportReportSalesDayTobaccoStoreProduct(map,excelWriter,reportSalesDayTobaccoStoreProductService.getAllReportSalesDayTobaccoStoreProduct(orderDate));
ReportSalesDayLog log=ReportSalesDayLogService.getOne(new QueryWrapper<ReportSalesDayLog>().eq("orderDate",orderDate)); ReportSalesDayLog log=ReportSalesDayLogService.getOne(new QueryWrapper<ReportSalesDayLog>().eq("orderDate",orderDate));
//保存url //保存url
String newFileName = "销售汇总日报表" + orderDate + ".xlsx"; String newFileName = "销售汇总日报表" + orderDate + ".xlsx";
@ -104,4 +108,17 @@ public class ReportSalesDayLogRest {
public boolean getLog(String orderDate){ public boolean getLog(String orderDate){
return ReportSalesDayLogService.getLog(orderDate); return ReportSalesDayLogService.getLog(orderDate);
} }
public void addReportLog(String orderDate){
//添加reportlog
List<ReportSalesDayLog>list=ReportSalesDayLogService.list(new QueryWrapper<ReportSalesDayLog>().eq("orderDate",orderDate));
if(list.size()==0){
Date date=new Date();
String dfmt = DateUtil.format(date, "yyyy-MM-dd");
ReportSalesDayLog log=new ReportSalesDayLog();
log.setOrderDate(orderDate);
log.setReportTime(dfmt);
log.setSerialNumber(orderDate);
ReportSalesDayLogService.addReportLog(log);
}
}
} }

9
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaylog/ReportSalesDayLogService.java

@ -1,5 +1,6 @@
package com.yxt.supervise.report.biz.reportsalesdaylog; package com.yxt.supervise.report.biz.reportsalesdaylog;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -64,10 +65,14 @@ public class ReportSalesDayLogService extends MybatisBaseService<ReportSalesDayL
int instLog=baseMapper.getInstorageLog(orderDate); int instLog=baseMapper.getInstorageLog(orderDate);
int inveLog=baseMapper.getInventoryLog(orderDate); int inveLog=baseMapper.getInventoryLog(orderDate);
int salesLog=baseMapper.getSalesLog(orderDate); int salesLog=baseMapper.getSalesLog(orderDate);
if(instLog==1 && inveLog==1&& salesLog==1){ if(instLog>=1 && inveLog>=1&& salesLog>=1){
return true; return true;
} }
return false; return false;
} }
public void addReportLog(ReportSalesDayLog log){
ReportSalesDayLog entity=new ReportSalesDayLog();
BeanUtil.copyProperties(log, entity, "id", "sid");
baseMapper.insert(log);
}
} }

13
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaystore/ReportSalesDayStoreMapper.java

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStore; import com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStore;
import com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStoreVo; import com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStoreVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
@ -20,16 +21,18 @@ public interface ReportSalesDayStoreMapper extends BaseMapper<ReportSalesDayStor
List<ReportSalesDayStoreVo> getReportSalesDayStore(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayStore> qw); List<ReportSalesDayStoreVo> getReportSalesDayStore(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayStore> qw);
List<ReportSalesDayStoreVo> getAllReportSalesDayStore(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayStore> qw); List<ReportSalesDayStoreVo> getAllReportSalesDayStore(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayStore> qw);
@Select(" SELECT" + @Select(" SELECT" +
" ROUND( SUM( s.saleNum * s.salePrice ), 2 ) AS salesVolume," + " ROUND( SUM( s.saleNum * s.salePrice ), 2 ) AS saleAmount," +
" i.NAME AS storeName," + " i.NAME AS storeCodeName," +
" rank() over(order by s.storeCode) as serialNumber," + " rank() over(order by s.storeCode) as sort," +
" s.dataDate as date" + " s.dataDate as date" +
" FROM" + " FROM" +
" supervise_supplychain.gd_sales_gd s" + " gd_sales_gd s" +
" LEFT JOIN supervise_supplychain.store_info i ON i.`code` = s.storeCode" + " LEFT JOIN store_info i ON i.`code` = s.storeCode" +
" where s.dataDate=#{orderDate}" + " where s.dataDate=#{orderDate}" +
" GROUP BY" + " GROUP BY" +
" s.storeCode") " s.storeCode")
List<ReportSalesDayStore> getAllStoreSalesReport(@Param("orderDate") String orderDate); List<ReportSalesDayStore> getAllStoreSalesReport(@Param("orderDate") String orderDate);
@Delete("delete from report_sales_day_store where orderDate=#{orderDate} ")
void clearByOrderDate(@Param("orderDate") String orderDate);
} }

18
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaystore/ReportSalesDayStoreService.java

@ -53,7 +53,11 @@ public class ReportSalesDayStoreService extends MybatisBaseService<ReportSalesDa
return rb.success().setMsg("保存门店销售信息成功"); return rb.success().setMsg("保存门店销售信息成功");
} }
public void clearByOrderDate(String orderDate) {
baseMapper.clearByOrderDate(orderDate);
}
public void getSalesStore(String orderDate) { public void getSalesStore(String orderDate) {
this.clearByOrderDate(orderDate);//清理当日数据
List<ReportSalesDayStore> list= baseMapper.getAllStoreSalesReport(orderDate); List<ReportSalesDayStore> list= baseMapper.getAllStoreSalesReport(orderDate);
int size=list.size(); int size=list.size();
double amount=0; double amount=0;
@ -93,7 +97,7 @@ public class ReportSalesDayStoreService extends MybatisBaseService<ReportSalesDa
* @param excelWriter * @param excelWriter
* @param SalesVos * @param SalesVos
*/ */
public void exportReportSalesDayStore(ExcelWriter excelWriter, List<ReportSalesDayStoreVo> SalesVos){ public void exportReportSalesDayStore(Map<String, Object> map,ExcelWriter excelWriter, List<ReportSalesDayStoreVo> SalesVos){
List<CellRangeAddress> list = new ArrayList<>(); List<CellRangeAddress> list = new ArrayList<>();
//new CellRangeAddress(开始行,结束行,开始列,结束列) //new CellRangeAddress(开始行,结束行,开始列,结束列)
list.add(new CellRangeAddress(3, SalesVos.size()+3, 1, 3)); list.add(new CellRangeAddress(3, SalesVos.size()+3, 1, 3));
@ -103,18 +107,24 @@ public class ReportSalesDayStoreService extends MybatisBaseService<ReportSalesDa
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
//填写数据 //填写数据
excelWriter.fill(SalesVos, fillConfig, writeSheet); excelWriter.fill(SalesVos, fillConfig, writeSheet);
WriteSheet writeSheet1 = EasyExcel.writerSheet(1).build();
if(SalesVos.size()>0){
map.put("serialNumber",SalesVos.get(0).getSerialNumber());
map.put("reportTime",SalesVos.get(0).getReportTime());
map.put("storeNumber",SalesVos.get(0).getStoreNumber());
}
excelWriter.fill(map, writeSheet1);
// list 后面还有个统计 想办法手动写入 // list 后面还有个统计 想办法手动写入
List<List<String>> totalListList = ListUtils.newArrayList(); List<List<String>> totalListList = ListUtils.newArrayList();
List<String> totalList = ListUtils.newArrayList(); List<String> totalList = ListUtils.newArrayList();
totalListList.add(totalList); totalListList.add(totalList);
BigDecimal total=new BigDecimal("0");
totalList.add(""); totalList.add("");
totalList.add(""); totalList.add("");
totalList.add(""); totalList.add("");
totalList.add("统计:"); totalList.add("统计:");
totalList.add(String.valueOf(total)); totalList.add(SalesVos.get(1).getCountAmount());
// 这里是write 别和fill 搞错了 // 这里是write 别和fill 搞错了
WriteSheet writeSheet1 = EasyExcel.writerSheet(1).build();
excelWriter.write(totalListList,writeSheet1); excelWriter.write(totalListList,writeSheet1);
} }
} }

5
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaystoreproduct/ReportSalesDayStoreProductMapper.java

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yxt.supervise.report.api.reportsalesdaystoreproduct.ReportSalesDayStoreProduct; import com.yxt.supervise.report.api.reportsalesdaystoreproduct.ReportSalesDayStoreProduct;
import com.yxt.supervise.report.api.reportsalesdaystoreproduct.ReportSalesDayStoreProductVo; import com.yxt.supervise.report.api.reportsalesdaystoreproduct.ReportSalesDayStoreProductVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
@ -26,9 +27,11 @@ public interface ReportSalesDayStoreProductMapper extends BaseMapper<ReportSales
" ROUND((s.saleNum*s.salePrice),2) as saleAmount," + " ROUND((s.saleNum*s.salePrice),2) as saleAmount," +
" s.orderType as saleType,s.orderNo as saleCode,s.prodCode as productCode" + " s.orderType as saleType,s.orderNo as saleCode,s.prodCode as productCode" +
" FROM" + " FROM" +
" supervise_supplychain.gd_sales_gd s" + " supervise_supplychain.gd_sales s" +
" LEFT JOIN supervise_supplychain.store_info i ON i.`code` = s.storeCode" + " LEFT JOIN supervise_supplychain.store_info i ON i.`code` = s.storeCode" +
" where s.dataDate =#{orderDate}" + " where s.dataDate =#{orderDate}" +
" ORDER BY i. name") " ORDER BY i. name")
List<ReportSalesDayStoreProduct> getAllStoreSalesReport(@Param("orderDate") String orderDate); List<ReportSalesDayStoreProduct> getAllStoreSalesReport(@Param("orderDate") String orderDate);
@Delete("delete from report_sales_day_store_product where orderDate=#{orderDate} ")
void clearByOrderDate(@Param("orderDate") String orderDate);
} }

14
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaystoreproduct/ReportSalesDayStoreProductService.java

@ -56,7 +56,11 @@ public class ReportSalesDayStoreProductService extends MybatisBaseService<Report
return rb.success().setMsg("保存门店商品信息成功"); return rb.success().setMsg("保存门店商品信息成功");
} }
public void clearByOrderDate(String orderDate) {
baseMapper.clearByOrderDate(orderDate);
}
public void getSalesStoreProduct(String orderDate) { public void getSalesStoreProduct(String orderDate) {
this.clearByOrderDate(orderDate);//清理当日数据
List<ReportSalesDayStoreProduct> list= baseMapper.getAllStoreSalesReport(orderDate); List<ReportSalesDayStoreProduct> list= baseMapper.getAllStoreSalesReport(orderDate);
int size=list.size(); int size=list.size();
double amount=0; double amount=0;
@ -65,6 +69,7 @@ public class ReportSalesDayStoreProductService extends MybatisBaseService<Report
for(ReportSalesDayStoreProduct store:list){ for(ReportSalesDayStoreProduct store:list){
amount=amount+store.getSaleAmount(); amount=amount+store.getSaleAmount();
} }
for (ReportSalesDayStoreProduct store:list){ for (ReportSalesDayStoreProduct store:list){
store.setProductNumber(String.valueOf(size)); store.setProductNumber(String.valueOf(size));
store.setCountAmount(amount); store.setCountAmount(amount);
@ -95,16 +100,21 @@ public class ReportSalesDayStoreProductService extends MybatisBaseService<Report
* @param excelWriter * @param excelWriter
* @param SalesVos * @param SalesVos
*/ */
public void exportReportSalesDayStoreProduct(ExcelWriter excelWriter, List<ReportSalesDayStoreProductVo> SalesVos){ public void exportReportSalesDayStoreProduct(Map<String, Object> map,ExcelWriter excelWriter, List<ReportSalesDayStoreProductVo> SalesVos){
//得到所有要导出的数据 //得到所有要导出的数据
WriteSheet writeSheetGood = EasyExcel.writerSheet(2).build(); WriteSheet writeSheetGood = EasyExcel.writerSheet(2).build();
//填写数据 //填写数据
excelWriter.fill(SalesVos, writeSheetGood); excelWriter.fill(SalesVos, writeSheetGood);
if(SalesVos.size()>0){
map.put("serialNumber",SalesVos.get(0).getSerialNumber());
map.put("reportTime",SalesVos.get(0).getReportTime());
map.put("productNumber",SalesVos.get(0).getProductNumber());
}
excelWriter.fill(map, writeSheetGood);
// list 后面还有个统计 想办法手动写入 // list 后面还有个统计 想办法手动写入
List<List<String>> totalListList1 = ListUtils.newArrayList(); List<List<String>> totalListList1 = ListUtils.newArrayList();
List<String> totalList1 = ListUtils.newArrayList(); List<String> totalList1 = ListUtils.newArrayList();
totalListList1.add(totalList1); totalListList1.add(totalList1);
BigDecimal total=new BigDecimal("0");
totalList1.add(""); totalList1.add("");
totalList1.add(""); totalList1.add("");
totalList1.add(""); totalList1.add("");

13
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaytobaccostore/ReportSalesDayTobaccoStoreMapper.java

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStore; import com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStore;
import com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreVo; import com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
@ -21,15 +22,17 @@ public interface ReportSalesDayTobaccoStoreMapper extends BaseMapper<ReportSales
List<ReportSalesDayTobaccoStoreVo> getAllReportSalesDayTobaccoStore(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayTobaccoStore> qw); List<ReportSalesDayTobaccoStoreVo> getAllReportSalesDayTobaccoStore(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayTobaccoStore> qw);
@Select(" SELECT" + @Select(" SELECT" +
" ROUND( SUM( s.saleNum * s.salePrice ), 2 ) AS salesVolume," + " ROUND( SUM( s.saleNum * s.salePrice ), 2 ) AS saleAmount," +
" i.NAME AS storeName," + " i.NAME AS storeCodeName," +
" rank() over(order by s.storeCode) as serialNumber," + " rank() over(order by s.storeCode) as sort," +
" s.dataDate as date" + " s.dataDate as date" +
" FROM" + " FROM" +
" supervise_supplychain.gd_sales_yc s" + " gd_sales_yc s" +
" LEFT JOIN supervise_supplychain.store_info i ON i.`code` = s.storeCode" + " LEFT JOIN store_info i ON i.`code` = s.storeCode" +
" where s.dataDate=#{orderDate}" + " where s.dataDate=#{orderDate}" +
" GROUP BY" + " GROUP BY" +
" s.storeCode") " s.storeCode")
List<ReportSalesDayTobaccoStore> getAllTobaccoReport(@Param("orderDate") String orderDate); List<ReportSalesDayTobaccoStore> getAllTobaccoReport(@Param("orderDate") String orderDate);
@Delete("delete from report_sales_day_tobacco_store where orderDate=#{orderDate} ")
void clearByOrderDate(@Param("orderDate") String orderDate);
} }

2
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaytobaccostore/ReportSalesDayTobaccoStoreMapper.xml

@ -7,7 +7,7 @@
SELECT SELECT
* *
FROM FROM
report_sales_day_store_product report_sales_day_tobacco_store
<where> ${ew.sqlSegment} </where> <where> ${ew.sqlSegment} </where>
</select> </select>
<select id="getAllReportSalesDayTobaccoStore" resultType="com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreVo"> <select id="getAllReportSalesDayTobaccoStore" resultType="com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreVo">

22
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaytobaccostore/ReportSalesDayTobaccoStoreService.java

@ -58,7 +58,11 @@ public class ReportSalesDayTobaccoStoreService extends MybatisBaseService<Report
return rb.success().setMsg("保存门店烟草信息成功"); return rb.success().setMsg("保存门店烟草信息成功");
} }
public void clearByOrderDate(String orderDate) {
baseMapper.clearByOrderDate(orderDate);
}
public void getAllTobaccoReport(String orderDate) { public void getAllTobaccoReport(String orderDate) {
this.clearByOrderDate(orderDate);//清理当日数据
List<ReportSalesDayTobaccoStore> list= baseMapper.getAllTobaccoReport(orderDate); List<ReportSalesDayTobaccoStore> list= baseMapper.getAllTobaccoReport(orderDate);
int size=list.size(); int size=list.size();
double amount=0; double amount=0;
@ -97,7 +101,7 @@ public class ReportSalesDayTobaccoStoreService extends MybatisBaseService<Report
* @param excelWriter * @param excelWriter
* @param SalesVos * @param SalesVos
*/ */
public void exportReportSalesDayTobaccoStore(ExcelWriter excelWriter, List<ReportSalesDayTobaccoStoreVo> SalesVos) { public void exportReportSalesDayTobaccoStore(Map<String, Object> map,ExcelWriter excelWriter, List<ReportSalesDayTobaccoStoreVo> SalesVos) {
List<CellRangeAddress> list = new ArrayList<>(); List<CellRangeAddress> list = new ArrayList<>();
//new CellRangeAddress(开始行,结束行,开始列,结束列) //new CellRangeAddress(开始行,结束行,开始列,结束列)
list.add(new CellRangeAddress(3, SalesVos.size()+3, 1, 3)); list.add(new CellRangeAddress(3, SalesVos.size()+3, 1, 3));
@ -107,18 +111,28 @@ public class ReportSalesDayTobaccoStoreService extends MybatisBaseService<Report
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
//填写数据 //填写数据
excelWriter.fill(SalesVos, fillConfig, writeSheet); excelWriter.fill(SalesVos, fillConfig, writeSheet);
WriteSheet writeSheet1 = EasyExcel.writerSheet(3).build();
if(SalesVos.size()>0){
map.put("serialNumber",SalesVos.get(0).getSerialNumber());
map.put("reportTime",SalesVos.get(0).getReportTime());
map.put("storeNumber",SalesVos.size());
}
excelWriter.fill(map, writeSheet1);
// list 后面还有个统计 想办法手动写入 // list 后面还有个统计 想办法手动写入
List<List<String>> totalListList = ListUtils.newArrayList(); List<List<String>> totalListList = ListUtils.newArrayList();
List<String> totalList = ListUtils.newArrayList(); List<String> totalList = ListUtils.newArrayList();
totalListList.add(totalList); totalListList.add(totalList);
BigDecimal total=new BigDecimal("0");
totalList.add(""); totalList.add("");
totalList.add(""); totalList.add("");
totalList.add(""); totalList.add("");
totalList.add("统计:"); totalList.add("统计:");
totalList.add(String.valueOf(total)); if(SalesVos.get(0).getCountAmount().equals("")|| SalesVos.get(0).getCountAmount().equals(null)){
totalList.add("0");
}else{
totalList.add(SalesVos.get(0).getCountAmount());
}
// 这里是write 别和fill 搞错了 // 这里是write 别和fill 搞错了
WriteSheet writeSheet1 = EasyExcel.writerSheet(3).build();
excelWriter.write(totalListList,writeSheet1); excelWriter.write(totalListList,writeSheet1);
} }
} }

4
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaytobaccostoreproduct/ReportSalesDayTobaccoStoreProductMapper.java

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct.ReportSalesDayTobaccoStoreProduct; import com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct.ReportSalesDayTobaccoStoreProduct;
import com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct.ReportSalesDayTobaccoStoreProductVo; import com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct.ReportSalesDayTobaccoStoreProductVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
@ -32,6 +33,7 @@ public interface ReportSalesDayTobaccoStoreProductMapper extends BaseMapper<Repo
" where s.dataDate=#{orderDate}" + " where s.dataDate=#{orderDate}" +
" ORDER BY i. name") " ORDER BY i. name")
List<ReportSalesDayTobaccoStoreProduct> getSalesStoreTobaccoProduct(@Param("orderDate") String ordreDate); List<ReportSalesDayTobaccoStoreProduct> getSalesStoreTobaccoProduct(@Param("orderDate") String ordreDate);
@Delete("delete from report_sales_day_tobacco_store_product where orderDate=#{orderDate} ")
void clearByOrderDate(@Param("orderDate") String orderDate);
} }

12
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/reportsalesdaytobaccostoreproduct/ReportSalesDayTobaccoStoreProductService.java

@ -56,7 +56,11 @@ public class ReportSalesDayTobaccoStoreProductService extends MybatisBaseService
return rb.success().setMsg("保存门店烟草商品信息成功"); return rb.success().setMsg("保存门店烟草商品信息成功");
} }
public void clearByOrderDate(String orderDate) {
baseMapper.clearByOrderDate(orderDate);
}
public void getSalesStoreTobaccoProduct(String orderDate) { public void getSalesStoreTobaccoProduct(String orderDate) {
this.clearByOrderDate(orderDate);//清理当日数据
List<ReportSalesDayTobaccoStoreProduct> list= baseMapper.getSalesStoreTobaccoProduct(orderDate); List<ReportSalesDayTobaccoStoreProduct> list= baseMapper.getSalesStoreTobaccoProduct(orderDate);
int size=list.size(); int size=list.size();
double amount=0; double amount=0;
@ -95,11 +99,17 @@ public class ReportSalesDayTobaccoStoreProductService extends MybatisBaseService
* @param excelWriter * @param excelWriter
* @param SalesVos * @param SalesVos
*/ */
public void exportReportSalesDayTobaccoStoreProduct(ExcelWriter excelWriter, List<ReportSalesDayTobaccoStoreProductVo>SalesVos){ public void exportReportSalesDayTobaccoStoreProduct(Map<String, Object> map,ExcelWriter excelWriter, List<ReportSalesDayTobaccoStoreProductVo>SalesVos){
//得到所有要导出的数据 //得到所有要导出的数据
WriteSheet writeSheetGood = EasyExcel.writerSheet(4).build(); WriteSheet writeSheetGood = EasyExcel.writerSheet(4).build();
//填写数据 //填写数据
excelWriter.fill(SalesVos, writeSheetGood); excelWriter.fill(SalesVos, writeSheetGood);
if(SalesVos.size()>0){
map.put("serialNumber",SalesVos.get(0).getSerialNumber());
map.put("reportTime",SalesVos.get(0).getReportTime());
map.put("productNumber",SalesVos.get(0).getProductNumber());
}
excelWriter.fill(map, writeSheetGood);
// list 后面还有个统计 想办法手动写入 // list 后面还有个统计 想办法手动写入
List<List<String>> totalListList1 = ListUtils.newArrayList(); List<List<String>> totalListList1 = ListUtils.newArrayList();
List<String> totalList1 = ListUtils.newArrayList(); List<String> totalList1 = ListUtils.newArrayList();

9
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/thread/ReportThread.java

@ -34,16 +34,19 @@ public class ReportThread {
ReportSalesDayTobaccoStoreProductService reportSalesDayTobaccoStoreProductService; ReportSalesDayTobaccoStoreProductService reportSalesDayTobaccoStoreProductService;
@Autowired @Autowired
ReportSalesDayLogRest reportSalesDayLogRest; ReportSalesDayLogRest reportSalesDayLogRest;
long stime;
long etime;
public void DoReport(String orderDate) { public void DoReport(String orderDate) {
log.info("开始统计报表"); log.info("开始统计报表");
long stime = System.currentTimeMillis(); stime = System.currentTimeMillis();
reportSalesDayGatherService.clearAndInitByOrderDate(orderDate); reportSalesDayGatherService.clearAndInitByOrderDate(orderDate);
reportSalesDayStoreService.getSalesStore(orderDate); reportSalesDayStoreService.getSalesStore(orderDate);
reportSalesDayStoreProductService.getSalesStoreProduct(orderDate); reportSalesDayStoreProductService.getSalesStoreProduct(orderDate);
reportSalesDayTobaccoStoreService.getAllTobaccoReport(orderDate); reportSalesDayTobaccoStoreService.getAllTobaccoReport(orderDate);
reportSalesDayTobaccoStoreProductService.getSalesStoreTobaccoProduct(orderDate); reportSalesDayTobaccoStoreProductService.getSalesStoreTobaccoProduct(orderDate);
//添加log
reportSalesDayLogRest.addReportLog(orderDate);
ThreadUtil.execute(()->{ExcelThread(orderDate);}); ThreadUtil.execute(()->{ExcelThread(orderDate);});
} }
@ -64,5 +67,7 @@ public class ReportThread {
public void DoExcel(String orderDate) throws IOException { public void DoExcel(String orderDate) throws IOException {
log.info("开始生成excel报表"); log.info("开始生成excel报表");
reportSalesDayLogRest.SalesReport(orderDate); reportSalesDayLogRest.SalesReport(orderDate);
etime = System.currentTimeMillis();
System.out.println("时间:"+(etime-stime));
} }
} }

Loading…
Cancel
Save