no message

This commit is contained in:
wangh 2024-02-27 14:03:47 +08:00
parent a11a04be18
commit 50cd7a5a34
20 changed files with 137 additions and 48 deletions

View File

@ -97,3 +97,11 @@ export function exportExcelApi(data) {
data: data
})
}
export function getSalesByMtInventoryApi(data) {
return request({
url: 'business/convenience/mtInventoryDetails/getSalesByMtInventory',
method: 'get',
params: data
})
}

View File

@ -90,12 +90,17 @@
<el-table-column label="销售量" align="center" prop="unit">
<el-table-column label="便利店销售" align="center" prop="goodsSales">
<template slot-scope="scope">
{{scope.row.goodsSales?scope.row.goodsSales:'--'}}
{{scope.row.goodsSales?scope.row.goodsSales:'0'}}
</template>
</el-table-column>
<el-table-column label="积分兑换" align="center" prop="inventorySales">
<template slot-scope="scope">
{{scope.row.inventorySales?scope.row.inventorySales:'--'}}
{{scope.row.inventorySales?scope.row.inventorySales:'0'}}
</template>
</el-table-column>
<el-table-column label="兑换卷兑换" align="center" prop="inventorySales">
<template slot-scope="scope">
{{scope.row.exchangeSales?scope.row.exchangeSales:'0'}}
</template>
</el-table-column>
</el-table-column>
@ -241,10 +246,10 @@ import {
editInventoryApi,
addInventoryApi,
batchProcessingApi,
auditInventoryApi ,
auditInventoryApi,
storageInventoryApi,
abolitionInventoryApi,
exportExcelApi
exportExcelApi, getSalesByMtInventoryApi
} from "@/api/convenienceStore/inventory";
@ -480,11 +485,11 @@ export default {
})
},
addCommodity () {
async addCommodity () {
let this_ = this
let sum = 0;
this.multipleSelection.forEach(mul=>{
for (const mul of this.multipleSelection) {
let flag = true;
this_.detailsList.forEach(det=>{
if (mul.id == det.goodsId) {
@ -493,6 +498,12 @@ export default {
}
})
if(flag) {
let getPurchaseByTankIdData
await getSalesByMtInventoryApi().then(res=>{
getPurchaseByTankIdData = res.data
})
let now = {
inventoryId: this.inventoryId,
goodsId: mul.id,
@ -506,10 +517,15 @@ export default {
damageQuantity:0,
profitLossAmount:0, //
inventoryDiscrepancy:0, //
purchase:getPurchaseByTankIdData.purchase,
goodsSales:getPurchaseByTankIdData.goodsSales,
inventorySales:getPurchaseByTankIdData.inventorySales,
exchangeSales:getPurchaseByTankIdData.exchangeSales,
}
this_.detailsList.push(now)
}
})
}
if(sum>0) {
this.$modal.msgError("同一货损单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除");
}

View File

@ -127,7 +127,7 @@ export default {
pageSize:null
},
loading: false,
dateRange: [],
dateRange: [new Date(),new Date()],
defaultSort: {prop: 'createTime', order: 'descending'},
total: 0,

View File

@ -26,7 +26,7 @@
<div>{{item.gunName}}</div>
</div>
<div class="cardbox-bottom" :class="{ 'actcolor':item.status == '启用' }">
<div>ID:{{ item.id }}</div>
<!-- <div>ID:{{ item.id }}</div>-->
</div>
<div class="cardboxb" v-if="item.oilMachineGunNumber != null ">
<i class="el-icon-share"></i>

View File

@ -178,7 +178,7 @@
</el-input>
<el-alert
v-if="orderForm.tankId"
style="height: 25px;line-height: 16px;"
style="height: auto;line-height: 16px;padding: 0 0 0 0;"
:title='tTitle'
type="warning"
:closable="false">

View File

@ -645,8 +645,9 @@ export default {
this.getList();
},
//
handleAdd() {
async handleAdd() {
this.reset();
await this.getAuditPrem()
this.open = true;
this.title = "新增员工";
},

View File

@ -58,6 +58,13 @@ public class MtInventoryDetailsController extends BaseController {
return getSuccessResult(list);
}
@GetMapping("/getSalesByMtInventory")
public ResponseObject getSales(Integer goodsId) {
return getSuccessResult(mtInventoryDetailsService.getSales(goodsId));
}
/**
* 通过主键查询单条数据
*

View File

@ -37,6 +37,8 @@ public interface MtInventoryDetailsService {
IPage<MtInventoryDetailsVO> getListByPage(Page page, MtInventoryDetails mtInventoryDetails);
MtInventoryDetailsVO getSales(Integer goodsId);
/**
* 新增数据
*

View File

@ -95,11 +95,14 @@ public class MtInventoryDetailsServiceImpl implements MtInventoryDetailsService
}
// 查询销售数据
LJOrder statisticsByTime = ljOrderService.getStatisticsByTime(queryTime, record.getGoodsId());
LJOrder statisticsByTime = ljOrderService.getStatisticsByTime(queryTime, record.getGoodsId(),null);
// 查询积分兑换数据
IntegralOrders statisticsByTime1 = integralOrdersService.getStatisticsByTime(queryTime, record.getGoodsId());
// 查询积分商品库存
IntegralGift stockByGoodsId = integralGiftService.getStockByGoodsId(record.getGoodsId());
// 兑换卷
LJOrder statisticsByTime2 = ljOrderService.getStatisticsByTime(queryTime, record.getGoodsId(),"0");
if (ObjectUtil.isNotEmpty(statisticsByTime)) {
@ -111,10 +114,51 @@ public class MtInventoryDetailsServiceImpl implements MtInventoryDetailsService
if (ObjectUtil.isNotEmpty(stockByGoodsId)) {
record.setStock(record.getStock()+stockByGoodsId.getRemainingInventory());
}
if (ObjectUtil.isNotEmpty(stockByGoodsId)) {
record.setExchangeSales(statisticsByTime2.getGoodsNum().toString());
}
}
return MtInventoryDetailsIPage;
}
public MtInventoryDetailsVO getSales(Integer goodsId) {
MtInventoryDetailsVO record = new MtInventoryDetailsVO();
record.setGoodsId(goodsId);
Date queryTime = new Date();
// 查询进货数据
MtPurchaseDetails incomingGoodsData = mtPurchaseDetailsService.getIncomingGoodsData(record.getGoodsId());
if (ObjectUtil.isNotEmpty(incomingGoodsData)) {
record.setPurchase(incomingGoodsData.getQuantityPurchased().toString());
queryTime = incomingGoodsData.getUpdateTime();
}
// 查询销售数据
LJOrder statisticsByTime = ljOrderService.getStatisticsByTime(queryTime, record.getGoodsId(),null);
// 查询积分兑换数据
IntegralOrders statisticsByTime1 = integralOrdersService.getStatisticsByTime(queryTime, record.getGoodsId());
// 查询积分商品库存
IntegralGift stockByGoodsId = integralGiftService.getStockByGoodsId(record.getGoodsId());
// 兑换卷
LJOrder statisticsByTime2 = ljOrderService.getStatisticsByTime(queryTime, record.getGoodsId(),"0");
if (ObjectUtil.isNotEmpty(statisticsByTime)) {
record.setGoodsSales(statisticsByTime.getGoodsNum().toString());
}
if (ObjectUtil.isNotEmpty(statisticsByTime1)) {
record.setInventorySales(statisticsByTime1.getExchangeQuantity().toString());
}
if (ObjectUtil.isNotEmpty(stockByGoodsId)) {
record.setStock(record.getStock()+stockByGoodsId.getRemainingInventory());
}
if (ObjectUtil.isNotEmpty(stockByGoodsId)) {
record.setExchangeSales(statisticsByTime2.getGoodsNum().toString());
}
return record;
}
/**
* 新增数据
*

View File

@ -23,5 +23,6 @@ public class MtInventoryDetailsVO extends MtInventoryDetails {
private String goodsSales;
// 积分商品兑换量
private String inventorySales;
// 兑换卷
private String exchangeSales;
}

View File

@ -36,5 +36,5 @@ public interface LJOrderMapper extends BaseMapper<LJOrder> {
Map<String, String> orderStatistics(@Param("order") LJOrder order);
LJOrder getStatisticsByTime(@Param("time") Date time,@Param("goodsId") Integer goodsId);
LJOrder getStatisticsByTime(@Param("time") Date time,@Param("goodsId") Integer goodsId,@Param("payType") String payType);
}

View File

@ -202,6 +202,9 @@
left join mt_order_goods mog ON mo.id = mog.goods_id
where
mog.goods_id = #{goodsId}
<if test="payType != null"><!-- 开始时间检索 -->
and mo.pay_type = #{payType}
</if>
<if test="time != null"><!-- 开始时间检索 -->
and mo.create_time &gt;= #{time}
</if>

View File

@ -549,6 +549,10 @@
od.order_no = #{orderNo}
</where>
</select>
<!-- <if test="time != null">&lt;!&ndash; 开始时间检索 &ndash;&gt;-->
<!-- and update_time &lt;= #{time}-->
<!-- </if>-->
<select id="getInfoByTime" resultType="com.fuint.business.order.vo.OilOrderVo">
select
SUM(oil_num) oilNum,
@ -556,12 +560,12 @@
from oil_order
<where>
<if test="time != null"><!-- 开始时间检索 -->
and update_time &gt;= #{time}
and create_time &gt;= #{time}
</if>
<if test="list != null and list.size() > 0"><!-- 修改此处 -->
and tank_id in
and oil_gun_num in
<foreach collection="list" item="item" open="(" close=")" separator=",">
#{item.tankId} <!-- 修改此处 -->
#{item.id} <!-- 修改此处 -->
</foreach>
</if>
</where>

View File

@ -60,7 +60,7 @@ public interface LJOrderService extends IService<LJOrder> {
Map<String, String> orderStatistics(LJOrder order);
LJOrder getStatisticsByTime(Date time ,Integer goodsId);
LJOrder getStatisticsByTime(Date time ,Integer goodsId, String payType);
/**
* 添加商品订单信息

View File

@ -118,8 +118,8 @@ public class LJOrderServiceImpl extends ServiceImpl<LJOrderMapper, LJOrder> impl
@Override
public LJOrder getStatisticsByTime(Date time, Integer goodsId) {
return baseMapper.getStatisticsByTime(time, goodsId);
public LJOrder getStatisticsByTime(Date time, Integer goodsId, String payType) {
return baseMapper.getStatisticsByTime(time, goodsId, payType);
}
@Override

View File

@ -76,14 +76,14 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
UserBalance userBalance = selectUserBalance(userId, chainStoreId);
if(ObjectUtil.isNotEmpty(userBalance)&& ObjectUtil.isNotEmpty(userBalance.getRefuelMoney())) {
List<Map<String, String>> resultMapList = JSON.parseObject(userBalance.getRefuelMoney(), new TypeReference<List<Map<String, Object>>>() {});
List<Map<String, Object>> resultMapList = JSON.parseObject(userBalance.getRefuelMoney(), new TypeReference<List<Map<String, Object>>>() {});
if (ObjectUtil.isNotEmpty(resultMapList)) {
for (Map<String, String> stringStringMap : resultMapList) {
if (oilId.equals(stringStringMap.get("oilType"))) {
BigDecimal resRefuelMoney = new BigDecimal(stringStringMap.get("refuelMoney"));
for (Map<String, Object> stringStringMap : resultMapList) {
if (oilId.equals(String.valueOf(stringStringMap.get("oilType")))) {
BigDecimal resRefuelMoney = new BigDecimal(String.valueOf(stringStringMap.get("refuelMoney")));
BigDecimal refuelMoney = resRefuelMoney.add(new BigDecimal(changeOil.toString()));
stringStringMap.put("refuelMoney",resRefuelMoney.toString());
stringStringMap.put("refuelMoney",refuelMoney.toString());
break;
}
}

View File

@ -455,8 +455,10 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
public long getCountdown() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
SysDept sysDept = baseMapper.selectDeptById(nowAccountInfo.getDeptId());
if (ObjectUtil.isNotEmpty(sysDept) && ObjectUtil.isNotEmpty(sysDept.getTurnoverEndTime())) {
LocalDate endLocalDate = sysDept.getTurnoverEndTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
SysDept sysDept1 = baseMapper.selectDeptById(sysDept.getParentId()); // 判断连锁店是否到期
// if ()
if (ObjectUtil.isNotEmpty(sysDept1) && ObjectUtil.isNotEmpty(sysDept1.getTurnoverEndTime())) {
LocalDate endLocalDate = sysDept1.getTurnoverEndTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
LocalDate startLocalDate = LocalDate.now();
// 计算两个日期之间的天数差

View File

@ -7,16 +7,16 @@
<span>交班详情</span>
</div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item label="交班方式" prop="status">
<el-select v-model="queryParams.status" style="width: 150px" placeholder="交班方式" clearable>
<el-option
v-for="option in shiftHandoverList"
:key="option.dictCode"
:label="option.dictLabel"
:value="option.dictLabel"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="交班方式" prop="status">-->
<!-- <el-select v-model="queryParams.status" style="width: 150px" placeholder="交班方式" clearable>-->
<!-- <el-option-->
<!-- v-for="option in shiftHandoverList"-->
<!-- :key="option.dictCode"-->
<!-- :label="option.dictLabel"-->
<!-- :value="option.dictLabel"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="交班状态">
<el-select v-model="queryParams.type" style="width: 150px" placeholder="交班状态" clearable>
<el-option label="交班" value="0">交班</el-option>
@ -124,7 +124,7 @@ export default {
pageSize:null
},
loading: false,
dateRange: [],
dateRange: [new Date(),new Date()],
defaultSort: {prop: 'createTime', order: 'descending'},
total: 0,

View File

@ -58,11 +58,11 @@
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.oilPaid : '0' }}</div>
</div>
<div class="input-box">
<div>油品优惠(实收)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.oilDiacount : '0' }}</div>
<!-- <div class="input-box">-->
<!-- <div>油品优惠(实收)</div>-->
<!-- <div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.oilDiacount : '0' }}</div>-->
</div>
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>抹零总额(实收)</div>-->
<!-- <div>2164.55</div>-->

View File

@ -464,7 +464,7 @@ import {
import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/user";
import {getUserGrade} from "@/api/cashier/usergrade";
import {queryStaffs, staffInfo} from "@/api/cashier/staff";
import {getLodop} from "@/api/LodopFuncs";
import {connectFlag, getLodop} from "@/api/LodopFuncs";
export default {
name: "Integral",
@ -595,11 +595,6 @@ import {getLodop} from "@/api/LodopFuncs";
// })
// }
console.log("111",data.markPurchases)
console.log("222",data.remainingInventory)
console.log("333",data)
if (data.markPurchases) {
if (data.markPurchases>=data.remainingInventory){
this.$message.error('库存不足');
@ -878,6 +873,7 @@ import {getLodop} from "@/api/LodopFuncs";
}
}else if (data.exchangeMethod =='积分+加钱购') {
let exchange = new BigNumber(data.exchangePoints);
let mark = new BigNumber(data.markPurchases);
let exchangePoints_sum = exchange.multipliedBy(mark);
@ -904,6 +900,7 @@ import {getLodop} from "@/api/LodopFuncs";
this.$set(data, "totalPoints_sum", exchangePoints_sum+"积分"+"+"+moneyRatio_sum+"");
}
console.log("data积分",data)
}
},
//
@ -937,6 +934,7 @@ import {getLodop} from "@/api/LodopFuncs";
let integralOrdersList = []
if (this_.shoppingCart.length >0) {
//
console.log("this_.shoppingCart",this_.shoppingCart)
this_.shoppingCart.forEach(res =>{
let integralOrders = {
userId : this_.member.id,
@ -1040,6 +1038,9 @@ import {getLodop} from "@/api/LodopFuncs";
this.authCode = '';
},
async printLocally(data) {
if (!connectFlag){
return
}
//
let LODOP = getLodop(); //
LODOP.PRINT_INIT();