店铺统计

This commit is contained in:
Lenovo 2024-07-10 13:20:52 +08:00
parent 12474b2b8e
commit 9d4db0fade
3 changed files with 48 additions and 6 deletions

View File

@ -30,7 +30,9 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -67,6 +69,21 @@ public class BusStoreInfoController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/getStoreStatistics")
public AjaxResult getStoreStatistics() {
Map<String,Integer> data = new HashMap<>();
Long loginUserId = SecurityUtils.getLoginUser().getUserId();
BusStoreInfo storeInfo = new BusStoreInfo();
storeInfo.setBindId(loginUserId);
List<BusStoreInfo> list = busStoreInfoService.selectBusStoreInfoList(storeInfo);
List<BusStoreInfo> openCount = list.stream().filter(x -> x.getReturnVisitStatus() == "1").collect(Collectors.toList());
List<BusStoreInfo> noGrantCount = list.stream().filter(x -> x.getGrantStatus() == "2").collect(Collectors.toList());
data.put("storeCount",list.size());
data.put("openCount",openCount.size());
data.put("noGrantCount",noGrantCount.size());
return AjaxResult.success(data);
}
@ApiOperation("查询店铺信息列表") @ApiOperation("查询店铺信息列表")
// @PreAuthorize("@ss.hasPermi('business:store:list')") // @PreAuthorize("@ss.hasPermi('business:store:list')")
@GetMapping("/listA") @GetMapping("/listA")

View File

@ -62,9 +62,17 @@ export function updateStoreConfig(data) {
}) })
} }
export function refresh(){ export function refresh() {
return request({ return request({
url: '/mt/refresh', url: '/mt/refresh',
method: 'get' method: 'get'
}) })
} }
export function getStoreStatistics() {
return request({
url: '/business/store/getStoreStatistics',
method: 'get'
})
}

View File

@ -59,8 +59,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="2"><el-form-item label="门店数量" prop="status"></el-form-item></el-col> <el-col :span="2"><el-form-item label="门店数量"><span>{{map.storeCount}}</span></el-form-item></el-col>
<el-col :span="2"><el-form-item label="掉线数量" prop="status"></el-form-item></el-col> <el-col :span="2"><el-form-item label="掉线数量"><span>{{map.noGrantCount}}</span></el-form-item></el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="5"> <el-col :span="5">
@ -107,7 +107,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="开启数量" prop="platform"></el-form-item> <el-form-item label="开启数量"><span>{{map.openCount}}</span></el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -362,7 +362,7 @@
<script> <script>
import { listStore, changeReturnVisitStatus, getMtUrl, changeSelfDeliveryStatus, getStoreConfig, updateStoreConfig, refresh} from "@/api/business/store"; import { listStore, changeReturnVisitStatus, getMtUrl, changeSelfDeliveryStatus, getStoreConfig, updateStoreConfig, refresh, getStoreStatistics } from "@/api/business/store";
import { listSaleA} from "@/api/business/sale"; import { listSaleA} from "@/api/business/sale";
export default { export default {
@ -391,6 +391,12 @@ export default {
open: false, open: false,
// //
openDataScope: false, openDataScope: false,
map: {
storeCount: 0,
openCount: 0,
noGrantCount: 0
},
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -445,6 +451,7 @@ export default {
created() { created() {
this.getListSale(); this.getListSale();
this.getList(); this.getList();
this.storeStatistics();
}, },
methods: { methods: {
renderPrice(h, { column, $index }) { renderPrice(h, { column, $index }) {
@ -478,6 +485,16 @@ export default {
} }
); );
}, },
storeStatistics() {
getStoreStatistics().then(response => {
this.map.storeCount = response.data.storeCount;
this.map.openCount = response.data.openCount;
this.map.noGrantCount = response.data.noGrantCount;
}
);
},
idToName(row, column, cellValue) { idToName(row, column, cellValue) {
// ID // ID
const person = this.saleList.find(p => p.id === parseInt(cellValue)); const person = this.saleList.find(p => p.id === parseInt(cellValue));