Merge remote-tracking branch 'origin/master'

This commit is contained in:
@QQNZX 2023-11-22 17:05:16 +08:00
commit 64ee2829d3
22 changed files with 187 additions and 84 deletions

View File

@ -64,7 +64,7 @@
<el-tag v-if ="scope.row.status == 'await'" size="medium">待审核</el-tag> <el-tag v-if ="scope.row.status == 'await'" size="medium">待审核</el-tag>
<el-tag v-if ="scope.row.status == 'qrts'" type="success" size="medium">已审核入库</el-tag> <el-tag v-if ="scope.row.status == 'qrts'" type="success" size="medium">已审核入库</el-tag>
<el-tag v-if ="scope.row.status == 'yzf'" type="danger" size="medium">已作废</el-tag> <el-tag v-if ="scope.row.status == 'yzf'" type="danger" size="medium">已作废</el-tag>
<el-tag v-if ="scope.row.status == 'ysh'" type="danger" size="medium">已审核</el-tag> <el-tag v-if ="scope.row.status == 'ysh'" type="success" size="medium">已审核</el-tag>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -84,7 +84,8 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="dispose(scope.row)" @click="dispose(scope.row)"
>处理单据</el-button> >{{ scope.row.status == 'ysh'?'查看单据':'处理单据' }}
</el-button>
<!-- <el-button--> <!-- <el-button-->
<!-- size="mini"--> <!-- size="mini"-->
<!-- type="text"--> <!-- type="text"-->

View File

