54 changed files with 2267 additions and 6 deletions
@ -0,0 +1,27 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
|
||||
|
|
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
<artifactId>supervise-report</artifactId> |
||||
|
<modules> |
||||
|
<module>supervise-report-api</module> |
||||
|
<module>supervise-report-biz</module> |
||||
|
</modules> |
||||
|
<groupId>com.yxt.supervise</groupId> |
||||
|
<version>0.0.1</version> |
||||
|
|
||||
|
<packaging>pom</packaging> |
||||
|
<description>报表管理</description> |
||||
|
|
||||
|
<!-- <parent>--> |
||||
|
<!-- <groupId>com.yxt.supervise</groupId>--> |
||||
|
<!-- <artifactId>yxt_supervise</artifactId>--> |
||||
|
<!-- <version>0.0.1</version>--> |
||||
|
<!-- <relativePath/>--> |
||||
|
<!-- </parent>--> |
||||
|
|
||||
|
|
||||
|
</project> |
@ -0,0 +1,60 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
|
||||
|
<!-- <parent>--> |
||||
|
<!-- <groupId>com.yxt.supervise</groupId>--> |
||||
|
<!-- <artifactId>supervise-report</artifactId>--> |
||||
|
<!-- <version>0.0.1</version>--> |
||||
|
<!-- </parent>--> |
||||
|
<parent> |
||||
|
<groupId>com.yxt</groupId> |
||||
|
<artifactId>yxt-parent</artifactId> |
||||
|
<version>0.0.1</version> |
||||
|
<relativePath/> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>supervise-report-api</artifactId> |
||||
|
<groupId>com.yxt.supervise</groupId> |
||||
|
<version>0.0.1-SNAPSHOT</version> |
||||
|
|
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>com.yxt</groupId> |
||||
|
<artifactId>yxt-common-core</artifactId> |
||||
|
<version>0.0.1</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.cloud</groupId> |
||||
|
<artifactId>spring-cloud-starter-openfeign</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.projectlombok</groupId> |
||||
|
<artifactId>lombok</artifactId> |
||||
|
<version>1.18.24</version> |
||||
|
<optional>true</optional> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba</groupId> |
||||
|
<artifactId>easyexcel-core</artifactId> |
||||
|
<version>3.2.1</version> |
||||
|
<scope>compile</scope> |
||||
|
</dependency> |
||||
|
|
||||
|
</dependencies> |
||||
|
|
||||
|
<distributionManagement> |
||||
|
<repository> |
||||
|
<id>nexus-releases</id> |
||||
|
<url>http://172.18.0.3:8081/repository/yxt-mvn-releases/</url> |
||||
|
</repository> |
||||
|
<snapshotRepository> |
||||
|
<id>nexus-snapshots</id> |
||||
|
<url>http://172.18.0.3:8081/repository/yxt-mvn-snapshot/</url> |
||||
|
</snapshotRepository> |
||||
|
</distributionManagement> |
||||
|
|
||||
|
|
||||
|
</project> |
@ -0,0 +1,157 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaygather; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 10:13 |
||||
|
*/ |
||||
|
@ApiModel(value = "销售日报表-汇总", description = "销售日报表-汇总") |
||||
|
@TableName("report_sales_day_gather") |
||||
|
@Data |
||||
|
public class ReportSalesDayGather extends BaseEntity { |
||||
|
//@ApiModelProperty("记录创建时间")
|
||||
|
//private String createTime;
|
||||
|
@ApiModelProperty("备注说明") |
||||
|
private String remarks; |
||||
|
@ApiModelProperty("单据日期") |
||||
|
private String orderDate; |
||||
|
@ApiModelProperty("编号") |
||||
|
private String serialNumber; |
||||
|
@ApiModelProperty("上报时间") |
||||
|
private String reportTime; |
||||
|
@ApiModelProperty("科目/日,大前天") |
||||
|
private String kmDateA; |
||||
|
@ApiModelProperty("科目/日,前天") |
||||
|
private String kmDateB; |
||||
|
@ApiModelProperty("科目/日,昨天") |
||||
|
private String kmDateC; |
||||
|
@ApiModelProperty("现金流量-经营活动产生的现金流量(元),大前天") |
||||
|
private String xjllA; |
||||
|
@ApiModelProperty("现金流量-经营活动产生的现金流量(元),前天") |
||||
|
private String xjllB; |
||||
|
@ApiModelProperty("现金流量-经营活动产生的现金流量(元),昨天") |
||||
|
private String xjllC; |
||||
|
@ApiModelProperty("销售商品收到的现金(元),大前天") |
||||
|
private String xsxjA; |
||||
|
@ApiModelProperty("销售商品收到的现金(元),前天") |
||||
|
private String xsxjB; |
||||
|
@ApiModelProperty("销售商品收到的现金(元),昨天") |
||||
|
private String xsxjC; |
||||
|
@ApiModelProperty("收到其他与经营活动有关的现金(元),大前天") |
||||
|
private String qtxjA; |
||||
|
@ApiModelProperty("收到其他与经营活动有关的现金(元),前天") |
||||
|
private String qtxjB; |
||||
|
@ApiModelProperty("收到其他与经营活动有关的现金(元),昨天") |
||||
|
private String qtxjC; |
||||
|
@ApiModelProperty("财务分析本项合计,大前天") |
||||
|
private String cwfxhjA; |
||||
|
@ApiModelProperty("财务分析本项合计,前天") |
||||
|
private String cwfxhjB; |
||||
|
@ApiModelProperty("财务分析本项合计,昨天") |
||||
|
private String cwfxhjC; |
||||
|
@ApiModelProperty("资产负债-流动资产(元),大前天") |
||||
|
private String zcfzA; |
||||
|
@ApiModelProperty("资产负债-流动资产(元),前天") |
||||
|
private String zcfzB; |
||||
|
@ApiModelProperty("资产负债-流动资产(元),昨天") |
||||
|
private String zcfzC; |
||||
|
@ApiModelProperty("应收账款(元),大前天") |
||||
|
private String yszkA; |
||||
|
@ApiModelProperty("应收账款(元),前天") |
||||
|
private String yszkB; |
||||
|
@ApiModelProperty("应收账款(元),昨天") |
||||
|
private String yszkC; |
||||
|
@ApiModelProperty("流动负债(元),大前天") |
||||
|
private String ldfzA; |
||||
|
@ApiModelProperty("流动负债(元),前天") |
||||
|
private String ldfzB; |
||||
|
@ApiModelProperty("流动负债(元),昨天") |
||||
|
private String ldfzC; |
||||
|
@ApiModelProperty("预收款项(元),大前天") |
||||
|
private String yskxA; |
||||
|
@ApiModelProperty("预收款项(元),前天") |
||||
|
private String yskxB; |
||||
|
@ApiModelProperty("预收款项(元),昨天") |
||||
|
private String yskxC; |
||||
|
@ApiModelProperty("期初总货值") |
||||
|
private String cqzhz; |
||||
|
@ApiModelProperty("烟草期初货值") |
||||
|
private String ycqchz; |
||||
|
@ApiModelProperty("项目/日,前天") |
||||
|
private String xmDateA; |
||||
|
@ApiModelProperty("项目/日,昨天") |
||||
|
private String xmDateB; |
||||
|
@ApiModelProperty("项目/日,今天") |
||||
|
private String xmDateC; |
||||
|
@ApiModelProperty("在途货值(元),前天") |
||||
|
private String zthzA; |
||||
|
@ApiModelProperty("在途货值(元),昨天") |
||||
|
private String zthzB; |
||||
|
@ApiModelProperty("在途货值(元),今天") |
||||
|
private String zthzC; |
||||
|
@ApiModelProperty("库存货值(元),前天") |
||||
|
private String kchzA; |
||||
|
@ApiModelProperty("库存货值(元),昨天") |
||||
|
private String kchzB; |
||||
|
@ApiModelProperty("库存货值(元),今天") |
||||
|
private String kchzC; |
||||
|
@ApiModelProperty("帐户余额(元)账户余额为前一天余额,前天") |
||||
|
private String zhyeA; |
||||
|
@ApiModelProperty("帐户余额(元)账户余额为前一天余额,昨天") |
||||
|
private String zhyeB; |
||||
|
@ApiModelProperty("帐户余额(元)账户余额为前一天余额,今天") |
||||
|
private String zhyeC; |
||||
|
@ApiModelProperty("预警应收帐款(元),前天") |
||||
|
private String yjyszkA; |
||||
|
@ApiModelProperty("预警应收帐款(元),昨天") |
||||
|
private String yjyszkB; |
||||
|
@ApiModelProperty("预警应收帐款(元),今天") |
||||
|
private String yjyszkC; |
||||
|
@ApiModelProperty("主要预警指标本项合计,前天") |
||||
|
private String yjhjA; |
||||
|
@ApiModelProperty("主要预警指标本项合计,昨天") |
||||
|
private String yjhjB; |
||||
|
@ApiModelProperty("主要预警指标本项合计,今天") |
||||
|
private String yjhjC; |
||||
|
@ApiModelProperty("连网连锁店,总额(元)") |
||||
|
private String lwlsdze; |
||||
|
@ApiModelProperty("连网连锁店,应收帐款(元)") |
||||
|
private String lwlsdyszk; |
||||
|
@ApiModelProperty("连网连锁店,扣除应收金额(元)") |
||||
|
private String lwlsdkcje; |
||||
|
@ApiModelProperty("连锁内加盟,总额(元)") |
||||
|
private String lsnjmze; |
||||
|
@ApiModelProperty("连锁内加盟,应收帐款(元)") |
||||
|
private String lsnjmyszk; |
||||
|
@ApiModelProperty("连锁内加盟,扣除应收金额(元)") |
||||
|
private String lsnjmkcje; |
||||
|
@ApiModelProperty("配送中心,总额(元)") |
||||
|
private String pszxze; |
||||
|
@ApiModelProperty("配送中心,应收帐款(元)") |
||||
|
private String pszxyszk; |
||||
|
@ApiModelProperty("配送中心,扣除应收金额(元)") |
||||
|
private String pszxkcje; |
||||
|
@ApiModelProperty("连锁外加盟(销配结算),总额(元)") |
||||
|
private String lswjmze; |
||||
|
@ApiModelProperty("连锁外加盟(销配结算),应收帐款(元)") |
||||
|
private String lswjmyszk; |
||||
|
@ApiModelProperty("连锁外加盟(销配结算),扣除应收金额(元)") |
||||
|
private String lswjmkcje; |
||||
|
@ApiModelProperty("36524集团报烟门店仓,总额(元)") |
||||
|
private String ycmdze; |
||||
|
@ApiModelProperty("36524集团报烟门店仓,应收帐款(元)") |
||||
|
private String ycmdyszk; |
||||
|
@ApiModelProperty("36524集团报烟门店仓,扣除应收金额(元)") |
||||
|
private String ycmdkcje; |
||||
|
@ApiModelProperty("烟草连锁外加盟(销配结算),总额(元)") |
||||
|
private String ycjmdze; |
||||
|
@ApiModelProperty("烟草连锁外加盟(销配结算),应收帐款(元)") |
||||
|
private String ycjmdyszk; |
||||
|
@ApiModelProperty("烟草连锁外加盟(销配结算),扣除应收金额(元)") |
||||
|
private String ycjmdkcje; |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaygather; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:15 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayGatherQuery implements Query { |
||||
|
private String date; |
||||
|
} |
@ -0,0 +1,154 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaygather; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:15 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayGatherVo implements Vo { |
||||
|
@ApiModelProperty("记录创建时间") |
||||
|
private String createTime; |
||||
|
@ApiModelProperty("备注说明") |
||||
|
private String remarks; |
||||
|
@ApiModelProperty("单据日期") |
||||
|
private String orderDate; |
||||
|
@ApiModelProperty("编号") |
||||
|
private String serialNumber; |
||||
|
@ApiModelProperty("上报时间") |
||||
|
private String reportTime; |
||||
|
@ApiModelProperty("科目/日,大前天") |
||||
|
private String kmDateA; |
||||
|
@ApiModelProperty("科目/日,前天") |
||||
|
private String kmDateB; |
||||
|
@ApiModelProperty("科目/日,昨天") |
||||
|
private String kmDateC; |
||||
|
@ApiModelProperty("现金流量-经营活动产生的现金流量(元),大前天") |
||||
|
private String xjliA; |
||||
|
@ApiModelProperty("现金流量-经营活动产生的现金流量(元),前天") |
||||
|
private String xjliB; |
||||
|
@ApiModelProperty("现金流量-经营活动产生的现金流量(元),昨天") |
||||
|
private String xjliC; |
||||
|
@ApiModelProperty("销售商品收到的现金(元),大前天") |
||||
|
private String xsxjA; |
||||
|
@ApiModelProperty("销售商品收到的现金(元),前天") |
||||
|
private String xsxjB; |
||||
|
@ApiModelProperty("销售商品收到的现金(元),昨天") |
||||
|
private String xsxjC; |
||||
|
@ApiModelProperty("收到其他与经营活动有关的现金(元),大前天") |
||||
|
private String qtxjA; |
||||
|
@ApiModelProperty("收到其他与经营活动有关的现金(元),前天") |
||||
|
private String qtxjB; |
||||
|
@ApiModelProperty("收到其他与经营活动有关的现金(元),昨天") |
||||
|
private String qtxjC; |
||||
|
@ApiModelProperty("财务分析本项合计,大前天") |
||||
|
private String cwfxhjA; |
||||
|
@ApiModelProperty("财务分析本项合计,前天") |
||||
|
private String cwfxhjB; |
||||
|
@ApiModelProperty("财务分析本项合计,昨天") |
||||
|
private String cwfxhjC; |
||||
|
@ApiModelProperty("资产负债-流动资产(元),大前天") |
||||
|
private String zcfzA; |
||||
|
@ApiModelProperty("资产负债-流动资产(元),前天") |
||||
|
private String zcfzB; |
||||
|
@ApiModelProperty("资产负债-流动资产(元),昨天") |
||||
|
private String zcfzC; |
||||
|
@ApiModelProperty("应收账款(元),大前天") |
||||
|
private String yszkA; |
||||
|
@ApiModelProperty("应收账款(元),前天") |
||||
|
private String yszkB; |
||||
|
@ApiModelProperty("应收账款(元),昨天") |
||||
|
private String yszkC; |
||||
|
@ApiModelProperty("流动负债(元),大前天") |
||||
|
private String ldfzA; |
||||
|
@ApiModelProperty("流动负债(元),前天") |
||||
|
private String ldfzB; |
||||
|
@ApiModelProperty("流动负债(元),昨天") |
||||
|
private String ldfzC; |
||||
|
@ApiModelProperty("预收款项(元),大前天") |
||||
|
private String yskxA; |
||||
|
@ApiModelProperty("预收款项(元),前天") |
||||
|
private String yskxB; |
||||
|
@ApiModelProperty("预收款项(元),昨天") |
||||
|
private String yskxC; |
||||
|
@ApiModelProperty("期初总货值") |
||||
|
private String cqzhz; |
||||
|
@ApiModelProperty("烟草期初货值") |
||||
|
private String ycqchz; |
||||
|
@ApiModelProperty("项目/日,前天") |
||||
|
private String xmDateA; |
||||
|
@ApiModelProperty("项目/日,昨天") |
||||
|
private String xmDateB; |
||||
|
@ApiModelProperty("项目/日,今天") |
||||
|
private String xmDateC; |
||||
|
@ApiModelProperty("在途货值(元),前天") |
||||
|
private String zthzA; |
||||
|
@ApiModelProperty("在途货值(元),昨天") |
||||
|
private String zthzB; |
||||
|
@ApiModelProperty("在途货值(元),今天") |
||||
|
private String zthzC; |
||||
|
@ApiModelProperty("库存货值(元),前天") |
||||
|
private String kchzA; |
||||
|
@ApiModelProperty("库存货值(元),昨天") |
||||
|
private String kchzB; |
||||
|
@ApiModelProperty("库存货值(元),今天") |
||||
|
private String kchzC; |
||||
|
@ApiModelProperty("帐户余额(元)账户余额为前一天余额,前天") |
||||
|
private String zhyeA; |
||||
|
@ApiModelProperty("帐户余额(元)账户余额为前一天余额,昨天") |
||||
|
private String zhyeB; |
||||
|
@ApiModelProperty("帐户余额(元)账户余额为前一天余额,今天") |
||||
|
private String zhyeC; |
||||
|
@ApiModelProperty("预警应收帐款(元),前天") |
||||
|
private String yjyszkA; |
||||
|
@ApiModelProperty("预警应收帐款(元),昨天") |
||||
|
private String yjyszkB; |
||||
|
@ApiModelProperty("预警应收帐款(元),今天") |
||||
|
private String yjyszkC; |
||||
|
@ApiModelProperty("主要预警指标本项合计,前天") |
||||
|
private String yjhjA; |
||||
|
@ApiModelProperty("主要预警指标本项合计,昨天") |
||||
|
private String yjhjB; |
||||
|
@ApiModelProperty("主要预警指标本项合计,今天") |
||||
|
private String yjhjC; |
||||
|
@ApiModelProperty("连网连锁店,总额(元)") |
||||
|
private String lwlsdze; |
||||
|
@ApiModelProperty("连网连锁店,应收帐款(元)") |
||||
|
private String lwlsdyszk; |
||||
|
@ApiModelProperty("连网连锁店,扣除应收金额(元)") |
||||
|
private String lwlsdkcje; |
||||
|
@ApiModelProperty("连锁内加盟,总额(元)") |
||||
|
private String lsnjmze; |
||||
|
@ApiModelProperty("连锁内加盟,应收帐款(元)") |
||||
|
private String lsnjmyszk; |
||||
|
@ApiModelProperty("连锁内加盟,扣除应收金额(元)") |
||||
|
private String lsnjmkcje; |
||||
|
@ApiModelProperty("配送中心,总额(元)") |
||||
|
private String pszxze; |
||||
|
@ApiModelProperty("配送中心,应收帐款(元)") |
||||
|
private String pszxyszk; |
||||
|
@ApiModelProperty("配送中心,扣除应收金额(元)") |
||||
|
private String pszxkcje; |
||||
|
@ApiModelProperty("连锁外加盟(销配结算),总额(元)") |
||||
|
private String lswjmze; |
||||
|
@ApiModelProperty("连锁外加盟(销配结算),应收帐款(元)") |
||||
|
private String lswjmyszk; |
||||
|
@ApiModelProperty("连锁外加盟(销配结算),扣除应收金额(元)") |
||||
|
private String lswjmkcje; |
||||
|
@ApiModelProperty("36524集团报烟门店仓,总额(元)") |
||||
|
private String ycmdze; |
||||
|
@ApiModelProperty("36524集团报烟门店仓,应收帐款(元)") |
||||
|
private String ycmdyszk; |
||||
|
@ApiModelProperty("36524集团报烟门店仓,扣除应收金额(元)") |
||||
|
private String ycmdkcje; |
||||
|
@ApiModelProperty("烟草连锁外加盟(销配结算),总额(元)") |
||||
|
private String ycjmdze; |
||||
|
@ApiModelProperty("烟草连锁外加盟(销配结算),应收帐款(元)") |
||||
|
private String ycjmdyszk; |
||||
|
@ApiModelProperty("烟草连锁外加盟(销配结算),扣除应收金额(元)") |
||||
|
private String ycjmdkcje; |
||||
|
|
||||
|
} |
@ -0,0 +1,87 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaylog; |
||||
|
|
||||
|
|
||||
|
import com.alibaba.excel.metadata.Head; |
||||
|
import com.alibaba.excel.write.merge.AbstractMergeStrategy; |
||||
|
import org.apache.poi.ss.usermodel.*; |
||||
|
import org.apache.poi.ss.util.CellRangeAddress; |
||||
|
import org.apache.poi.ss.util.RegionUtil; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 合并单元格处理类 |
||||
|
*/ |
||||
|
public class MyHandler extends AbstractMergeStrategy { |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 合并开始行 |
||||
|
*/ |
||||
|
private Integer startRow = 0; |
||||
|
/** |
||||
|
* list表格所有的合并列集合 |
||||
|
*/ |
||||
|
private List<CellRangeAddress> cellRangeAddressList = null; |
||||
|
|
||||
|
public MyHandler() { |
||||
|
} |
||||
|
|
||||
|
public MyHandler(int startRow, List<CellRangeAddress> cellRangeAddressList) { |
||||
|
this.startRow = startRow; |
||||
|
this.cellRangeAddressList = cellRangeAddressList; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) { |
||||
|
// 设置样式
|
||||
|
CellStyle cellStyle = cell.getCellStyle(); |
||||
|
//水平居中
|
||||
|
cellStyle.setAlignment(HorizontalAlignment.CENTER); |
||||
|
//自动换行
|
||||
|
cellStyle.setWrapText(true); |
||||
|
//在这里判断从哪一行开始调用合并的方法
|
||||
|
if (cell.getRowIndex() > this.startRow) { |
||||
|
if (relativeRowIndex == null || relativeRowIndex == 0) { |
||||
|
return; |
||||
|
} |
||||
|
mergeColumn(sheet, cell, head, relativeRowIndex); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 合并单元格 |
||||
|
* |
||||
|
* @param sheet |
||||
|
* @param cell |
||||
|
* @param head |
||||
|
* @param relativeRowIndex |
||||
|
*/ |
||||
|
protected void mergeColumn(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) { |
||||
|
int rowIndex = cell.getRowIndex(); |
||||
|
int colIndex = cell.getColumnIndex(); |
||||
|
sheet = cell.getSheet(); |
||||
|
// 获取前一行
|
||||
|
Row preRow = sheet.getRow(rowIndex - 1); |
||||
|
//获取前一列
|
||||
|
Cell preCell = preRow.getCell(colIndex); |
||||
|
List<CellRangeAddress> list = this.cellRangeAddressList; |
||||
|
for (int i = 0; i < list.size(); i++) { |
||||
|
CellRangeAddress cellRangeAddress = list.get(i); |
||||
|
if (cellRangeAddress.containsColumn(preCell.getColumnIndex())) { |
||||
|
int lastColIndex = cellRangeAddress.getLastColumn(); |
||||
|
int firstColIndex = cellRangeAddress.getFirstColumn(); |
||||
|
CellRangeAddress cra = new CellRangeAddress(cell.getRowIndex(), cell.getRowIndex(), firstColIndex, lastColIndex); |
||||
|
sheet.addMergedRegion(cra); |
||||
|
// 加边框
|
||||
|
RegionUtil.setBorderBottom(BorderStyle.THIN, cra, sheet); |
||||
|
RegionUtil.setBorderLeft(BorderStyle.THIN, cra, sheet); |
||||
|
RegionUtil.setBorderRight(BorderStyle.THIN, cra, sheet); |
||||
|
RegionUtil.setBorderTop(BorderStyle.THIN, cra, sheet); |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaylog; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 15:27 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayLog { |
||||
|
private String orderDate; |
||||
|
private String url; |
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaylog; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 15:28 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayLogQuery implements Query { |
||||
|
private String date; |
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaylog; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 15:27 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayLogVo implements Vo { |
||||
|
private String orderDate; |
||||
|
private String url; |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaystore; |
||||
|
|
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 13:47 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayStore extends BaseEntity { |
||||
|
//private String id; //'ID,唯一编号',
|
||||
|
//private String createTime; // '记录创建时间',
|
||||
|
//private String remarks;//'备注说明',
|
||||
|
private String orderDate; //'单据日期',
|
||||
|
private String serialNumber; // '编号',
|
||||
|
private String storeNumber;// '渠道数量',
|
||||
|
private String reportTime;//'上报时间',
|
||||
|
private String sort; // '序号',
|
||||
|
private String storeCodeName; //'[门店编号]门店名称',
|
||||
|
private String saleAmount ;//'销售金额',
|
||||
|
private String countAmount; //'总计销售金额',
|
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaystore; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 13:47 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayStoreQuery implements Query { |
||||
|
private String date; |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaystore; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 13:47 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayStoreVo implements Vo { |
||||
|
private String id; //'ID,唯一编号',
|
||||
|
private String createTime; // '记录创建时间',
|
||||
|
private String remarks;//'备注说明',
|
||||
|
private String orderDate; //'单据日期',
|
||||
|
private String serialNumber; // '编号',
|
||||
|
private String storeNumber;// '渠道数量',
|
||||
|
private String reportTime;//'上报时间',
|
||||
|
private String sort; // '序号',
|
||||
|
private String storeCodeName; //'[门店编号]门店名称',
|
||||
|
private String saleAmount ;//'销售金额',
|
||||
|
private String countAmount; //'总计销售金额',
|
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaystoreproduct; |
||||
|
|
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 13:57 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayStoreProduct extends BaseEntity { |
||||
|
//private String id;//'ID,唯一编号',
|
||||
|
//private String createTime; // '记录创建时间',
|
||||
|
//private String remarks;// '备注说明',
|
||||
|
private String orderDate;// '单据日期',
|
||||
|
private String serialNumber; // '编号',
|
||||
|
private String productNumber; // '商品数量',
|
||||
|
private String reportTime; // '上报时间',
|
||||
|
private String storeCodeName;// '[门店编号]门店名称',
|
||||
|
private String saleType; // '销售类型:零售、批发',
|
||||
|
private String saleCode; // '销售订单号',
|
||||
|
private String productCode; //'商品编码',
|
||||
|
private String productName; // '商品名称',
|
||||
|
private String saleNumber; //'数量',
|
||||
|
private String salePrice; // '单价',
|
||||
|
private String saleAmount; // '小计',
|
||||
|
private String countAmount; // '总计销售金额',
|
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaystoreproduct; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 13:57 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayStoreProductQuery implements Query { |
||||
|
private String date; |
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaystoreproduct; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 13:57 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayStoreProductVo implements Vo { |
||||
|
private String id;//'ID,唯一编号',
|
||||
|
//private String createTime; // '记录创建时间',
|
||||
|
//private String remarks;// '备注说明',
|
||||
|
private String orderDate;// '单据日期',
|
||||
|
private String serialNumber; // '编号',
|
||||
|
private String productNumber; // '商品数量',
|
||||
|
private String reportTime; // '上报时间',
|
||||
|
private String storeCodeName;// '[门店编号]门店名称',
|
||||
|
private String saleType; // '销售类型:零售、批发',
|
||||
|
private String saleCode; // '销售订单号',
|
||||
|
private String productCode; //'商品编码',
|
||||
|
private String productName; // '商品名称',
|
||||
|
private String saleNumber; //'数量',
|
||||
|
private String salePrice; // '单价',
|
||||
|
private String saleAmount; // '小计',
|
||||
|
private String countAmount; // '总计销售金额',
|
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaytobaccostore; |
||||
|
|
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 14:11 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayTobaccoStore extends BaseEntity { |
||||
|
//private String id ;// 'ID,唯一编号',
|
||||
|
//private String createTime ;// '记录创建时间',
|
||||
|
//private String remarks ;// '备注说明',
|
||||
|
private String orderDate ;// '单据日期',
|
||||
|
private String serialNumber ;// '编号',
|
||||
|
private String storeNumber;// '渠道数量',
|
||||
|
private String reportTime ;// '上报时间',
|
||||
|
private String sort; // '序号',
|
||||
|
private String storeCodeName ;// '[门店编号]门店名称',
|
||||
|
private String saleAmount ;// '销售金额',
|
||||
|
private String countAmount ;// '总计销售金额',
|
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaytobaccostore; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 14:12 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayTobaccoStoreQuery implements Query { |
||||
|
private String date; |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaytobaccostore; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 14:12 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayTobaccoStoreVo implements Vo { |
||||
|
private String id ;// 'ID,唯一编号',
|
||||
|
//private String createTime ;// '记录创建时间',
|
||||
|
//private String remarks ;// '备注说明',
|
||||
|
private String orderDate ;// '单据日期',
|
||||
|
private String serialNumber ;// '编号',
|
||||
|
private String storeNumber;// '渠道数量',
|
||||
|
private String reportTime ;// '上报时间',
|
||||
|
private String sort; // '序号',
|
||||
|
private String storeCodeName ;// '[门店编号]门店名称',
|
||||
|
private String saleAmount ;// '销售金额',
|
||||
|
private String countAmount ;// '总计销售金额',
|
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct; |
||||
|
|
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 14:20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayTobaccoStoreProduct extends BaseEntity { |
||||
|
//private String id;//'ID,唯一编号',
|
||||
|
//private String createTime; // '记录创建时间',
|
||||
|
//private String remarks;// '备注说明',
|
||||
|
private String orderDate;// '单据日期',
|
||||
|
private String serialNumber; // '编号',
|
||||
|
private String productNumber; // '商品数量',
|
||||
|
private String reportTime; // '上报时间',
|
||||
|
private String storeCodeName;// '[门店编号]门店名称',
|
||||
|
private String saleType; // '销售类型:零售、批发',
|
||||
|
private String saleCode; // '销售订单号',
|
||||
|
private String productCode; //'商品编码',
|
||||
|
private String productName; // '商品名称',
|
||||
|
private String saleNumber; //'数量',
|
||||
|
private String salePrice; // '单价',
|
||||
|
private String saleAmount; // '小计',
|
||||
|
private String countAmount; // '总计销售金额',
|
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 14:21 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayTobaccoStoreProductQuery implements Query { |
||||
|
private String date; |
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 14:21 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReportSalesDayTobaccoStoreProductVo implements Vo { |
||||
|
private String id;//'ID,唯一编号',
|
||||
|
//private String createTime; // '记录创建时间',
|
||||
|
//private String remarks;// '备注说明',
|
||||
|
private String orderDate;// '单据日期',
|
||||
|
private String serialNumber; // '编号',
|
||||
|
private String productNumber; // '商品数量',
|
||||
|
private String reportTime; // '上报时间',
|
||||
|
private String storeCodeName;// '[门店编号]门店名称',
|
||||
|
private String saleType; // '销售类型:零售、批发',
|
||||
|
private String saleCode; // '销售订单号',
|
||||
|
private String productCode; //'商品编码',
|
||||
|
private String productName; // '商品名称',
|
||||
|
private String saleNumber; //'数量',
|
||||
|
private String salePrice; // '单价',
|
||||
|
private String saleAmount; // '小计',
|
||||
|
private String countAmount; // '总计销售金额',
|
||||
|
} |
@ -0,0 +1,110 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
|
||||
|
<!-- <parent>--> |
||||
|
<!-- <groupId>com.yxt.supervise</groupId>--> |
||||
|
<!-- <artifactId>supervise-report</artifactId>--> |
||||
|
<!-- <version>0.0.1</version>--> |
||||
|
<!-- </parent> --> |
||||
|
<parent> |
||||
|
<groupId>com.yxt</groupId> |
||||
|
<artifactId>yxt-parent</artifactId> |
||||
|
<version>0.0.1</version> |
||||
|
<relativePath/> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>supervise-report-biz</artifactId> |
||||
|
<groupId>com.yxt.supervise</groupId> |
||||
|
<version>0.0.1</version> |
||||
|
|
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>com.yxt.supervise</groupId> |
||||
|
<artifactId>supervise-system-api</artifactId> |
||||
|
<version>0.0.1-SNAPSHOT</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.yxt</groupId> |
||||
|
<artifactId>yxt-common-base</artifactId> |
||||
|
<version>0.0.1</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<artifactId>supervise-report-api</artifactId> |
||||
|
<groupId>com.yxt.supervise</groupId> |
||||
|
<version>0.0.1-SNAPSHOT</version> |
||||
|
</dependency> |
||||
|
<!--mysql--> |
||||
|
<dependency> |
||||
|
<groupId>mysql</groupId> |
||||
|
<artifactId>mysql-connector-java</artifactId> |
||||
|
<scope>runtime</scope> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.cloud</groupId> |
||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>com.baomidou</groupId> |
||||
|
<artifactId>mybatis-plus-boot-starter</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.baomidou</groupId> |
||||
|
<artifactId>mybatis-plus-annotation</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>junit</groupId> |
||||
|
<artifactId>junit</artifactId> |
||||
|
<scope>compile</scope> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>javax.servlet</groupId> |
||||
|
<artifactId>javax.servlet-api</artifactId> |
||||
|
<version>4.0.1</version> |
||||
|
<scope>compile</scope> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba</groupId> |
||||
|
<artifactId>easyexcel-core</artifactId> |
||||
|
<version>3.2.1</version> |
||||
|
<scope>compile</scope> |
||||
|
</dependency> |
||||
|
|
||||
|
</dependencies> |
||||
|
|
||||
|
<build> |
||||
|
<plugins> |
||||
|
<plugin> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
|
<version>2.5.6</version> |
||||
|
<executions> |
||||
|
<execution> |
||||
|
<goals> |
||||
|
<goal>repackage</goal> |
||||
|
</goals> |
||||
|
</execution> |
||||
|
</executions> |
||||
|
</plugin> |
||||
|
</plugins> |
||||
|
<resources> |
||||
|
<resource> |
||||
|
<directory>src/main/java</directory> |
||||
|
<includes> |
||||
|
<include>**/*Mapper.xml</include> |
||||
|
</includes> |
||||
|
</resource> |
||||
|
<resource> |
||||
|
<directory>src/main/resources</directory> |
||||
|
<includes> |
||||
|
<include>**/*.*</include> |
||||
|
</includes> |
||||
|
<filtering>false</filtering> |
||||
|
</resource> |
||||
|
</resources> |
||||
|
</build> |
||||
|
|
||||
|
</project> |
@ -0,0 +1,23 @@ |
|||||
|
package com.yxt.supervise.report; |
||||
|
|
||||
|
|
||||
|
import org.springframework.boot.SpringApplication; |
||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
||||
|
import org.springframework.cloud.openfeign.EnableFeignClients; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
*/ |
||||
|
@SpringBootApplication(scanBasePackages = { |
||||
|
"com.yxt.common.base.config", |
||||
|
"com.yxt.supervise.report" |
||||
|
}) |
||||
|
@EnableDiscoveryClient |
||||
|
@EnableFeignClients(basePackages = {"com.yxt.supervise.system"}) |
||||
|
public class ReportApplication { |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
SpringApplication.run(ReportApplication.class, args); |
||||
|
} |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaygather; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaygather.ReportSalesDayGather; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaygather.ReportSalesDayGatherVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface ReportSalesDayGatherMapper extends BaseMapper<ReportSalesDayGather> { |
||||
|
List<ReportSalesDayGatherVo> getReportSalesDayGather(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayGather> qw); |
||||
|
List<ReportSalesDayGatherVo> getAllReportSalesDayGather(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayGather> qw); |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.yxt.supervise.report.biz.reportsalesdaygather.ReportSalesDayGatherMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="getReportSalesDayGather" resultType="com.yxt.supervise.report.api.reportsalesdaygather.ReportSalesDayGatherVo"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
report_sales_day_gather |
||||
|
<where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
<select id="getAllReportSalesDayGather" resultType="com.yxt.supervise.report.api.reportsalesdaygather.ReportSalesDayGatherVo"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
report_sales_day_gather |
||||
|
<where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,44 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaygather; |
||||
|
|
||||
|
import com.alibaba.excel.EasyExcel; |
||||
|
import com.alibaba.excel.ExcelWriter; |
||||
|
import com.alibaba.excel.write.builder.ExcelWriterBuilder; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaygather.ReportSalesDayGatherQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaygather.ReportSalesDayGatherVo; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/reportsalesdaygather") |
||||
|
public class ReportSalesDayGatherRest { |
||||
|
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 |
||||
|
ReportSalesDayGatherService reportSalesDayGatherService; |
||||
|
|
||||
|
@PostMapping("/getReportSalesDayGather") |
||||
|
public ResultBean<ReportSalesDayGatherVo> getReportSalesDayGather(@RequestBody PagerQuery<ReportSalesDayGatherQuery> pq){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
List<ReportSalesDayGatherVo> pv = reportSalesDayGatherService.getReportSalesDayGather(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
public void SalesReport(@RequestBody PagerQuery<ReportSalesDayGatherQuery> pq) throws IOException { |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,77 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaygather; |
||||
|
|
||||
|
import com.alibaba.excel.EasyExcel; |
||||
|
import com.alibaba.excel.ExcelWriter; |
||||
|
import com.alibaba.excel.util.ListUtils; |
||||
|
import com.alibaba.excel.write.metadata.WriteSheet; |
||||
|
import com.alibaba.excel.write.metadata.fill.FillConfig; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaygather.ReportSalesDayGather; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaygather.ReportSalesDayGatherQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaygather.ReportSalesDayGatherVo; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaylog.MyHandler; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStoreVo; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.apache.poi.ss.util.CellRangeAddress; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class ReportSalesDayGatherService extends MybatisBaseService<ReportSalesDayGatherMapper, ReportSalesDayGather> { |
||||
|
|
||||
|
public List<ReportSalesDayGatherVo> getReportSalesDayGather(PagerQuery<ReportSalesDayGatherQuery> pq) { |
||||
|
ReportSalesDayGatherQuery query = pq.getParams(); |
||||
|
QueryWrapper<ReportSalesDayGather> qw = new QueryWrapper<>(); |
||||
|
if(query!=null) { |
||||
|
if (StringUtils.isNotBlank(query.getDate())) { |
||||
|
qw.eq("STR_TO_DATE(orderDate,'%Y-%m-%d')", query.getDate()); |
||||
|
} |
||||
|
} |
||||
|
//IPage<GdSalesReport> page = PagerUtil.queryToPage(pq);
|
||||
|
List<ReportSalesDayGatherVo> pagging = baseMapper.getReportSalesDayGather(qw); |
||||
|
//PagerVo<GdSalesReportVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
|
return pagging; |
||||
|
} |
||||
|
public List<ReportSalesDayGatherVo> getAllReportSalesDayGather(String orderDate) { |
||||
|
ReportSalesDayGatherQuery reportSalesDayGatherQuery=new ReportSalesDayGatherQuery(); |
||||
|
reportSalesDayGatherQuery.setDate(orderDate); |
||||
|
PagerQuery<ReportSalesDayGatherQuery> pq=new PagerQuery<>(); |
||||
|
pq.setParams(reportSalesDayGatherQuery); |
||||
|
ReportSalesDayGatherQuery query = pq.getParams(); |
||||
|
QueryWrapper<ReportSalesDayGather> qw = new QueryWrapper<>(); |
||||
|
if(query!=null) { |
||||
|
if (StringUtils.isNotBlank(query.getDate())) { |
||||
|
qw.eq("STR_TO_DATE(orderDate,'%Y-%m-%d')", query.getDate()); |
||||
|
} |
||||
|
} |
||||
|
List<ReportSalesDayGatherVo> pagging = baseMapper.getReportSalesDayGather(qw); |
||||
|
return pagging; |
||||
|
} |
||||
|
/** |
||||
|
* 销售日报汇总 |
||||
|
* @param map |
||||
|
* @param excelWriter |
||||
|
* @param SalesVos |
||||
|
* @throws IOException |
||||
|
*/ |
||||
|
public void exportReportSalesDayStore(Map<String, Object> map, ExcelWriter excelWriter, List<ReportSalesDayGatherVo> SalesVos) throws IOException { |
||||
|
|
||||
|
WriteSheet writeSheet = EasyExcel.writerSheet(0).build(); |
||||
|
// 填写配置,forceNewRow true表示自动创建一行,后面的数据后移
|
||||
|
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); |
||||
|
//填写数据
|
||||
|
excelWriter.fill(SalesVos, fillConfig, writeSheet); |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaylog; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLog; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLogVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface ReportSalesDayLogMapper extends BaseMapper<ReportSalesDayLog> { |
||||
|
List<ReportSalesDayLogVo> getReportSalesDayLog(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayLog> qw); |
||||
|
ReportSalesDayLogVo getLogByOrderDate(@Param("orderDate") String orderDate); |
||||
|
|
||||
|
List<ReportSalesDayLogVo> getAllReportSalesDayLog(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayLog> qw); |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.yxt.supervise.report.biz.reportsalesdaylog.ReportSalesDayLogMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="getReportSalesDayLog" resultType="com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLogVo"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
report_sales_day_log |
||||
|
<where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
<select id="getLogByOrderDate" resultType="com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLogVo"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
report_sales_day_log |
||||
|
where |
||||
|
orderDate=#{orderDate} |
||||
|
</select> |
||||
|
|
||||
|
<select id="getAllReportSalesDayLog" resultType="com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLogVo"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
report_sales_day_store |
||||
|
<where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,100 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaylog; |
||||
|
|
||||
|
import com.alibaba.excel.EasyExcel; |
||||
|
import com.alibaba.excel.ExcelWriter; |
||||
|
import com.alibaba.excel.write.builder.ExcelWriterBuilder; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLog; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLogQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLogVo; |
||||
|
import com.yxt.supervise.report.biz.reportsalesdaygather.ReportSalesDayGatherService; |
||||
|
import com.yxt.supervise.report.biz.reportsalesdaystore.ReportSalesDayStoreService; |
||||
|
import com.yxt.supervise.report.biz.reportsalesdaystoreproduct.ReportSalesDayStoreProductService; |
||||
|
import com.yxt.supervise.report.biz.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreService; |
||||
|
import com.yxt.supervise.report.biz.reportsalesdaytobaccostoreproduct.ReportSalesDayTobaccoStoreProductService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/reportsalesdaylog") |
||||
|
public class ReportSalesDayLogRest { |
||||
|
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 |
||||
|
ReportSalesDayLogService ReportSalesDayLogService; |
||||
|
@Autowired |
||||
|
ReportSalesDayGatherService reportSalesDayGatherService; |
||||
|
@Autowired |
||||
|
ReportSalesDayStoreService reportSalesDayStoreService; |
||||
|
@Autowired |
||||
|
ReportSalesDayStoreProductService reportSalesDayStoreProductService; |
||||
|
@Autowired |
||||
|
ReportSalesDayTobaccoStoreService reportSalesDayTobaccoStoreService; |
||||
|
@Autowired |
||||
|
ReportSalesDayTobaccoStoreProductService reportSalesDayTobaccoStoreProductService; |
||||
|
|
||||
|
|
||||
|
@PostMapping("/getReportSalesDayLog") |
||||
|
public ResultBean<ReportSalesDayLogVo> getReportSalesDayLog(@RequestBody PagerQuery<ReportSalesDayLogQuery> pq){ |
||||
|
new Thread(new GdSalesThread(pq.getParams().getDate())).start(); |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
List<ReportSalesDayLogVo> pv = ReportSalesDayLogService.getReportSalesDayLog(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
public class GdSalesThread extends Thread{ |
||||
|
String orderDate; |
||||
|
public GdSalesThread(String orderDate) { |
||||
|
this.orderDate = orderDate; |
||||
|
} |
||||
|
public void run(){ |
||||
|
try { |
||||
|
System.out.println("excel线程开启"); |
||||
|
SalesReport(orderDate); |
||||
|
System.out.println("excel线程结束"); |
||||
|
} catch (IOException e) { |
||||
|
throw new RuntimeException(e); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
public ResultBean<ReportSalesDayLogVo> getAllReportSalesDayLog(@RequestBody PagerQuery<ReportSalesDayLogQuery> pq){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
List<ReportSalesDayLogVo> pv = ReportSalesDayLogService.getAllReportSalesDayLog(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
public void SalesReport(String orderDate) throws IOException { |
||||
|
// 创建ExcelWriterBuilder
|
||||
|
ExcelWriterBuilder excelWriterBuilder = EasyExcel.write(EXCEL_FILE_NAME).withTemplate(TEMPLATE_FILE_NAME); |
||||
|
ExcelWriter excelWriter = excelWriterBuilder.build(); |
||||
|
// 写入list之前的数据
|
||||
|
Map<String, Object> map = new HashMap<String, Object>(); |
||||
|
// map.put("date",StoreSalesVos.get(1).getDate());
|
||||
|
// map.put("date",StoreSalesVos.get(1).getDate());
|
||||
|
// map.put("storeNum",StoreSalesVos.size());
|
||||
|
reportSalesDayGatherService.exportReportSalesDayStore(map,excelWriter,reportSalesDayGatherService.getAllReportSalesDayGather(orderDate)); |
||||
|
reportSalesDayStoreService.exportReportSalesDayStore(map,excelWriter,reportSalesDayStoreService.getAllReportSalesDayStore(orderDate)); |
||||
|
reportSalesDayStoreProductService.exportReportSalesDayStoreProduct(map,excelWriter,reportSalesDayStoreProductService.getAllReportSalesDayStoreProduct(orderDate)); |
||||
|
reportSalesDayTobaccoStoreService.exportReportSalesDayTobaccoStore(map,excelWriter,reportSalesDayTobaccoStoreService.getAllReportSalesDayTobaccoStore(orderDate)); |
||||
|
reportSalesDayTobaccoStoreProductService.exportReportSalesDayTobaccoStoreProduct(map,excelWriter,reportSalesDayTobaccoStoreProductService.getAllReportSalesDayTobaccoStoreProduct(orderDate)); |
||||
|
ReportSalesDayLog log=ReportSalesDayLogService.getOne(new QueryWrapper<ReportSalesDayLog>().eq("orderDate",orderDate)); |
||||
|
//保存url
|
||||
|
log.setUrl(EXCEL_FILE_NAME); |
||||
|
ReportSalesDayLogService.update(log,new QueryWrapper<ReportSalesDayLog>().eq("orderDate",orderDate)); |
||||
|
excelWriter.finish(); |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,49 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaylog; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLog; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLogQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaylog.ReportSalesDayLogVo; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class ReportSalesDayLogService extends MybatisBaseService<ReportSalesDayLogMapper, ReportSalesDayLog> { |
||||
|
|
||||
|
public List<ReportSalesDayLogVo> getReportSalesDayLog(PagerQuery<ReportSalesDayLogQuery> pq) { |
||||
|
ReportSalesDayLogQuery query = pq.getParams(); |
||||
|
QueryWrapper<ReportSalesDayLog> qw = new QueryWrapper<>(); |
||||
|
if(query!=null) { |
||||
|
if (StringUtils.isNotBlank(query.getDate())) { |
||||
|
qw.eq("STR_TO_DATE(orderDate,'%Y-%m-%d')", query.getDate()); |
||||
|
} |
||||
|
} |
||||
|
//IPage<GdSalesReport> page = PagerUtil.queryToPage(pq);
|
||||
|
List<ReportSalesDayLogVo> pagging = baseMapper.getReportSalesDayLog(qw); |
||||
|
//PagerVo<GdSalesReportVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
|
return pagging; |
||||
|
} |
||||
|
public ReportSalesDayLogVo getLogByOrderDate(String orderDate){ |
||||
|
return baseMapper.getLogByOrderDate(orderDate); |
||||
|
} |
||||
|
public List<ReportSalesDayLogVo> getAllReportSalesDayLog(PagerQuery<ReportSalesDayLogQuery> pq) { |
||||
|
ReportSalesDayLogQuery query = pq.getParams(); |
||||
|
QueryWrapper<ReportSalesDayLog> qw = new QueryWrapper<>(); |
||||
|
if(query!=null) { |
||||
|
if (StringUtils.isNotBlank(query.getDate())) { |
||||
|
qw.eq("STR_TO_DATE(orderDate,'%Y-%m-%d')", query.getDate()); |
||||
|
} |
||||
|
} |
||||
|
List<ReportSalesDayLogVo> pagging = baseMapper.getReportSalesDayLog(qw); |
||||
|
return pagging; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaystore; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStore; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStoreVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface ReportSalesDayStoreMapper extends BaseMapper<ReportSalesDayStore> { |
||||
|
List<ReportSalesDayStoreVo> getReportSalesDayStore(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayStore> qw); |
||||
|
List<ReportSalesDayStoreVo> getAllReportSalesDayStore(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayStore> qw); |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.yxt.supervise.report.biz.reportsalesdaystore.ReportSalesDayStoreMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="getReportSalesDayStore" resultType="com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStoreVo"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
report_sales_day_store |
||||
|
<where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
<select id="getAllReportSalesDayStore" resultType="com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStoreVo"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
report_sales_day_store |
||||
|
<where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,61 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaystore; |
||||
|
|
||||
|
import com.alibaba.excel.EasyExcel; |
||||
|
import com.alibaba.excel.ExcelWriter; |
||||
|
import com.alibaba.excel.write.builder.ExcelWriterBuilder; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStoreQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStoreVo; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/reportsalesdaystore") |
||||
|
public class ReportSalesDayStoreRest { |
||||
|
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 |
||||
|
ReportSalesDayStoreService ReportSalesDayStoreService; |
||||
|
|
||||
|
@PostMapping("/getReportSalesDayStore") |
||||
|
public ResultBean<ReportSalesDayStoreVo> getReportSalesDayStore(@RequestBody PagerQuery<ReportSalesDayStoreQuery> pq){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
List<ReportSalesDayStoreVo> pv = ReportSalesDayStoreService.getReportSalesDayStore(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
public void SalesReport(@RequestBody PagerQuery<ReportSalesDayStoreQuery> pq) throws IOException { |
||||
|
|
||||
|
// List<StoreSalesReportExcelVo> StoreSalesVos =gdSalesReportService.getAllStoreSalesReport(pq);
|
||||
|
// List<GoodsSalesReportExcelVo>goodsSalesVos= gdSalesReportService.getAllGoodsSalesReport(pq);
|
||||
|
// List<StoreSalesReportExcelVo> StoreSalesYcVos = gdSalesReportService.StoreSalesYcReportExcelVo(pq);
|
||||
|
// List<GoodsSalesReportExcelVo> goodsSalesYcVos=gdSalesReportService.GoodsSalesReportYcExcelVo(pq);
|
||||
|
// List<ReportSalesDayStoreVo> ReportSalesDayStoreVos=getAllReportSalesDayStore(pq);
|
||||
|
// 创建ExcelWriterBuilder
|
||||
|
ExcelWriterBuilder excelWriterBuilder = EasyExcel.write(EXCEL_FILE_NAME).withTemplate(TEMPLATE_FILE_NAME); |
||||
|
ExcelWriter excelWriter = excelWriterBuilder.build(); |
||||
|
// 写入list之前的数据
|
||||
|
Map<String, Object> map = new HashMap<String, Object>(); |
||||
|
// map.put("date",StoreSalesVos.get(1).getDate());
|
||||
|
// map.put("date",StoreSalesVos.get(1).getDate());
|
||||
|
// map.put("storeNum",StoreSalesVos.size());
|
||||
|
|
||||
|
|
||||
|
|
||||
|
excelWriter.finish(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,107 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaystore; |
||||
|
|
||||
|
import com.alibaba.excel.EasyExcel; |
||||
|
import com.alibaba.excel.ExcelWriter; |
||||
|
import com.alibaba.excel.util.ListUtils; |
||||
|
import com.alibaba.excel.write.metadata.WriteSheet; |
||||
|
import com.alibaba.excel.write.metadata.fill.FillConfig; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaygather.ReportSalesDayGatherQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaylog.MyHandler; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStore; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStoreQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStoreVo; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStore; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreVo; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.apache.poi.ss.util.CellRangeAddress; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.text.SimpleDateFormat; |
||||
|
import java.util.*; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class ReportSalesDayStoreService extends MybatisBaseService<ReportSalesDayStoreMapper, ReportSalesDayStore> { |
||||
|
|
||||
|
public List<ReportSalesDayStoreVo> getReportSalesDayStore(PagerQuery<ReportSalesDayStoreQuery> pq) { |
||||
|
ReportSalesDayStoreQuery query = pq.getParams(); |
||||
|
QueryWrapper<ReportSalesDayStore> qw = new QueryWrapper<>(); |
||||
|
if(query!=null) { |
||||
|
if (StringUtils.isNotBlank(query.getDate())) { |
||||
|
qw.eq("STR_TO_DATE(orderDate,'%Y-%m-%d')", query.getDate()); |
||||
|
} |
||||
|
} |
||||
|
//IPage<GdSalesReport> page = PagerUtil.queryToPage(pq);
|
||||
|
List<ReportSalesDayStoreVo> pagging = baseMapper.getReportSalesDayStore(qw); |
||||
|
//PagerVo<GdSalesReportVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
|
return pagging; |
||||
|
} |
||||
|
public List<ReportSalesDayStoreVo> getAllReportSalesDayStore(String orderDate) { |
||||
|
ReportSalesDayStoreQuery reportSalesDayStoreQuery=new ReportSalesDayStoreQuery(); |
||||
|
reportSalesDayStoreQuery.setDate(orderDate); |
||||
|
PagerQuery<ReportSalesDayStoreQuery> pq=new PagerQuery<>(); |
||||
|
pq.setParams(reportSalesDayStoreQuery); |
||||
|
ReportSalesDayStoreQuery query = pq.getParams(); |
||||
|
QueryWrapper<ReportSalesDayStore> qw = new QueryWrapper<>(); |
||||
|
if(query!=null) { |
||||
|
if (StringUtils.isNotBlank(query.getDate())) { |
||||
|
qw.eq("STR_TO_DATE(orderDate,'%Y-%m-%d')", query.getDate()); |
||||
|
} |
||||
|
} |
||||
|
List<ReportSalesDayStoreVo> pagging = baseMapper.getReportSalesDayStore(qw); |
||||
|
return pagging; |
||||
|
} |
||||
|
/** |
||||
|
* 门店销售明细表 |
||||
|
* @param map |
||||
|
* @param excelWriter |
||||
|
* @param SalesVos |
||||
|
* @throws IOException |
||||
|
*/ |
||||
|
public void exportReportSalesDayStore(Map<String, Object> map, ExcelWriter excelWriter, List<ReportSalesDayStoreVo> SalesVos) throws IOException { |
||||
|
List<CellRangeAddress> list = new ArrayList<>(); |
||||
|
//new CellRangeAddress(开始行,结束行,开始列,结束列)
|
||||
|
list.add(new CellRangeAddress(3, SalesVos.size()+3, 1, 3)); |
||||
|
// 创建writeSheet,并注册合并单元格handler
|
||||
|
WriteSheet writeSheet = EasyExcel.writerSheet(1).registerWriteHandler(new MyHandler(0,list)).build(); |
||||
|
// 填写配置,forceNewRow true表示自动创建一行,后面的数据后移
|
||||
|
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); |
||||
|
//填写数据
|
||||
|
excelWriter.fill(SalesVos, fillConfig, writeSheet); |
||||
|
//excelWriter.fill(excelVos, writeSheet);
|
||||
|
// 写入list之前的数据
|
||||
|
// Calendar cal = Calendar.getInstance();
|
||||
|
// Date date = new Date();
|
||||
|
// cal.setTime(date);
|
||||
|
// SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
// Integer month=cal.get(Calendar.MONTH)+1;
|
||||
|
// map.put("number","mdxsmxb"+cal.get(Calendar.YEAR)+month+cal.get(Calendar.DAY_OF_MONTH));
|
||||
|
// map.put("storeNum",StoreSalesVos.size());
|
||||
|
// excelWriter.fill(map, writeSheet);
|
||||
|
// list 后面还有个统计 想办法手动写入
|
||||
|
// 这里偷懒直接用list 也可以用对象
|
||||
|
List<List<String>> totalListList = ListUtils.newArrayList(); |
||||
|
List<String> totalList = ListUtils.newArrayList(); |
||||
|
totalListList.add(totalList); |
||||
|
BigDecimal total=new BigDecimal("0"); |
||||
|
// for(StoreSalesReportExcelVo i:StoreSalesVos){
|
||||
|
// total=total.add(i.getSalesVolume());
|
||||
|
// }
|
||||
|
totalList.add(""); |
||||
|
totalList.add(""); |
||||
|
totalList.add(""); |
||||
|
totalList.add("统计:"); |
||||
|
totalList.add(String.valueOf(total)); |
||||
|
// 这里是write 别和fill 搞错了
|
||||
|
WriteSheet writeSheet1 = EasyExcel.writerSheet(1).build(); |
||||
|
excelWriter.write(totalListList,writeSheet1); |
||||
|
} |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaystoreproduct; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystoreproduct.ReportSalesDayStoreProduct; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystoreproduct.ReportSalesDayStoreProductVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface ReportSalesDayStoreProductMapper extends BaseMapper<ReportSalesDayStoreProduct> { |
||||
|
List<ReportSalesDayStoreProductVo> getReportSalesDayStoreProduct(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayStoreProduct> qw); |
||||
|
List<ReportSalesDayStoreProductVo> getAllReportSalesDayStoreProduct(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayStoreProduct> qw); |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.yxt.supervise.report.biz.reportsalesdaystoreproduct.ReportSalesDayStoreProductMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="getReportSalesDayStoreProduct" resultType="com.yxt.supervise.report.api.reportsalesdaystoreproduct.ReportSalesDayStoreProductVo"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
report_sales_day_store_product |
||||
|
<where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
<select id="getAllReportSalesDayStoreProduct" resultType="com.yxt.supervise.report.api.reportsalesdaystoreproduct.ReportSalesDayStoreProductVo"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
report_sales_day_store_product |
||||
|
<where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,44 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaystoreproduct; |
||||
|
|
||||
|
import com.alibaba.excel.EasyExcel; |
||||
|
import com.alibaba.excel.ExcelWriter; |
||||
|
import com.alibaba.excel.write.builder.ExcelWriterBuilder; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystoreproduct.ReportSalesDayStoreProductQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystoreproduct.ReportSalesDayStoreProductVo; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/reportsalesdaystoreproduct") |
||||
|
public class ReportSalesDayStoreProductRest { |
||||
|
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 |
||||
|
ReportSalesDayStoreProductService ReportSalesDayStoreProductService; |
||||
|
|
||||
|
@PostMapping("/getReportSalesDayStoreProduct") |
||||
|
public ResultBean<ReportSalesDayStoreProductVo> getReportSalesDayStoreProduct(@RequestBody PagerQuery<ReportSalesDayStoreProductQuery> pq){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
List<ReportSalesDayStoreProductVo> pv = ReportSalesDayStoreProductService.getReportSalesDayStoreProduct(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
public void SalesReport(@RequestBody PagerQuery<ReportSalesDayStoreProductQuery> pq) throws IOException { |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,105 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaystoreproduct; |
||||
|
|
||||
|
import com.alibaba.excel.EasyExcel; |
||||
|
import com.alibaba.excel.ExcelWriter; |
||||
|
import com.alibaba.excel.util.ListUtils; |
||||
|
import com.alibaba.excel.write.metadata.WriteSheet; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStoreQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystoreproduct.ReportSalesDayStoreProduct; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystoreproduct.ReportSalesDayStoreProductQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystoreproduct.ReportSalesDayStoreProductVo; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.text.SimpleDateFormat; |
||||
|
import java.util.Calendar; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class ReportSalesDayStoreProductService extends MybatisBaseService<ReportSalesDayStoreProductMapper, ReportSalesDayStoreProduct> { |
||||
|
|
||||
|
public List<ReportSalesDayStoreProductVo> getReportSalesDayStoreProduct(PagerQuery<ReportSalesDayStoreProductQuery> pq) { |
||||
|
ReportSalesDayStoreProductQuery query = pq.getParams(); |
||||
|
QueryWrapper<ReportSalesDayStoreProduct> qw = new QueryWrapper<>(); |
||||
|
if(query!=null) { |
||||
|
if (StringUtils.isNotBlank(query.getDate())) { |
||||
|
qw.eq("STR_TO_DATE(orderDate,'%Y-%m-%d')", query.getDate()); |
||||
|
} |
||||
|
} |
||||
|
//IPage<GdSalesReport> page = PagerUtil.queryToPage(pq);
|
||||
|
List<ReportSalesDayStoreProductVo> pagging = baseMapper.getReportSalesDayStoreProduct(qw); |
||||
|
//PagerVo<GdSalesReportVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
|
return pagging; |
||||
|
} |
||||
|
public List<ReportSalesDayStoreProductVo> getAllReportSalesDayStoreProduct(String orderDate) { |
||||
|
ReportSalesDayStoreProductQuery reportSalesDayStoreProductQuery=new ReportSalesDayStoreProductQuery(); |
||||
|
reportSalesDayStoreProductQuery.setDate(orderDate); |
||||
|
PagerQuery<ReportSalesDayStoreProductQuery> pq=new PagerQuery<>(); |
||||
|
pq.setParams(reportSalesDayStoreProductQuery); |
||||
|
ReportSalesDayStoreProductQuery query = pq.getParams(); |
||||
|
QueryWrapper<ReportSalesDayStoreProduct> qw = new QueryWrapper<>(); |
||||
|
if(query!=null) { |
||||
|
if (StringUtils.isNotBlank(query.getDate())) { |
||||
|
qw.eq("STR_TO_DATE(orderDate,'%Y-%m-%d')", query.getDate()); |
||||
|
} |
||||
|
} |
||||
|
List<ReportSalesDayStoreProductVo> pagging = baseMapper.getReportSalesDayStoreProduct(qw); |
||||
|
return pagging; |
||||
|
} |
||||
|
/** |
||||
|
* 门店商品销售明细表 |
||||
|
* @param map |
||||
|
* @param excelWriter |
||||
|
* @param SalesVos |
||||
|
* @throws IOException |
||||
|
*/ |
||||
|
public void exportReportSalesDayStoreProduct(Map<String, Object> map, ExcelWriter excelWriter, List<ReportSalesDayStoreProductVo> SalesVos) throws IOException { |
||||
|
//得到所有要导出的数据
|
||||
|
WriteSheet writeSheetGood = EasyExcel.writerSheet(2).build(); |
||||
|
//填写数据
|
||||
|
excelWriter.fill(SalesVos, writeSheetGood); |
||||
|
//excelWriter.fill(goodsSalesReportExcelVos, writeSheetGood);
|
||||
|
// 写入list之前的数据
|
||||
|
// Calendar cal = Calendar.getInstance();
|
||||
|
// Date date = new Date();
|
||||
|
// cal.setTime(date);
|
||||
|
// SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
// Integer month=cal.get(Calendar.MONTH)+1;
|
||||
|
//
|
||||
|
// excelWriter.fill(map, writeSheetGood);
|
||||
|
// list 后面还有个统计 想办法手动写入
|
||||
|
List<List<String>> totalListList1 = ListUtils.newArrayList(); |
||||
|
List<String> totalList1 = ListUtils.newArrayList(); |
||||
|
totalListList1.add(totalList1); |
||||
|
BigDecimal total=new BigDecimal("0"); |
||||
|
// for(ReportSalesDayStoreProductVo i:goodsSalesReportExcelVos){
|
||||
|
// total=total.add(i.getTotal());
|
||||
|
// }
|
||||
|
|
||||
|
totalList1.add(""); |
||||
|
totalList1.add(""); |
||||
|
totalList1.add(""); |
||||
|
totalList1.add(""); |
||||
|
totalList1.add(""); |
||||
|
totalList1.add(""); |
||||
|
totalList1.add("统计:"); |
||||
|
if(SalesVos.get(0).getCountAmount().equals("")|| SalesVos.get(0).getCountAmount().equals(null)){ |
||||
|
totalList1.add("0"); |
||||
|
}else{ |
||||
|
totalList1.add(SalesVos.get(0).getCountAmount()); |
||||
|
} |
||||
|
// 这里是write 别和fill 搞错了
|
||||
|
excelWriter.write(totalListList1,writeSheetGood); |
||||
|
} |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaytobaccostore; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStore; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface ReportSalesDayTobaccoStoreMapper extends BaseMapper<ReportSalesDayTobaccoStore> { |
||||
|
List<ReportSalesDayTobaccoStoreVo> getReportSalesDayTobaccoStore(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayTobaccoStore> qw); |
||||
|
List<ReportSalesDayTobaccoStoreVo> getAllReportSalesDayTobaccoStore(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayTobaccoStore> qw); |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.yxt.supervise.report.biz.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="getReportSalesDayTobaccoStore" resultType="com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreVo"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
report_sales_day_store_product |
||||
|
<where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
<select id="getAllReportSalesDayTobaccoStore" resultType="com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreVo"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
report_sales_day_store_product |
||||
|
<where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,41 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaytobaccostore; |
||||
|
|
||||
|
import com.alibaba.excel.EasyExcel; |
||||
|
import com.alibaba.excel.ExcelWriter; |
||||
|
import com.alibaba.excel.write.builder.ExcelWriterBuilder; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreVo; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/reportsalesdaytobaccostore") |
||||
|
public class ReportSalesDayTobaccoStoreRest { |
||||
|
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 |
||||
|
com.yxt.supervise.report.biz.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreService ReportSalesDayTobaccoStoreService; |
||||
|
|
||||
|
@PostMapping("/getReportSalesDayTobaccoStore") |
||||
|
public ResultBean<ReportSalesDayTobaccoStoreVo> getReportSalesDayTobaccoStore(@RequestBody PagerQuery<ReportSalesDayTobaccoStoreQuery> pq){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
List<ReportSalesDayTobaccoStoreVo> pv = ReportSalesDayTobaccoStoreService.getReportSalesDayTobaccoStore(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,106 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaytobaccostore; |
||||
|
|
||||
|
import com.alibaba.excel.EasyExcel; |
||||
|
import com.alibaba.excel.ExcelWriter; |
||||
|
import com.alibaba.excel.util.ListUtils; |
||||
|
import com.alibaba.excel.write.metadata.WriteSheet; |
||||
|
import com.alibaba.excel.write.metadata.fill.FillConfig; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaylog.MyHandler; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystore.ReportSalesDayStoreVo; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystoreproduct.ReportSalesDayStoreProductQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStore; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreVo; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.apache.poi.ss.util.CellRangeAddress; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.text.SimpleDateFormat; |
||||
|
import java.util.*; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class ReportSalesDayTobaccoStoreService extends MybatisBaseService<ReportSalesDayTobaccoStoreMapper, ReportSalesDayTobaccoStore> { |
||||
|
|
||||
|
public List<ReportSalesDayTobaccoStoreVo> getReportSalesDayTobaccoStore(PagerQuery<ReportSalesDayTobaccoStoreQuery> pq) { |
||||
|
ReportSalesDayTobaccoStoreQuery query = pq.getParams(); |
||||
|
QueryWrapper<ReportSalesDayTobaccoStore> qw = new QueryWrapper<>(); |
||||
|
if(query!=null) { |
||||
|
if (StringUtils.isNotBlank(query.getDate())) { |
||||
|
qw.eq("STR_TO_DATE(orderDate,'%Y-%m-%d')", query.getDate()); |
||||
|
} |
||||
|
} |
||||
|
//IPage<GdSalesReport> page = PagerUtil.queryToPage(pq);
|
||||
|
List<ReportSalesDayTobaccoStoreVo> pagging = baseMapper.getReportSalesDayTobaccoStore(qw); |
||||
|
//PagerVo<GdSalesReportVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
|
return pagging; |
||||
|
} |
||||
|
public List<ReportSalesDayTobaccoStoreVo> getAllReportSalesDayTobaccoStore(String orderDate) { |
||||
|
ReportSalesDayTobaccoStoreQuery reportSalesDayTobaccoStoreQuery=new ReportSalesDayTobaccoStoreQuery(); |
||||
|
reportSalesDayTobaccoStoreQuery.setDate(orderDate); |
||||
|
PagerQuery<ReportSalesDayTobaccoStoreQuery> pq=new PagerQuery<>(); |
||||
|
pq.setParams(reportSalesDayTobaccoStoreQuery); |
||||
|
ReportSalesDayTobaccoStoreQuery query = pq.getParams(); |
||||
|
QueryWrapper<ReportSalesDayTobaccoStore> qw = new QueryWrapper<>(); |
||||
|
if(query!=null) { |
||||
|
if (StringUtils.isNotBlank(query.getDate())) { |
||||
|
qw.eq("STR_TO_DATE(orderDate,'%Y-%m-%d')", query.getDate()); |
||||
|
} |
||||
|
} |
||||
|
List<ReportSalesDayTobaccoStoreVo> pagging = baseMapper.getReportSalesDayTobaccoStore(qw); |
||||
|
return pagging; |
||||
|
} |
||||
|
/** |
||||
|
* 烟草门店销售明细表 |
||||
|
* @param map |
||||
|
* @param excelWriter |
||||
|
* @param SalesVos |
||||
|
* @throws IOException |
||||
|
*/ |
||||
|
public void exportReportSalesDayTobaccoStore(Map<String, Object> map, ExcelWriter excelWriter, List<ReportSalesDayTobaccoStoreVo> SalesVos) throws IOException { |
||||
|
List<CellRangeAddress> list = new ArrayList<>(); |
||||
|
//new CellRangeAddress(开始行,结束行,开始列,结束列)
|
||||
|
list.add(new CellRangeAddress(3, SalesVos.size()+3, 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(SalesVos, fillConfig, writeSheet); |
||||
|
//excelWriter.fill(excelVos, writeSheet);
|
||||
|
// 写入list之前的数据
|
||||
|
// Calendar cal = Calendar.getInstance();
|
||||
|
// Date date = new Date();
|
||||
|
// cal.setTime(date);
|
||||
|
// SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
// Integer month=cal.get(Calendar.MONTH)+1;
|
||||
|
// map.put("number","mdxsmxb"+cal.get(Calendar.YEAR)+month+cal.get(Calendar.DAY_OF_MONTH));
|
||||
|
// map.put("storeNum",StoreSalesVos.size());
|
||||
|
// excelWriter.fill(map, writeSheet);
|
||||
|
// list 后面还有个统计 想办法手动写入
|
||||
|
// 这里偷懒直接用list 也可以用对象
|
||||
|
List<List<String>> totalListList = ListUtils.newArrayList(); |
||||
|
List<String> totalList = ListUtils.newArrayList(); |
||||
|
totalListList.add(totalList); |
||||
|
BigDecimal total=new BigDecimal("0"); |
||||
|
// for(StoreSalesReportExcelVo i:StoreSalesVos){
|
||||
|
// 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); |
||||
|
} |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaytobaccostoreproduct; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct.ReportSalesDayTobaccoStoreProduct; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct.ReportSalesDayTobaccoStoreProductVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface ReportSalesDayTobaccoStoreProductMapper extends BaseMapper<ReportSalesDayTobaccoStoreProduct> { |
||||
|
List<ReportSalesDayTobaccoStoreProductVo> getReportSalesDayTobaccoStoreProduct(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayTobaccoStoreProduct> qw); |
||||
|
List<ReportSalesDayTobaccoStoreProductVo> getAllReportSalesDayTobaccoStoreProduct(@Param(Constants.WRAPPER) Wrapper<ReportSalesDayTobaccoStoreProduct> qw); |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.yxt.supervise.report.biz.reportsalesdaytobaccostoreproduct.ReportSalesDayTobaccoStoreProductMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="getReportSalesDayTobaccoStoreProduct" resultType="com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct.ReportSalesDayTobaccoStoreProductVo"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
report_sales_day_tobacco_store_product |
||||
|
<where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
<select id="getAllReportSalesDayTobaccoStoreProduct" resultType="com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct.ReportSalesDayTobaccoStoreProductVo"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
report_sales_day_tobacco_store_product |
||||
|
<where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,41 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaytobaccostoreproduct; |
||||
|
|
||||
|
import com.alibaba.excel.EasyExcel; |
||||
|
import com.alibaba.excel.ExcelWriter; |
||||
|
import com.alibaba.excel.write.builder.ExcelWriterBuilder; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct.ReportSalesDayTobaccoStoreProductQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct.ReportSalesDayTobaccoStoreProductVo; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/reportsalesdaytobaccostoreproduct") |
||||
|
public class ReportSalesDayTobaccoStoreProductRest { |
||||
|
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 |
||||
|
ReportSalesDayTobaccoStoreProductService ReportSalesDayTobaccoStoreProductService; |
||||
|
|
||||
|
@PostMapping("/getReportSalesDayTobaccoStoreProduct") |
||||
|
public ResultBean<ReportSalesDayTobaccoStoreProductVo> getReportSalesDayTobaccoStoreProduct(@RequestBody PagerQuery<ReportSalesDayTobaccoStoreProductQuery> pq){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
List<ReportSalesDayTobaccoStoreProductVo> pv = ReportSalesDayTobaccoStoreProductService.getReportSalesDayTobaccoStoreProduct(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,102 @@ |
|||||
|
package com.yxt.supervise.report.biz.reportsalesdaytobaccostoreproduct; |
||||
|
|
||||
|
import com.alibaba.excel.EasyExcel; |
||||
|
import com.alibaba.excel.ExcelWriter; |
||||
|
import com.alibaba.excel.util.ListUtils; |
||||
|
import com.alibaba.excel.write.metadata.WriteSheet; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaystoreproduct.ReportSalesDayStoreProductVo; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostore.ReportSalesDayTobaccoStoreQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct.ReportSalesDayTobaccoStoreProduct; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct.ReportSalesDayTobaccoStoreProductQuery; |
||||
|
import com.yxt.supervise.report.api.reportsalesdaytobaccostoreproduct.ReportSalesDayTobaccoStoreProductVo; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/21 11:18 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class ReportSalesDayTobaccoStoreProductService extends MybatisBaseService<ReportSalesDayTobaccoStoreProductMapper, ReportSalesDayTobaccoStoreProduct> { |
||||
|
|
||||
|
public List<ReportSalesDayTobaccoStoreProductVo> getReportSalesDayTobaccoStoreProduct(PagerQuery<ReportSalesDayTobaccoStoreProductQuery> pq) { |
||||
|
ReportSalesDayTobaccoStoreProductQuery query = pq.getParams(); |
||||
|
QueryWrapper<ReportSalesDayTobaccoStoreProduct> qw = new QueryWrapper<>(); |
||||
|
if(query!=null) { |
||||
|
if (StringUtils.isNotBlank(query.getDate())) { |
||||
|
qw.eq("STR_TO_DATE(orderDate,'%Y-%m-%d')", query.getDate()); |
||||
|
} |
||||
|
} |
||||
|
//IPage<GdSalesReport> page = PagerUtil.queryToPage(pq);
|
||||
|
List<ReportSalesDayTobaccoStoreProductVo> pagging = baseMapper.getReportSalesDayTobaccoStoreProduct(qw); |
||||
|
//PagerVo<GdSalesReportVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
|
return pagging; |
||||
|
} |
||||
|
public List<ReportSalesDayTobaccoStoreProductVo> getAllReportSalesDayTobaccoStoreProduct(String orderDate) { |
||||
|
ReportSalesDayTobaccoStoreProductQuery reportSalesDayTobaccoStoreProductQuery=new ReportSalesDayTobaccoStoreProductQuery(); |
||||
|
reportSalesDayTobaccoStoreProductQuery.setDate(orderDate); |
||||
|
PagerQuery<ReportSalesDayTobaccoStoreProductQuery> pq=new PagerQuery<>(); |
||||
|
pq.setParams(reportSalesDayTobaccoStoreProductQuery); |
||||
|
ReportSalesDayTobaccoStoreProductQuery query = pq.getParams(); |
||||
|
QueryWrapper<ReportSalesDayTobaccoStoreProduct> qw = new QueryWrapper<>(); |
||||
|
if(query!=null) { |
||||
|
if (StringUtils.isNotBlank(query.getDate())) { |
||||
|
qw.eq("STR_TO_DATE(orderDate,'%Y-%m-%d')", query.getDate()); |
||||
|
} |
||||
|
} |
||||
|
List<ReportSalesDayTobaccoStoreProductVo> pagging = baseMapper.getReportSalesDayTobaccoStoreProduct(qw); |
||||
|
return pagging; |
||||
|
} |
||||
|
/** |
||||
|
* 烟草门店商品销售明细表 |
||||
|
* @param map |
||||
|
* @param excelWriter |
||||
|
* @param SalesVos |
||||
|
* @throws IOException |
||||
|
*/ |
||||
|
public void exportReportSalesDayTobaccoStoreProduct(Map<String, Object> map, ExcelWriter excelWriter, List<ReportSalesDayTobaccoStoreProductVo>SalesVos) throws IOException { |
||||
|
//得到所有要导出的数据
|
||||
|
WriteSheet writeSheetGood = EasyExcel.writerSheet(4).build(); |
||||
|
//填写数据
|
||||
|
excelWriter.fill(SalesVos, writeSheetGood); |
||||
|
//excelWriter.fill(goodsSalesReportExcelVos, writeSheetGood);
|
||||
|
// 写入list之前的数据
|
||||
|
// Calendar cal = Calendar.getInstance();
|
||||
|
// Date date = new Date();
|
||||
|
// cal.setTime(date);
|
||||
|
// SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
// Integer month=cal.get(Calendar.MONTH)+1;
|
||||
|
//
|
||||
|
// excelWriter.fill(map, writeSheetGood);
|
||||
|
// list 后面还有个统计 想办法手动写入
|
||||
|
List<List<String>> totalListList1 = ListUtils.newArrayList(); |
||||
|
List<String> totalList1 = ListUtils.newArrayList(); |
||||
|
totalListList1.add(totalList1); |
||||
|
BigDecimal total=new BigDecimal("0"); |
||||
|
// for(ReportSalesDayStoreProductVo i:goodsSalesReportExcelVos){
|
||||
|
// total=total.add(i.getTotal());
|
||||
|
// }
|
||||
|
totalList1.add(""); |
||||
|
totalList1.add(""); |
||||
|
totalList1.add(""); |
||||
|
totalList1.add(""); |
||||
|
totalList1.add(""); |
||||
|
totalList1.add(""); |
||||
|
totalList1.add("统计:"); |
||||
|
if(SalesVos.get(0).getCountAmount().equals("")|| SalesVos.get(0).getCountAmount().equals(null)){ |
||||
|
totalList1.add("0"); |
||||
|
}else{ |
||||
|
totalList1.add(SalesVos.get(0).getCountAmount()); |
||||
|
} |
||||
|
// 这里是write 别和fill 搞错了
|
||||
|
excelWriter.write(totalListList1,writeSheetGood); |
||||
|
} |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
spring: |
||||
|
datasource: |
||||
|
hikari: |
||||
|
max-lifetime: 500000 |
||||
|
driver-class-name: com.mysql.cj.jdbc.Driver |
||||
|
url: jdbc:mysql://127.0.0.1:3306/supervise_report?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true |
||||
|
username: root |
||||
|
password: root |
||||
|
cloud: |
||||
|
nacos: |
||||
|
discovery: |
||||
|
server-addr: 127.0.0.1:8848 |
||||
|
redis: |
||||
|
database: 3 # Redis数据库索引(默认为0) |
||||
|
host: 127.0.0.1 |
||||
|
jedis: |
||||
|
pool: |
||||
|
max-active: -1 #连接池最大连接数(使用负值表示没有限制) |
||||
|
max-idle: 8 #连接池中的最大空闲连接 |
||||
|
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) |
||||
|
min-idle: 0 # 连接池中的最小空闲连接 |
||||
|
password: |
||||
|
port: 6379 |
||||
|
timeout: 0 # 连接超时时间(毫秒) |
||||
|
|
||||
|
image: |
||||
|
upload: |
||||
|
path: D:\supervise\upload\ |
||||
|
url: |
||||
|
prefix: http://127.0.0.1:8112/upload/ |
||||
|
|
@ -0,0 +1,28 @@ |
|||||
|
spring: |
||||
|
datasource: |
||||
|
driver-class-name: com.mysql.cj.jdbc.Driver |
||||
|
url: jdbc:mysql://127.0.0.1:3306/supervise_report?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8 |
||||
|
username: root |
||||
|
password: root |
||||
|
cloud: |
||||
|
nacos: |
||||
|
discovery: |
||||
|
server-addr: 127.0.0.1:8848 |
||||
|
redis: |
||||
|
database: 3 # Redis数据库索引(默认为0) |
||||
|
host: 127.0.0.1 |
||||
|
jedis: |
||||
|
pool: |
||||
|
max-active: -1 #连接池最大连接数(使用负值表示没有限制) |
||||
|
max-idle: 8 #连接池中的最大空闲连接 |
||||
|
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) |
||||
|
min-idle: 0 # 连接池中的最小空闲连接 |
||||
|
password: 123456 |
||||
|
port: 6379 |
||||
|
timeout: 0 # 连接超时时间(毫秒) |
||||
|
image: |
||||
|
upload: |
||||
|
path: D:\supervise\upload\ |
||||
|
url: |
||||
|
prefix: http://127.0.0.1/api/upload/ |
||||
|
|
@ -0,0 +1,31 @@ |
|||||
|
spring: |
||||
|
datasource: |
||||
|
driver-class-name: com.mysql.cj.jdbc.Driver |
||||
|
# url: jdbc:mysql://122.14.222.186:3306/supervise_crm?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true |
||||
|
url: jdbc:mysql://127.0.0.1:3306/supervise_report?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true |
||||
|
username: root |
||||
|
password: wang0403 |
||||
|
cloud: |
||||
|
nacos: |
||||
|
discovery: |
||||
|
server-addr: 127.0.0.1:8848 |
||||
|
redis: |
||||
|
database: 3 # Redis数据库索引(默认为0) |
||||
|
host: 127.0.0.1 |
||||
|
jedis: |
||||
|
pool: |
||||
|
max-active: -1 #连接池最大连接数(使用负值表示没有限制) |
||||
|
max-idle: 8 #连接池中的最大空闲连接 |
||||
|
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) |
||||
|
min-idle: 0 # 连接池中的最小空闲连接 |
||||
|
password: |
||||
|
port: 6379 |
||||
|
timeout: 0 # 连接超时时间(毫秒) |
||||
|
|
||||
|
|
||||
|
image: |
||||
|
upload: |
||||
|
path: D:/webapps/supervise/static/upload/ |
||||
|
url: |
||||
|
prefix: http://122.14.222.186:7003/upload/ |
||||
|
|
@ -0,0 +1,47 @@ |
|||||
|
spring: |
||||
|
application: |
||||
|
name: supervise-report |
||||
|
profiles: |
||||
|
# active: devv |
||||
|
active: test |
||||
|
messages: |
||||
|
# 国际化资源文件路径 |
||||
|
basename: i18n/messages |
||||
|
servlet: |
||||
|
#上传文件 |
||||
|
multipart: |
||||
|
max-file-size: 50MB |
||||
|
max-request-size: 100MB |
||||
|
devtools: |
||||
|
restart: |
||||
|
# 热部署开关 |
||||
|
enabled: true |
||||
|
|
||||
|
|
||||
|
|
||||
|
server: |
||||
|
port: 7009 |
||||
|
max-http-header-size: 102400 |
||||
|
undertow: |
||||
|
max-http-post-size: -1 |
||||
|
|
||||
|
#mybatis |
||||
|
mybatis-plus: |
||||
|
# 配置mapper的扫描,找到所有的mapper.xml映射文件 |
||||
|
mapper-locations: classpath*:**Mapper.xml |
||||
|
global-config: |
||||
|
refresh: true |
||||
|
db-config: |
||||
|
#定义生成ID的类型 |
||||
|
id-type: Auto |
||||
|
db-type: mysql |
||||
|
configuration: |
||||
|
map-underscore-to-camel-case: false |
||||
|
cache-enabled: true |
||||
|
call-setters-on-nulls: true |
||||
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
@ -0,0 +1,50 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<configuration> |
||||
|
|
||||
|
<property name="log.base" value="logs/supervise_crm" /> |
||||
|
|
||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |
||||
|
<encoder> |
||||
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 : |
||||
|
|%blue(%thread) 线程 如 :DiscoveryClient-CacheRefreshExecutor-0--> |
||||
|
<!--<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>--> |
||||
|
<pattern>%yellow(%date{yyyy-MM-dd HH:mm:ss}) |%highlight(%-5level) |%green(%logger:%line) |%blue(%msg%n) |
||||
|
</pattern> |
||||
|
<!--<charset>UTF-8</charset> --> |
||||
|
</encoder> |
||||
|
</appender> |
||||
|
|
||||
|
<!-- 彩色日志 --> |
||||
|
<!-- 彩色日志依赖的渲染类 --> |
||||
|
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> |
||||
|
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> |
||||
|
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> |
||||
|
<!-- 彩色日志格式 --> |
||||
|
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
||||
|
|
||||
|
<appender name="FILEOUT" |
||||
|
class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<file>${log.base}.log</file> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
|
<fileNamePattern>${log.base}.%d{yyyyMMdd}.%i.log.zip |
||||
|
</fileNamePattern> |
||||
|
<!-- 当文件大小超过10MB时触发滚动 --> |
||||
|
<timeBasedFileNamingAndTriggeringPolicy |
||||
|
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
||||
|
<maxFileSize>1MB</maxFileSize> |
||||
|
</timeBasedFileNamingAndTriggeringPolicy> |
||||
|
</rollingPolicy> |
||||
|
<encoder> |
||||
|
<!--<pattern>%date [%thread] %-5level %logger{35} - %msg%n</pattern>--> |
||||
|
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} |
||||
|
-%msg%n</Pattern> |
||||
|
<!--<charset>UTF-8</charset> --> |
||||
|
</encoder> |
||||
|
</appender> |
||||
|
|
||||
|
<root level="INFO"> |
||||
|
<appender-ref ref="STDOUT" /> |
||||
|
<appender-ref ref="FILEOUT" /> |
||||
|
</root> |
||||
|
|
||||
|
</configuration> |
Loading…
Reference in new issue