diff --git a/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/supplierarrivalreport/SupplierArrivalReportVo.java b/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/supplierarrivalreport/SupplierArrivalReportVo.java index d48b8b47..383a08f8 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/supplierarrivalreport/SupplierArrivalReportVo.java +++ b/yxt_supervise/supervise-portal/supervise-portal-api/src/main/java/com/yxt/supervise/portal/api/supplierarrivalreport/SupplierArrivalReportVo.java @@ -4,6 +4,8 @@ import com.yxt.common.core.vo.Vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.math.BigDecimal; + /** * @author wangpengfei * @date 2023/4/19 13:41 @@ -27,20 +29,28 @@ public class SupplierArrivalReportVo implements Vo { private String loanAmount; //订单金额 @ApiModelProperty("订单金额") - private String orderAmount; + private BigDecimal orderAmount; //实际到货 @ApiModelProperty("实际到货") - private String actualArrival; + private BigDecimal actualArrival; + //实际到货数量 + private String actualArrivalNumber; //在途 @ApiModelProperty("在途") - private String transit; + private BigDecimal transit; + //在途数量 + private String transitNumber; //销售渠道 private String storeName; //订单到货价值 private String orderArrivalAmount; //超出 - private String exceed; - - + private BigDecimal exceed; + //数量 + private String number; + //商品名 + private String proName; + //是否延期 + private String logo; } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsalesreport/GdSalesReportMapper.xml b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsalesreport/GdSalesReportMapper.xml index bb203035..6d2bfe96 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsalesreport/GdSalesReportMapper.xml +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsalesreport/GdSalesReportMapper.xml @@ -50,7 +50,8 @@ - SELECT ROUND( SUM( s.saleNum * s.salePrice ), 2 ) AS salesVolume, i.NAME AS storeName diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsalesreport/GdSalesReportRest.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsalesreport/GdSalesReportRest.java index fb08178a..5fdf1bdd 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsalesreport/GdSalesReportRest.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsalesreport/GdSalesReportRest.java @@ -44,47 +44,92 @@ import static io.netty.handler.codec.smtp.SmtpRequests.data; @RestController @RequestMapping("/report") public class GdSalesReportRest { - private static final String EXCEL_FILE_NAME="门店销售明细报表"+ System.currentTimeMillis() +".xlsx"; + private static final String EXCEL_FILE_NAME="D:\\opt\\upFiles"+"\\门店销售明细报表"+ System.currentTimeMillis() +".xlsx"; private static final String TEMPLATE_FILE_NAME="C:\\Users\\www19\\Desktop\\1.xlsx"; @Autowired GdSalesReportService gdSalesReportService; @PostMapping("/getStoreSalesReport") public ResultBean getStoreSalesReport(@RequestBody PagerQuery pq){ + System.out.println("主线程开启"); + if(true){ + new Thread(new GdSalesThread(pq)).start(); + } ResultBean rb = ResultBean.fireFail(); List pv = gdSalesReportService.getStoreSalesReport(pq); + System.out.println("主线程结束"); return rb.success().setData(pv); } - @PostMapping("/exportStoreSalesReport") + + /*** + + */ + public class GdSalesThread extends Thread{ + PagerQuery pq=new PagerQuery<>(); + public GdSalesThread(PagerQuery pq) { + this.pq = pq; + } + public void run(){ + try { + System.out.println("excel线程开启"); + SalesReport(pq); + System.out.println("excel线程结束"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + @PostMapping("/SalesReport") @ApiOperation(value = "门店销售明细报表") - public void exportStoreSalesReport(@RequestBody PagerQuery pq, HttpServletResponse response) throws IOException { - List excelVos =gdSalesReportService.getAllStoreSalesReport(pq); - //获取模板(模板你可以放在任何位置,前提是你能获取到。这里放在resource下) - response.setContentType( "application/vnd.ms-excel"); - response.setCharacterEncoding("utf8"); - response.setHeader("Content-disposition","attachment;filename="+ EXCEL_FILE_NAME ); - ServletOutputStream outputStream = response.getOutputStream(); + public void SalesReport(@RequestBody PagerQuery pq) throws IOException { + List StoreSalesVos =gdSalesReportService.getAllStoreSalesReport(pq); + ListgoodsSalesVos= gdSalesReportService.getAllGoodsSalesReport(pq); + List StoreSalesYcVos = gdSalesReportService.StoreSalesYcReportExcelVo(pq); + List goodsSalesYcVos=gdSalesReportService.GoodsSalesReportYcExcelVo(pq); + // 创建ExcelWriterBuilder + ExcelWriterBuilder excelWriterBuilder = EasyExcel.write(EXCEL_FILE_NAME).withTemplate(TEMPLATE_FILE_NAME); + ExcelWriter excelWriter = excelWriterBuilder.build(); + // 写入list之前的数据 + Map map = new HashMap(); + map.put("date",StoreSalesVos.get(1).getDate()); + map.put("storeNum",StoreSalesVos.size()); + + //门店销售明细表 + exportStoreSalesReport(map,excelWriter,StoreSalesVos); + //门店商品销售明细表 + exportGoodsSalesReport(map,excelWriter,goodsSalesVos); + //烟草门店销售明细表 + exportStoreSalesReportYc(map,excelWriter,StoreSalesYcVos); + //烟草门店商品销售明细表 + exportGoodsSalesReportYc(map,excelWriter,goodsSalesYcVos); + + excelWriter.finish(); + } + /** + * 门店销售明细表 + * @param map + * @param excelWriter + * @param StoreSalesVos + * @throws IOException + */ + public void exportStoreSalesReport(Map map,ExcelWriter excelWriter,List StoreSalesVos) throws IOException { List list = new ArrayList<>(); //new CellRangeAddress(开始行,结束行,开始列,结束列) - list.add(new CellRangeAddress(3, excelVos.size(), 1, 3)); - // 创建ExcelWriterBuilder - ExcelWriterBuilder excelWriterBuilder = EasyExcel.write(outputStream).withTemplate(TEMPLATE_FILE_NAME); - ExcelWriter excelWriter = excelWriterBuilder.build(); + list.add(new CellRangeAddress(3, StoreSalesVos.size(), 1, 3)); // 创建writeSheet,并注册合并单元格handler - WriteSheet writeSheet = EasyExcel.writerSheet(0).registerWriteHandler(new MyHandler(0,list)).build(); + WriteSheet writeSheet = EasyExcel.writerSheet(1).registerWriteHandler(new MyHandler(0,list)).build(); // 填写配置,forceNewRow true表示自动创建一行,后面的数据后移 FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); //填写数据 - excelWriter.fill(excelVos, fillConfig, writeSheet); + excelWriter.fill(StoreSalesVos, fillConfig, writeSheet); //excelWriter.fill(excelVos, writeSheet); // 写入list之前的数据 - Map map = new HashMap(); + Calendar cal = Calendar.getInstance(); Date date = new Date(); + cal.setTime(date); SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd"); - map.put("date",excelVos.get(1).getDate()); - map.put("storeNum",excelVos.size()); - map.put("number","mdxsmxb"+dateFormat.format(date)); + map.put("number","mdxsmxb"+cal.get(Calendar.YEAR)+cal.get(Calendar.MONTH)+1+cal.get(Calendar.DAY_OF_MONTH)); excelWriter.fill(map, writeSheet); // list 后面还有个统计 想办法手动写入 // 这里偷懒直接用list 也可以用对象 @@ -92,7 +137,7 @@ public class GdSalesReportRest { List totalList = ListUtils.newArrayList(); totalListList.add(totalList); BigDecimal total=new BigDecimal("0"); - for(StoreSalesReportExcelVo i:excelVos){ + for(StoreSalesReportExcelVo i:StoreSalesVos){ total=total.add(i.getSalesVolume()); } totalList.add(""); @@ -100,29 +145,43 @@ public class GdSalesReportRest { totalList.add(""); totalList.add("统计:"); totalList.add(String.valueOf(total)); - // 这里是write 别和fill 搞错了 - List list1 = new ArrayList<>(); - //new CellRangeAddress(开始行,结束行,开始列,结束列) - list1.add(new CellRangeAddress(excelVos.size()+1, excelVos.size()+2, 0, 4)); - WriteSheet writeSheet1 = EasyExcel.writerSheet(0).registerWriteHandler(new MyHandler(0,list1)).build(); + // 这里是write 别和fill 搞错了 + WriteSheet writeSheet1 = EasyExcel.writerSheet(1).build(); excelWriter.write(totalListList,writeSheet1); - //2 - ListgoodsSalesReportExcelVos= gdSalesReportService.getAllGoodsSalesReport(pq); - WriteSheet writeSheetGood = EasyExcel.writerSheet(1).build(); - // 填写配置,forceNewRow true表示自动创建一行,后面的数据后移 - //FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); + } + @PostMapping("/getGoodsSalesReport") + public ResultBean getGoodsSalesReport(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + List pv = gdSalesReportService.getGoodsSalesReport(pq); + return rb.success().setData(pv); + } + + /** + * 门店商品销售明细表 + * @param map + * @param excelWriter + * @param goodsSalesReportExcelVos + * @throws IOException + */ + public void exportGoodsSalesReport(Map map,ExcelWriter excelWriter,ListgoodsSalesReportExcelVos) throws IOException { + //得到所有要导出的数据 + WriteSheet writeSheetGood = EasyExcel.writerSheet(2).build(); //填写数据 - excelWriter.fill(goodsSalesReportExcelVos, fillConfig, writeSheetGood); + excelWriter.fill(goodsSalesReportExcelVos, writeSheetGood); //excelWriter.fill(goodsSalesReportExcelVos, writeSheetGood); // 写入list之前的数据 + Calendar cal = Calendar.getInstance(); + Date date = new Date(); + cal.setTime(date); + SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd"); + map.put("number","mdspxsmxb"+cal.get(Calendar.YEAR)+cal.get(Calendar.MONTH)+1+cal.get(Calendar.DAY_OF_MONTH)); map.put("storeNum",goodsSalesReportExcelVos.size()); excelWriter.fill(map, writeSheetGood); // list 后面还有个统计 想办法手动写入 -// 这里偷懒直接用list 也可以用对象 List> totalListList1 = ListUtils.newArrayList(); List totalList1 = ListUtils.newArrayList(); totalListList1.add(totalList1); - + BigDecimal total=new BigDecimal("0"); for(GoodsSalesReportExcelVo i:goodsSalesReportExcelVos){ total=total.add(i.getTotal()); } @@ -136,32 +195,6 @@ public class GdSalesReportRest { totalList1.add(String.valueOf(total)); // 这里是write 别和fill 搞错了 excelWriter.write(totalListList1,writeSheetGood); - - excelWriter.finish(); - outputStream.flush(); - outputStream.close(); - } - @PostMapping("/getGoodsSalesReport") - public ResultBean getGoodsSalesReport(@RequestBody PagerQuery pq){ - ResultBean rb = ResultBean.fireFail(); - List pv = gdSalesReportService.getGoodsSalesReport(pq); - return rb.success().setData(pv); - } - @PostMapping("/exportGoodsSalesReport") - @ApiOperation(value = "门店商品销售明细报表") - public void exportGoodsSalesReport(@RequestBody PagerQuery pq, HttpServletResponse response) throws IOException { - //得到所有要导出的数据 - List excelVos = gdSalesReportService.getAllGoodsSalesReport(pq); - String fileName = "门店商品销售明细报表" + System.currentTimeMillis() + ".xlsx"; - response.setContentType( "application/vnd.ms-excel"); - response.setCharacterEncoding("utf8"); - response.setHeader("Content-disposition","attachment;filename="+ fileName ); - // 这里 需要指定写用哪个class去读,然后写到第一个sheet,名字为模板 然后文件流会自动关闭 - // 如果这里想使用03 则 传入excelType参数即可 - ServletOutputStream outputStream = response.getOutputStream(); - EasyExcel.write(outputStream, StoreSalesReportExcelVo.class).sheet("门店商品销售明细报表").doWrite(excelVos); - outputStream.flush(); - outputStream.close(); } @PostMapping("/getStoreSalesReportYc") public ResultBean getStoreSalesReportYc(@RequestBody PagerQuery pq){ @@ -169,21 +202,40 @@ public class GdSalesReportRest { List pv = gdSalesReportService.getStoreSalesReportYc(pq); return rb.success().setData(pv); } - @PostMapping("/exportgetStoreSalesReportYc") - @ApiOperation(value = "门店销售明细报表(烟草)") - public void exportgetStoreSalesReportYc(@RequestBody PagerQuery pq, HttpServletResponse response) throws IOException { - //得到所有要导出的数据 - List excelVos = gdSalesReportService.StoreSalesYcReportExcelVo(pq); - String fileName = "门店销售明细报表(烟草)" + System.currentTimeMillis() + ".xlsx"; - response.setContentType( "application/vnd.ms-excel"); - response.setCharacterEncoding("utf8"); - response.setHeader("Content-disposition","attachment;filename="+ fileName ); - // 这里 需要指定写用哪个class去读,然后写到第一个sheet,名字为模板 然后文件流会自动关闭 - // 如果这里想使用03 则 传入excelType参数即可 - ServletOutputStream outputStream = response.getOutputStream(); - EasyExcel.write(outputStream, StoreSalesReportExcelVo.class).sheet("门店销售明细报表(烟草)").doWrite(excelVos); - outputStream.flush(); - outputStream.close(); + + public void exportStoreSalesReportYc(Map map,ExcelWriter excelWriter,List StoreSalesYcVos) throws IOException { + List list = new ArrayList<>(); + //new CellRangeAddress(开始行,结束行,开始列,结束列) + list.add(new CellRangeAddress(3, StoreSalesYcVos.size(), 1, 3)); + // 创建writeSheet,并注册合并单元格handler + WriteSheet writeSheet = EasyExcel.writerSheet(3).registerWriteHandler(new MyHandler(0,list)).build(); + // 填写配置,forceNewRow true表示自动创建一行,后面的数据后移 + FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); + //填写数据 + excelWriter.fill(StoreSalesYcVos, fillConfig, writeSheet); + // 写入list之前的数据 + Calendar cal = Calendar.getInstance(); + Date date = new Date(); + cal.setTime(date); + SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd"); + map.put("number","ycmdxsmxb"+cal.get(Calendar.YEAR)+cal.get(Calendar.MONTH)+1+cal.get(Calendar.DAY_OF_MONTH)); + excelWriter.fill(map, writeSheet); +// list 后面还有个统计 想办法手动写入 + List> totalListList = ListUtils.newArrayList(); + List totalList = ListUtils.newArrayList(); + totalListList.add(totalList); + BigDecimal total=new BigDecimal("0"); + for(StoreSalesReportExcelVo i:StoreSalesYcVos){ + total=total.add(i.getSalesVolume()); + } + totalList.add(""); + totalList.add(""); + totalList.add(""); + totalList.add("统计:"); + totalList.add(String.valueOf(total)); + // 这里是write 别和fill 搞错了 + WriteSheet writeSheet1 = EasyExcel.writerSheet(3).build(); + excelWriter.write(totalListList,writeSheet1); } @PostMapping("/getGoodsSalesReportYc") public ResultBean getGoodsSalesReportYc(@RequestBody PagerQuery pq){ @@ -191,20 +243,36 @@ public class GdSalesReportRest { List pv = gdSalesReportService.getGoodsSalesReportYc(pq); return rb.success().setData(pv); } - @PostMapping("/exportGoodsSalesReportYc") - @ApiOperation(value = "门店商品销售明细报表(烟草)") - public void exportGoodsSalesReportYc(@RequestBody PagerQuery pq, HttpServletResponse response) throws IOException { - //得到所有要导出的数据 - List excelVos = gdSalesReportService.GoodsSalesReportYcExcelVo(pq); - String fileName = "门店商品销售明细报表(烟草)" + System.currentTimeMillis() + ".xlsx"; - response.setContentType( "application/vnd.ms-excel"); - response.setCharacterEncoding("utf8"); - response.setHeader("Content-disposition","attachment;filename="+ fileName ); - // 这里 需要指定写用哪个class去读,然后写到第一个sheet,名字为模板 然后文件流会自动关闭 - // 如果这里想使用03 则 传入excelType参数即可 - ServletOutputStream outputStream = response.getOutputStream(); - EasyExcel.write(outputStream, StoreSalesReportExcelVo.class).sheet("门店商品销售明细报表(烟草)").doWrite(excelVos); - outputStream.flush(); - outputStream.close(); + + public void exportGoodsSalesReportYc(Map map,ExcelWriter excelWriter,ListgoodsSalesReportExcelVos) throws IOException { + WriteSheet writeSheetGood = EasyExcel.writerSheet(4).build(); + //填写数据 + excelWriter.fill(goodsSalesReportExcelVos, writeSheetGood); + // 写入list之前的数据 + Calendar cal = Calendar.getInstance(); + Date date = new Date(); + cal.setTime(date); + SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd"); + map.put("number","ycmdspxsmxb"+cal.get(Calendar.YEAR)+cal.get(Calendar.MONTH)+1+cal.get(Calendar.DAY_OF_MONTH)); + map.put("storeNum",goodsSalesReportExcelVos.size()); + excelWriter.fill(map, writeSheetGood); +// list 后面还有个统计 想办法手动写入 + List> totalListList1 = ListUtils.newArrayList(); + List totalList1 = ListUtils.newArrayList(); + totalListList1.add(totalList1); + BigDecimal total=new BigDecimal("0"); + for(GoodsSalesReportExcelVo i:goodsSalesReportExcelVos){ + total=total.add(i.getTotal()); + } + totalList1.add(""); + totalList1.add(""); + totalList1.add(""); + totalList1.add(""); + totalList1.add(""); + totalList1.add(""); + totalList1.add("统计:"); + totalList1.add(String.valueOf(total)); + // 这里是write 别和fill 搞错了 + excelWriter.write(totalListList1,writeSheetGood); } } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportMapper.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportMapper.java index 9be53482..7c9d08f7 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportMapper.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportMapper.java @@ -22,6 +22,6 @@ public interface SupplierArrivalReportMapper extends BaseMapper arrivalGoodsYc(IPage page, @Param(Constants.WRAPPER) Wrapper qw); IPage supplierOrder(IPage page, @Param(Constants.WRAPPER) Wrapper qw); IPage arrivalGoods(IPage page, @Param(Constants.WRAPPER) Wrapper qw); - + IPage supplierArrival(IPage page, @Param(Constants.WRAPPER) Wrapper qw); } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportMapper.xml b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportMapper.xml index 92a0b763..b145ffde 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportMapper.xml +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportMapper.xml @@ -31,10 +31,40 @@ + \ No newline at end of file diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportRest.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportRest.java index 68aaa7ee..c8903c14 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportRest.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportRest.java @@ -20,28 +20,63 @@ public class SupplierArrivalReportRest { @Autowired SupplierArrivalReportService supplierArrivalReportService; + /** + * 烟草订单明细 + * @param pq + * @return + */ @PostMapping("/listPage") public ResultBean>listPage(@RequestBody PagerQuery pq){ ResultBean rb = ResultBean.fireFail(); PagerVo pv = supplierArrivalReportService.listPage(pq); return rb.success().setData(pv); } + + /** + * 烟草商品到货明细 + * @param pq + * @return + */ @PostMapping("/arrivalGoodsYc") public ResultBean>arrivalGoodsYc(@RequestBody PagerQuery pq){ ResultBean rb = ResultBean.fireFail(); PagerVo pv = supplierArrivalReportService.arrivalGoodsYc(pq); return rb.success().setData(pv); } + + /** + * 订单明细表 + * @param pq + * @return + */ @PostMapping("/supplierOrder") public ResultBean>supplierOrder(@RequestBody PagerQuery pq){ ResultBean rb = ResultBean.fireFail(); PagerVo pv = supplierArrivalReportService.supplierOrder(pq); return rb.success().setData(pv); } + + /** + * 商品到货明细表 + * @param pq + * @return + */ @PostMapping("/arrivalGoods") public ResultBean>arrivalGoods(@RequestBody PagerQuery pq){ ResultBean rb = ResultBean.fireFail(); - PagerVo pv = supplierArrivalReportService.supplierOrder(pq); + PagerVo pv = supplierArrivalReportService.arrivalGoods(pq); + return rb.success().setData(pv); + } + + /** + * 供应商到货汇总 + * @param pq + * @return + */ + @PostMapping("/supplierArrivalSummary") + public ResultBean>supplierArrivalSummary(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = supplierArrivalReportService.supplierArrival(pq); return rb.success().setData(pv); } } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportService.java index 783823d2..6b88afa1 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportService.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/supplierarrivalreport/SupplierArrivalReportService.java @@ -11,6 +11,8 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.math.BigInteger; import java.util.List; /** @@ -70,9 +72,30 @@ public class SupplierArrivalReportService extends MybatisBaseService page = PagerUtil.queryToPage(pq); - IPage pagging = baseMapper.supplierOrder(page,qw); + IPage pagging = baseMapper.arrivalGoods(page,qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + public PagerVo supplierArrival(PagerQuery pq) { + SupplierArrivalReportQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); +// if(query!=null) { +// if (StringUtils.isNotBlank(query.getDate())) { +// qw.eq("STR_TO_DATE(re.createTime,'%Y-%m-%d')", query.getDate()); +// } +// } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.supplierArrival(page,qw); + for(SupplierArrivalReportVo vo:pagging.getRecords()){ + if(vo.getLogo().equals("否")){ + vo.setExceed(vo.getActualArrival().subtract(vo.getOrderAmount())); + vo.setTransit(new BigDecimal(0)); + }else if(vo.getLogo().equals("是") ){ + vo.setTransit(vo.getOrderAmount().subtract(vo.getActualArrival())); + vo.setExceed(new BigDecimal(0)); + } + } PagerVo p = PagerUtil.pageToVo(pagging, null); return p; } - }