@ -92,12 +92,12 @@
<el-table-column label="当前库存升数(L)" align="center" prop="currentInventoryVolume"/> <el-table-column label="当前库存升数(L)" align="center" prop="currentInventoryVolume"/>
<el-table-column label="盘点升数(L)" align="center" prop="inventoryVolume"> <el-table-column label="盘点升数(L)" align="center" prop="inventoryVolume">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number :disabled="numberInput" v-model="scope.row.inventoryVolume" @change="change(scope.row)" controls-position="right" :min="0" :max="100000000" :step="1" style="max-width: 100%"></el-input-number> <el-input-number :disabled="numberInput" v-model="scope.row.inventoryVolume" @change="change(scope.row)" controls-position="right" :min="0" :max="100000000" :step="1" :precision="2" style="max-width: 100%"></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="库存差异升数(L)" align="center" prop="stockDifference"/> <el-table-column label="库存差异升数(L)" align="center" prop="stockDifference"/>
<el-table-column label="盈亏金额" align="center" prop="profitLossAmount"/> <el-table-column label="盈亏金额" align="center" prop="profitLossAmount"/>
<el-table-column v-if="state =='await' || state=='ysh'" label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column v-if="state =='await'" label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -180,13 +180,6 @@
import { import {
getSuppliersListApi2, getSuppliersListApi2,
} from "@/api/oilConfig/oilSuppliers"; } from "@/api/oilConfig/oilSuppliers";
// import {
// editPurchuseApi,
// insertPurchaseApi,
// insertPurchaseOrderApi,
// updatePurchaseOrderApi,
// updatePurchaseApi, storageApi, abolitionApi, auditApi
// } from "@/api/oilConfig/oilPurchase";
import { import {
editInventoryApi, editInventoryApi,
@ -211,7 +204,6 @@ export default {
return { return {
orderList:[], orderList:[],
orderForm:{ orderForm:{
id: null, id: null,
purchaseId: null, purchaseId: null,
@ -239,13 +231,11 @@ export default {
state: 'await', state: 'await',
numberInput: false, numberInput: false,
numberOfTanks: 0, // numberOfTanks: 0, //
inventoryVolume: 0, // inventoryVolume: 0, //
stockDifference: 0, // stockDifference: 0, //
profitLossAmount: 0,// profitLossAmount: 0,//
tankList:[], // tankList:[], //
tankForm: { tankForm: {
numberId:'', numberId:'',
@ -254,15 +244,9 @@ export default {
inventoryId:'', // id inventoryId:'', // id
selectOilTypeByPrice: [], // selectOilTypeByPrice: [], //
multipleSelection: [], multipleSelection: [],
numberList:[], numberList:[],
suppliersList:[], suppliersList:[],
@ -398,20 +382,25 @@ export default {
} }
}) })
}, },
// //
change(data) { change(data) {
// new BigNumber // //
console.log("data",data) // data.stockDifference = data.inventoryVolume - data.currentInventoryVolume
// //
// data.profitLossAmount = data.stockDifference * data.currentAveragePrice
// //
data.stockDifference = data.inventoryVolume - data.currentInventoryVolume const stockDifference = new BigNumber(data.inventoryVolume).minus(data.currentInventoryVolume);
// //
data.profitLossAmount = data.stockDifference * data.currentAveragePrice const profitLossAmount = stockDifference.times(data.currentAveragePrice).decimalPlaces(2).toNumber();
// data
data.stockDifference = stockDifference.toNumber();
data.profitLossAmount = profitLossAmount;
this.sumMethod(this.orderList) this.sumMethod(this.orderList)
}, },
// //
inquireTank() { inquireTank() {
this.getTankList()/**/ this.getTankList()/**/
@ -421,14 +410,12 @@ export default {
this.getTankList() this.getTankList()
// this.selectTankByNumber(this.orderForm.numberId); // this.selectTankByNumber(this.orderForm.numberId);
}, },
//
getTankList() { getTankList() {
selectList2Api(this.tankForm).then(response => { selectList2Api(this.tankForm).then(response => {
this.tankList = response.data this.tankList = response.data
console.log("this.tankList",this.tankList)
}) })
}, },
// //
orderAdd() { orderAdd() {
// //
@ -440,18 +427,20 @@ export default {
// //
addOrder () { addOrder () {
let this_ = this let this_ = this
//
this_.tankList = []
this_.tankForm = {}
this.multipleSelection.forEach(mul=>{ this.multipleSelection.forEach(mul=>{
const isDuplicate = false let isDuplicate = false
if (this.orderList.length > 0) { if (this.orderList.length > 0) {
isDuplicate = this.orderList.some(order => order.tankId === mul.id); isDuplicate = this.orderList.some(order => order.tankId === mul.id);
} }
if (isDuplicate || isDuplicate == '') { if (isDuplicate) {
console.log("isDuplicate222") console.log("isDuplicate222")
this.$message({ this.$message({
message: '油罐已经存在,请重新选择', message: '有重复油罐油罐,请重新选择',
type: 'warning' type: 'warning'
}); });
this.multipleSelection = [] this.multipleSelection = []
@ -481,11 +470,7 @@ export default {
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
// dom
orderDel(data) { orderDel(data) {
if (data.id != null) { if (data.id != null) {
delInventoryOrderApi(data).then(res=>{ delInventoryOrderApi(data).then(res=>{
@ -583,8 +568,6 @@ export default {
// //
saveInventory(){ saveInventory(){
let this_ = this let this_ = this
if (this_.inventoryNo.inventoryNo == null){ if (this_.inventoryNo.inventoryNo == null){
this.$modal.msgSuccess("请先填写盘点号"); this.$modal.msgSuccess("请先填写盘点号");
@ -599,7 +582,6 @@ export default {
return -1; return -1;
} }
let inventoryForm = { let inventoryForm = {
inventoryNumber : this_.inventoryNo.inventoryNo, inventoryNumber : this_.inventoryNo.inventoryNo,
inventoryTime : this_.inventoryNo.inventoryDate, inventoryTime : this_.inventoryNo.inventoryDate,
@ -718,18 +700,21 @@ export default {
if (judgmentPermissions1 > 0){ if (judgmentPermissions1 > 0){
this.auditFlag=false, this.auditFlag=false,
this.voidFlag=false this.voidFlag=false
}else {
this.auditFlag=true,
this.voidFlag=true
} }
let judgmentPermissions2 = await this.judgmentPermissions("盘点入库"); let judgmentPermissions2 = await this.judgmentPermissions("盘点入库");
if (judgmentPermissions2 > 0){ if (judgmentPermissions2 > 0){
this.storageFlag = false this.storageFlag = false
}else {
this.storageFlag = true
} }
let judgmentPermissions3 = await this.judgmentPermissions("盘点废止"); let judgmentPermissions3 = await this.judgmentPermissions("盘点废止");
if (judgmentPermissions3 > 0){ if (judgmentPermissions3 > 0){
this.voidFlag=false this.voidFlag=false
}else { }else {
this.voidFlag=true this.voidFlag=true
} }
}, },
@ -743,7 +728,6 @@ export default {
}); });
}, },
// //
audit(){ audit(){
// //
@ -755,9 +739,13 @@ export default {
} }
console.log(" id: this.purchaseId",fil) console.log(" id: this.purchaseId",fil)
auditInventoryApi(fil).then(res => { auditInventoryApi(fil).then(res => {
this.state = 'ysh' if (res.data) {
this.$modal.msgWarning("审核成功"); this.state = 'ysh'
this.goToAbout() this.$modal.msgSuccess("审核成功");
this.goToAbout()
} else {
this.$modal.msgWarning("暂无审核权限");
}
}) })
} }
}, },

View File

@ -103,6 +103,7 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
if(ObjectUtils.isNotEmpty(activeConsumption.getIsonline())) { if(ObjectUtils.isNotEmpty(activeConsumption.getIsonline())) {
queryWrapper.eq(ActiveConsumption::getIsonline,activeConsumption.getIsonline()); queryWrapper.eq(ActiveConsumption::getIsonline,activeConsumption.getIsonline());
} }
queryWrapper.eq(ActiveConsumption::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
queryWrapper.orderByDesc(ActiveConsumption::getCreateTime); queryWrapper.orderByDesc(ActiveConsumption::getCreateTime);
IPage page1 = page(page, queryWrapper); IPage page1 = page(page, queryWrapper);
//会员等级 //会员等级

View File

@ -104,6 +104,7 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
if(ObjectUtils.isNotEmpty(activeDiscount.getIsonline())) { if(ObjectUtils.isNotEmpty(activeDiscount.getIsonline())) {
queryWrapper.eq(ActiveDiscount::getIsonline,activeDiscount.getIsonline()); queryWrapper.eq(ActiveDiscount::getIsonline,activeDiscount.getIsonline());
} }
queryWrapper.eq(ActiveDiscount::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
queryWrapper.orderByDesc(ActiveDiscount::getCreateTime); queryWrapper.orderByDesc(ActiveDiscount::getCreateTime);
IPage page1 = page(page, queryWrapper); IPage page1 = page(page, queryWrapper);
//会员等级 //会员等级

View File

@ -1,6 +1,7 @@
package com.fuint.business.marketingActivity.activeExchange.service.impl; package com.fuint.business.marketingActivity.activeExchange.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount; import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild; import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild;
import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscountChildService; import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscountChildService;
@ -155,21 +156,21 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
fullminusLambdaQueryWrapper.eq(ActiveFullminus::getIsonline,0); fullminusLambdaQueryWrapper.eq(ActiveFullminus::getIsonline,0);
fullminusLambdaQueryWrapper.eq(ActiveFullminus::getStatus,0); fullminusLambdaQueryWrapper.eq(ActiveFullminus::getStatus,0);
fullminusLambdaQueryWrapper.orderByDesc(ActiveFullminus::getCreateTime); fullminusLambdaQueryWrapper.orderByDesc(ActiveFullminus::getCreateTime);
//会员等级判断
fullminusLambdaQueryWrapper.in(ActiveFullminus::getDieselUserLevel,userGradeService.selectUserGradeById(transferDTO.getGradeId()).getId());
//符合油号判断
fullminusLambdaQueryWrapper.in(ActiveFullminus::getAdaptOil,transferDTO.getOilName());
List<ActiveFullminus> activeFullminusList = activeFullminusService.list(fullminusLambdaQueryWrapper); List<ActiveFullminus> activeFullminusList = activeFullminusService.list(fullminusLambdaQueryWrapper);
for (ActiveFullminus activeFullminus : activeFullminusList) { for (ActiveFullminus activeFullminus : activeFullminusList) {
MaxoutVO maxoutVO = new MaxoutVO(); MaxoutVO maxoutVO = new MaxoutVO();
BeanUtils.copyProperties(activeFullminus,maxoutVO); // 会员等级判断符合油号判断
LambdaQueryWrapper<ActiveDiscountChild> queryWrappers = new LambdaQueryWrapper<>(); if (activeFullminus.getDieselUserLevel().contains(String.valueOf(userGradeService.selectUserGradeById(transferDTO.getGradeId()).getId())) &&
queryWrappers.eq(ActiveDiscountChild::getActiveFullminusId,activeFullminus.getId()); activeFullminus.getAdaptOil().contains(String.valueOf(transferDTO.getOilName()))){
//判断符合金额 BeanUtils.copyProperties(activeFullminus,maxoutVO);
queryWrappers.le(ActiveDiscountChild::getAmount,transferDTO.getOilPrice() * transferDTO.getOilLiters()); LambdaQueryWrapper<ActiveDiscountChild> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.orderByDesc(ActiveDiscountChild::getAmount); queryWrappers.eq(ActiveDiscountChild::getActiveFullminusId,activeFullminus.getId());
maxoutVO.setActiveDiscountChildList(activeDiscountChildService.list(queryWrappers)); //判断符合金额
maxoutVOArrayList.add(maxoutVO); queryWrappers.le(ActiveDiscountChild::getAmount,transferDTO.getOilPrice() * transferDTO.getOilLiters());
queryWrappers.orderByDesc(ActiveDiscountChild::getAmount);
maxoutVO.setActiveDiscountChildList(activeDiscountChildService.list(queryWrappers));
maxoutVOArrayList.add(maxoutVO);
}
} }
//构造折扣券查询条件 //构造折扣券查询条件
@ -178,22 +179,23 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
discountLambdaQueryWrapper.eq(ActiveDiscount::getIsonline,0); discountLambdaQueryWrapper.eq(ActiveDiscount::getIsonline,0);
discountLambdaQueryWrapper.eq(ActiveDiscount::getStatus,0); discountLambdaQueryWrapper.eq(ActiveDiscount::getStatus,0);
discountLambdaQueryWrapper.orderByDesc(ActiveDiscount::getCreateTime); discountLambdaQueryWrapper.orderByDesc(ActiveDiscount::getCreateTime);
//会员等级判断
discountLambdaQueryWrapper.in(ActiveDiscount::getDieselUserLevel,userGradeService.selectUserGradeById(transferDTO.getGradeId()).getId());
//符合油号判断 //符合油号判断
discountLambdaQueryWrapper.in(ActiveDiscount::getAdaptOil,transferDTO.getOilName());
List<ActiveDiscount> activeDiscountList = activeDiscountService.list(discountLambdaQueryWrapper); List<ActiveDiscount> activeDiscountList = activeDiscountService.list(discountLambdaQueryWrapper);
//获取兑换物品信息 //获取兑换物品信息
for (ActiveDiscount activeDiscount : activeDiscountList) { for (ActiveDiscount activeDiscount : activeDiscountList) {
MaxoutVO maxoutVO = new MaxoutVO(); MaxoutVO maxoutVO = new MaxoutVO();
BeanUtils.copyProperties(activeDiscount,maxoutVO); // 会员等级判断符合油号判断
LambdaQueryWrapper<ActiveDiscountChild> queryWrappers = new LambdaQueryWrapper<>(); if (activeDiscount.getDieselUserLevel().contains(String.valueOf(userGradeService.selectUserGradeById(transferDTO.getGradeId()).getId())) &&
queryWrappers.eq(ActiveDiscountChild::getActiveDiscountId,activeDiscount.getId()); activeDiscount.getAdaptOil().contains(String.valueOf(transferDTO.getOilName()))){
//判断符合金额 BeanUtils.copyProperties(activeDiscount,maxoutVO);
queryWrappers.le(ActiveDiscountChild::getAmount,transferDTO.getOilPrice() * transferDTO.getOilLiters()); LambdaQueryWrapper<ActiveDiscountChild> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.orderByDesc(ActiveDiscountChild::getAmount); queryWrappers.eq(ActiveDiscountChild::getActiveDiscountId,activeDiscount.getId());
maxoutVO.setActiveDiscountChildList(activeDiscountChildService.list(queryWrappers)); //判断符合金额
maxoutVOArrayList.add(maxoutVO); queryWrappers.le(ActiveDiscountChild::getAmount,transferDTO.getOilPrice() * transferDTO.getOilLiters());
queryWrappers.orderByDesc(ActiveDiscountChild::getAmount);
maxoutVO.setActiveDiscountChildList(activeDiscountChildService.list(queryWrappers));
maxoutVOArrayList.add(maxoutVO);
}
} }
return maxoutVOArrayList; return maxoutVOArrayList;
} }

View File

@ -101,6 +101,7 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
if(ObjectUtils.isNotEmpty(activeFullminus.getIsonline())) { if(ObjectUtils.isNotEmpty(activeFullminus.getIsonline())) {
queryWrapper.eq(ActiveFullminus::getIsonline,activeFullminus.getIsonline()); queryWrapper.eq(ActiveFullminus::getIsonline,activeFullminus.getIsonline());
} }
queryWrapper.eq(ActiveFullminus::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
queryWrapper.orderByDesc(ActiveFullminus::getCreateTime); queryWrapper.orderByDesc(ActiveFullminus::getCreateTime);
IPage page1 = page(page, queryWrapper); IPage page1 = page(page, queryWrapper);
//会员等级 //会员等级

View File

@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount; import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild; import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO; import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO;
import com.fuint.business.marketingActivity.activeFullminus.entity.ActiveFullminus;
import com.fuint.business.marketingActivity.activeNewlyweds.controller.vo.ActiveNewlywedsVO; import com.fuint.business.marketingActivity.activeNewlyweds.controller.vo.ActiveNewlywedsVO;
import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsDTO; import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsDTO;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsChild; import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsChild;
@ -90,6 +91,7 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
if(ObjectUtils.isNotEmpty(activeNewlyweds.getIsonline())) { if(ObjectUtils.isNotEmpty(activeNewlyweds.getIsonline())) {
queryWrapper.eq(ActiveNewlyweds::getIsonline,activeNewlyweds.getIsonline()); queryWrapper.eq(ActiveNewlyweds::getIsonline,activeNewlyweds.getIsonline());
} }
queryWrapper.eq(ActiveNewlyweds::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
queryWrapper.orderByDesc(ActiveNewlyweds::getCreateTime); queryWrapper.orderByDesc(ActiveNewlyweds::getCreateTime);
IPage page1 = page(page, queryWrapper); IPage page1 = page(page, queryWrapper);

View File

@ -4,10 +4,12 @@ package com.fuint.business.marketingActivity.activeRecommend.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds;
import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendDTO; import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendDTO;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommend; import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommend;
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendChildService; import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendChildService;
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendService; import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendService;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.BaseController; import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject; import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -46,6 +48,7 @@ public class ActiveRecommendController extends BaseController {
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("cardFuelDiesel") ActiveRecommend activeRecommend) { @Param("cardFuelDiesel") ActiveRecommend activeRecommend) {
Page page = new Page(pageNo, pageSize); Page page = new Page(pageNo, pageSize);
activeRecommend.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
return getSuccessResult(this.activeRecommendService.page(page, new QueryWrapper<>(activeRecommend))); return getSuccessResult(this.activeRecommendService.page(page, new QueryWrapper<>(activeRecommend)));
} }

View File

@ -74,6 +74,7 @@ public class CardExchangeServiceImpl extends ServiceImpl<CardExchangeMapper, Car
if(ObjectUtils.isNotEmpty(cardExchange.getIsonline())) { if(ObjectUtils.isNotEmpty(cardExchange.getIsonline())) {
queryWrapper.eq(CardExchange::getIsonline,cardExchange.getIsonline()); queryWrapper.eq(CardExchange::getIsonline,cardExchange.getIsonline());
} }
queryWrapper.eq(CardExchange::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
queryWrapper.orderByDesc(CardExchange::getCreateTime); queryWrapper.orderByDesc(CardExchange::getCreateTime);
return page(page, queryWrapper); return page(page, queryWrapper);
} }

View File

@ -89,6 +89,7 @@ public class CardFavorableServiceImpl extends ServiceImpl<CardFavorableMapper, C
if(ObjectUtils.isNotEmpty(cardFavorable.getIsonline())) { if(ObjectUtils.isNotEmpty(cardFavorable.getIsonline())) {
queryWrapper.eq(CardFavorable::getIsonline,cardFavorable.getIsonline()); queryWrapper.eq(CardFavorable::getIsonline,cardFavorable.getIsonline());
} }
queryWrapper.eq(CardFavorable::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
queryWrapper.orderByDesc(CardFavorable::getCreateTime); queryWrapper.orderByDesc(CardFavorable::getCreateTime);
return page(page, queryWrapper); return page(page, queryWrapper);
} }

View File

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel; import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel;
import com.fuint.business.marketingActivity.cardFule.service.CardFuelDieselService; import com.fuint.business.marketingActivity.cardFule.service.CardFuelDieselService;
import com.fuint.business.marketingActivity.cardGift.entity.CardGift;
import com.fuint.business.petrolStationManagement.entity.OilName; import com.fuint.business.petrolStationManagement.entity.OilName;
import com.fuint.business.petrolStationManagement.service.OilNameService; import com.fuint.business.petrolStationManagement.service.OilNameService;
import com.fuint.business.store.service.StoreService; import com.fuint.business.store.service.StoreService;
@ -68,7 +69,8 @@ public class CardFuelDieselController extends BaseController {
if(ObjectUtils.isNotEmpty(cardFuelDiesel.getType())) { if(ObjectUtils.isNotEmpty(cardFuelDiesel.getType())) {
queryWrapper.eq(CardFuelDiesel::getType,cardFuelDiesel.getType()); queryWrapper.eq(CardFuelDiesel::getType,cardFuelDiesel.getType());
} }
queryWrapper.orderByDesc(CardFuelDiesel::getCreateTime); queryWrapper.eq(CardFuelDiesel::getStoreId, TokenUtil.getNowAccountInfo().getStoreId());
queryWrapper.orderByDesc(CardFuelDiesel::getCreateTime);
IPage page1 = this.cardFuelDieselService.page(page, queryWrapper); IPage page1 = this.cardFuelDieselService.page(page, queryWrapper);
List<CardFuelDiesel> records = page1.getRecords(); List<CardFuelDiesel> records = page1.getRecords();
//返回囤油卡状态 //返回囤油卡状态

View File

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardGift.entity.CardGift; import com.fuint.business.marketingActivity.cardGift.entity.CardGift;
import com.fuint.business.marketingActivity.cardGift.service.CardGiftService; import com.fuint.business.marketingActivity.cardGift.service.CardGiftService;
import com.fuint.business.marketingActivity.cardValue.entity.CardValue; import com.fuint.business.marketingActivity.cardValue.entity.CardValue;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.BaseController; import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject; import com.fuint.framework.web.ResponseObject;
import com.fuint.utils.ObjectUtil; import com.fuint.utils.ObjectUtil;
@ -61,7 +62,8 @@ public class CardGiftController extends BaseController {
if(ObjectUtils.isNotEmpty(cardGift.getStatus())) { if(ObjectUtils.isNotEmpty(cardGift.getStatus())) {
queryWrapper.eq(CardGift::getStatus,cardGift.getStatus()); queryWrapper.eq(CardGift::getStatus,cardGift.getStatus());
} }
queryWrapper.orderByDesc(CardGift::getCreateTime); queryWrapper.eq(CardGift::getStoreId, TokenUtil.getNowAccountInfo().getStoreId());
queryWrapper.orderByDesc(CardGift::getCreateTime);
return getSuccessResult(this.cardGiftService.page(page, queryWrapper)); return getSuccessResult(this.cardGiftService.page(page, queryWrapper));
} }

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
import com.fuint.business.marketingActivity.cardValue.dto.CardValueDTO; import com.fuint.business.marketingActivity.cardValue.dto.CardValueDTO;
import com.fuint.business.marketingActivity.cardValue.entity.CardValue; import com.fuint.business.marketingActivity.cardValue.entity.CardValue;
import com.fuint.business.marketingActivity.cardValue.entity.CardValueChild; import com.fuint.business.marketingActivity.cardValue.entity.CardValueChild;
@ -65,6 +66,7 @@ public class CardValueController extends BaseController {
if (ObjectUtils.isNotEmpty(cardValue.getIsonline())){ if (ObjectUtils.isNotEmpty(cardValue.getIsonline())){
queryWrapper.eq(CardValue::getIsonline,cardValue.getIsonline()); queryWrapper.eq(CardValue::getIsonline,cardValue.getIsonline());
} }
queryWrapper.eq(CardValue::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
queryWrapper.orderByDesc(CardValue::getCreateTime); queryWrapper.orderByDesc(CardValue::getCreateTime);
IPage page1 = this.cardValueService.page(page, queryWrapper); IPage page1 = this.cardValueService.page(page, queryWrapper);
List<CardValue> records = page1.getRecords(); List<CardValue> records = page1.getRecords();

View File

@ -2,6 +2,7 @@ package com.fuint.business.petrolStationManagement.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.petrolStationManagement.entity.OilInventoryOrder;
import com.fuint.business.petrolStationManagement.entity.OilPurchaseOrder; import com.fuint.business.petrolStationManagement.entity.OilPurchaseOrder;
import com.fuint.business.petrolStationManagement.service.OilPurchaseOrderService; import com.fuint.business.petrolStationManagement.service.OilPurchaseOrderService;
import com.fuint.business.petrolStationManagement.vo.OilPurchaseOrderVO; import com.fuint.business.petrolStationManagement.vo.OilPurchaseOrderVO;
@ -12,6 +13,7 @@ import org.apache.poi.hssf.dev.ReSave;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* (OilPurchaseOrder)表控制层 * (OilPurchaseOrder)表控制层
@ -83,6 +85,16 @@ public class OilPurchaseOrderController extends BaseController {
return getSuccessResult(this.oilPurchaseOrderService.insert(oilPurchaseOrder)); return getSuccessResult(this.oilPurchaseOrderService.insert(oilPurchaseOrder));
} }
/**
* 批量处理数据
* @param oilInventoryOrderList ,@Param("inventoryId") Integer inventoryId
* @return
*/
@PostMapping("disposeBatch")
public ResponseObject disposeBatch(@RequestBody List<OilPurchaseOrder> oilPurchaseOrders) {
return getSuccessResult(this.oilPurchaseOrderService.disposeBatch(oilPurchaseOrders));
}
/** /**
* 编辑数据 * 编辑数据
* *

View File

@ -2,6 +2,7 @@ package com.fuint.business.petrolStationManagement.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.petrolStationManagement.entity.OilInventoryOrder;
import com.fuint.business.petrolStationManagement.entity.OilPurchaseOrder; import com.fuint.business.petrolStationManagement.entity.OilPurchaseOrder;
import com.fuint.business.petrolStationManagement.vo.OilPurchaseOrderVO; import com.fuint.business.petrolStationManagement.vo.OilPurchaseOrderVO;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
@ -64,6 +65,12 @@ public interface OilPurchaseOrderMapper {
*/ */
int insertBatch(@Param("entities") List<OilPurchaseOrder> entities); int insertBatch(@Param("entities") List<OilPurchaseOrder> entities);
/**
* 批量修改该
* @param oilPurchaseOrders
* @return
*/
int updateBatch(@Param("list") List<OilPurchaseOrder> oilPurchaseOrders);
/** /**
* 批量新增或按主键更新数据MyBatis原生foreach方法 * 批量新增或按主键更新数据MyBatis原生foreach方法
* *

View File

@ -163,9 +163,9 @@
and op.inventory_number LIKE CONCAT('%', #{oilInventory.inventoryNumber}, '%') and op.inventory_number LIKE CONCAT('%', #{oilInventory.inventoryNumber}, '%')
</if> </if>
</where> </where>
GROUP BY GROUP BY
op.id op.id
order by op.create_time desc
</select> </select>
<!--新增所有列--> <!--新增所有列-->

View File

@ -226,6 +226,47 @@
where id = #{id} where id = #{id}
</update> </update>
<update id="updateBatch">
<foreach collection="list" item="user" separator=";">
update oil_purchase_order
<set>
<if test="${user.purchaseId != null}">
purchase_id = #{user.purchaseId},
</if>
<if test="${user.numberId != null}">
number_id = #{user.numberId},
</if>
<if test="${user.tankId != null}">
tank_id = #{user.tankId},
</if>
<if test="${user.supplierId != null}">
supplier_id = #{user.supplierId},
</if>
<if test="${user.productDensity != null}">
product_density = #{user.productDensity},
</if>
<if test="${user.purchaseWeight != null}">
purchase_weight = #{user.purchaseWeight},
</if>
<if test="${user.purchasePrice != null}">
purchase_price = #{user.purchasePrice},
</if>
<if test="${user.totalAmount != null}">
total_amount = #{user.totalAmount},
</if>
<if test="${user.purchaseVolume != null}">
purchase_volume = #{user.purchaseVolume},
</if>
<if test="${user.discountedPrice != null}">
discounted_price = #{user.discountedPrice},
</if>
update_time = NOW()
</set>
where id = #{user.id}
</foreach>
</update>
<update id="editPurchuse"> <update id="editPurchuse">
update oil_purchase_order set update oil_purchase_order set
purchase_id = #{purchaseId} purchase_id = #{purchaseId}
@ -238,6 +279,7 @@
where id = #{id} where id = #{id}
</update> </update>
<!--删除--> <!--删除-->
<delete id="delPurchuse"> <delete id="delPurchuse">
delete from oil_purchase_order where purchase_id &lt; 0 and create_time &lt; DATE_SUB(NOW(), INTERVAL 1 DAY); delete from oil_purchase_order where purchase_id &lt; 0 and create_time &lt; DATE_SUB(NOW(), INTERVAL 1 DAY);

View File

@ -402,11 +402,14 @@
</update> </update>
<update id="accumulate2"> <update id="accumulate2">
update oil_tank set update oil_tank <set>
stored_quantity = #{storedQuantity} , stored_quantity = #{storedQuantity} ,
total_price = #{totalPrice}, total_price = #{totalPrice},
update_time = NOW(), update_time = NOW(),
discounted_price = #{discountedPrice} <if test="discountedPrice != null and discountedPrice != ''">
discounted_price = #{discountedPrice}
</if>
</set>
where id = #{id} where id = #{id}
</update> </update>

View File

@ -2,6 +2,7 @@ package com.fuint.business.petrolStationManagement.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.petrolStationManagement.entity.OilInventoryOrder;
import com.fuint.business.petrolStationManagement.entity.OilPurchaseOrder; import com.fuint.business.petrolStationManagement.entity.OilPurchaseOrder;
import com.fuint.business.petrolStationManagement.vo.OilPurchaseOrderVO; import com.fuint.business.petrolStationManagement.vo.OilPurchaseOrderVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -47,6 +48,14 @@ public interface OilPurchaseOrderService {
*/ */
OilPurchaseOrder insert(OilPurchaseOrder oilPurchaseOrder); OilPurchaseOrder insert(OilPurchaseOrder oilPurchaseOrder);
/**
* 批量处理数据
* @param oilInventoryOrder
* @return
*/
int disposeBatch(List<OilPurchaseOrder> oilPurchaseOrders);
/** /**
* 修改数据 * 修改数据
* *

View File

@ -242,7 +242,7 @@ public class OilInventoryOrderServiceImpl implements OilInventoryOrderService {
bigDecimal.multiply(bigDecimal2); bigDecimal.multiply(bigDecimal2);
oilTank.setTotalPrice(bigDecimal.doubleValue()); oilTank.setTotalPrice(bigDecimal.doubleValue());
oilTank.setDiscountedPrice(oilInventoryOrderVO.getCurrentAveragePrice()); // oilTank.setDiscountedPrice(oilInventoryOrderVO.getCurrentAveragePrice());
oilTankMapper.accumulate2(oilTank); oilTankMapper.accumulate2(oilTank);

View File

@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.member.service.ILJStaffService; import com.fuint.business.member.service.ILJStaffService;
import com.fuint.business.member.service.impl.LJStaffServiceImpl; import com.fuint.business.member.service.impl.LJStaffServiceImpl;
import com.fuint.business.petrolStationManagement.entity.OilPurchase; import com.fuint.business.petrolStationManagement.entity.*;
import com.fuint.business.petrolStationManagement.entity.OilPurchaseOrder;
import com.fuint.business.petrolStationManagement.entity.OilTank;
import com.fuint.business.petrolStationManagement.entity.OilTracking;
import com.fuint.business.petrolStationManagement.mapper.OilPurchaseMapper; import com.fuint.business.petrolStationManagement.mapper.OilPurchaseMapper;
import com.fuint.business.petrolStationManagement.mapper.OilPurchaseOrderMapper; import com.fuint.business.petrolStationManagement.mapper.OilPurchaseOrderMapper;
import com.fuint.business.petrolStationManagement.mapper.OilTankMapper; import com.fuint.business.petrolStationManagement.mapper.OilTankMapper;
@ -24,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -99,13 +97,38 @@ public class OilPurchaseOrderServiceImpl implements OilPurchaseOrderService {
*/ */
@Override @Override
public OilPurchaseOrder insert(OilPurchaseOrder oilPurchaseOrder) { public OilPurchaseOrder insert(OilPurchaseOrder oilPurchaseOrder) {
// todo 存储之前判断是否有重复的油罐
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
oilPurchaseOrder.setStoreId(nowAccountInfo.getStoreId()); oilPurchaseOrder.setStoreId(nowAccountInfo.getStoreId());
this.oilPurchaseOrderDao.insert(oilPurchaseOrder); this.oilPurchaseOrderDao.insert(oilPurchaseOrder);
return oilPurchaseOrder; return oilPurchaseOrder;
} }
@Override
public int disposeBatch(List<OilPurchaseOrder> oilPurchaseOrders) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
List<OilPurchaseOrder> insPurchase = new ArrayList<>();
List<OilPurchaseOrder> updatePurchase = new ArrayList<>();
if (oilPurchaseOrders.size()>0) {
for (OilPurchaseOrder oilPurchaseOrder : oilPurchaseOrders) {
if (oilPurchaseOrder.getId() != null) {
updatePurchase.add(oilPurchaseOrder);
}else {
oilPurchaseOrder.setStoreId(nowAccountInfo.getStoreId());
oilPurchaseOrder.setUpdateBy(nowAccountInfo.getStaffId().toString());
insPurchase.add(oilPurchaseOrder);
}
}
if (insPurchase.size()>0) {
oilPurchaseOrderDao.insertBatch(insPurchase);
}
if (updatePurchase.size()>0) {
int i = oilPurchaseOrderDao.updateBatch(updatePurchase);
}
}
return 0;
}
/** /**
* 修改数据 * 修改数据
* *

View File

@ -60,7 +60,7 @@ public class SysDictDataController extends BaseController
@GetMapping(value = "/type/{dictType}") @GetMapping(value = "/type/{dictType}")
public ResponseObject dictType(@PathVariable String dictType) public ResponseObject dictType(@PathVariable String dictType)
{ {
System.out.println("ddddd"+dictType); // System.out.println("ddddd"+dictType);
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
if (CollectionUtils.isEmpty(data)) if (CollectionUtils.isEmpty(data))
{ {