-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from Jzow/master
Improve homepage data acquisition
- Loading branch information
Showing
20 changed files
with
448 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
core/api/src/main/java/com/wansenai/api/report/ReportController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance | ||
* with the License. A copy of the License is located at | ||
* | ||
* http://opensource.wansenai.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES | ||
* OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
package com.wansenai.api.report; | ||
|
||
import com.wansenai.service.receipt.ReceiptService; | ||
import com.wansenai.utils.response.Response; | ||
import com.wansenai.vo.receipt.RetailStatisticalDataVO; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/report") | ||
public class ReportController { | ||
|
||
private final ReceiptService receiptService; | ||
|
||
public ReportController(ReceiptService receiptService) { | ||
this.receiptService = receiptService; | ||
} | ||
|
||
@GetMapping("homePage/statistics") | ||
public Response<RetailStatisticalDataVO> getStatisticalData() { | ||
return receiptService.getRetailStatistics(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
.../resources/mapper_xml/WarehouseMapper.xml → ...n/resources/mapper_xml/ReceiptService.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?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.wansenai.mappers.warehouse.WarehouseMapper"> | ||
<mapper namespace="com.wansenai.mappers.receipt.ReceiptMainMapper"> | ||
|
||
</mapper> |
65 changes: 65 additions & 0 deletions
65
core/domain/src/main/java/com/wansenai/vo/receipt/RetailStatisticalDataVO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance | ||
* with the License. A copy of the License is located at | ||
* | ||
* http://opensource.wansenai.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES | ||
* OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
package com.wansenai.vo.receipt; | ||
|
||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import com.wansenai.bo.BigDecimalSerializerBO; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.math.BigDecimal; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class RetailStatisticalDataVO { | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal todaySales; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal yesterdaySales; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal todayRetailSales; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal yesterdayRetailSales; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal todayPurchase; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal yesterdayPurchase; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal monthSales; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal monthRetailSales; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal monthPurchase; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal yearSales; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal yearRetailSales; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal yearPurchase; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {defHttp} from '/@/utils/http/axios'; | ||
import {BaseDataResp, BaseResp} from "@/api/model/baseModel"; | ||
import {reportModel} from "@/api/report/model/reportModel"; | ||
|
||
enum API { | ||
getStatisticalData = '/report/homePage/statistics' | ||
} | ||
|
||
|
||
export function getStatistical() { | ||
return defHttp.get<BaseDataResp<reportModel>>( | ||
{ | ||
url: API.getStatisticalData, | ||
}, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export interface RetailStatisticalResp { | ||
todaySales: number; | ||
yesterdaySales: number; | ||
todayRetailSales: number; | ||
yesterdayRetailSales: number; | ||
todayPurchase: number; | ||
yesterdayPurchase: number; | ||
monthSales: number; | ||
monthRetailSales: number; | ||
monthPurchase: number; | ||
yearSales: number; | ||
yearRetailSales: number; | ||
yearPurchase: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
@import './common'; | ||
@import './variable'; | ||
@import './scrollbar'; | ||
@import './toolbar'; | ||
@import './component'; | ||
@import 'vxe-table/styles/index'; | ||
@import 'vxe-table/styles/index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,4 @@ | |
::-webkit-scrollbar-corner { | ||
background-color: #fff; | ||
} | ||
} | ||
} |
Oops, something went wrong.