# Conflicts:
#	fuintBackend/fuint-application/src/main/java/com/fuint/business/printer/template/PrintIntegralReport.java
This commit is contained in:
DESKTOP-369JRHT\12997 2024-06-06 11:56:42 +08:00
commit 34854109bf
10 changed files with 64 additions and 102 deletions

View File

@ -32,13 +32,13 @@
<!-- 列表信息--> <!-- 列表信息-->
<el-card style="margin-top: 20px" > <el-card style="margin-top: 20px" >
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleAdd" @click="handleAdd"
>新增二维码</el-button> >新增二维码</el-button>
</el-col> </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>--> <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row> </el-row>
@ -46,12 +46,12 @@
<el-table-column type="index" width="80" align="center" label="序号"/> <el-table-column type="index" width="80" align="center" label="序号"/>
<el-table-column label="二维码SN号" align="center" prop="tagCodeSn" /> <el-table-column label="二维码SN号" align="center" prop="tagCodeSn" />
<el-table-column label="码牌SN号" align="center" prop="snCode" /> <el-table-column label="码牌SN号" align="center" prop="snCode" />
<el-table-column label="是否绑定员工" align="center" prop="mtStatus" width="110"> <!-- <el-table-column label="是否绑定员工" align="center" prop="mtStatus" width="110">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.mtStatus == 1"></span> <span v-if="scope.row.mtStatus == 1"></span>
<span v-else></span> <span v-else></span>
</template> </template>
</el-table-column> </el-table-column>-->
<el-table-column label="绑定员工" align="center" prop="staffName"></el-table-column> <el-table-column label="绑定员工" align="center" prop="staffName"></el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="150"/> <el-table-column label="创建时间" align="center" prop="createTime" width="150"/>

View File

@ -434,7 +434,9 @@ public class FyPayServiceImpl implements FyPayService {
} }
if (!reqMap.get("trans_stat").equals("USERPAYING")) { if (!reqMap.get("trans_stat").equals("USERPAYING")) {
this.insertAllOrderInfo(receiveParameter, payStatus,discountAmount); String payChannel = "cashier";
if (ObjectUtil.isNotEmpty(map1.get("payChannel"))) payChannel = map1.get("payChannel");
this.insertAllOrderInfo(receiveParameter, payStatus,discountAmount,payChannel);
} }
if (ObjectUtil.isNotEmpty(merchantConfig)) { if (ObjectUtil.isNotEmpty(merchantConfig)) {
@ -569,7 +571,7 @@ public class FyPayServiceImpl implements FyPayService {
/** /**
* 添加所有订单信息 * 添加所有订单信息
*/ */
private void insertAllOrderInfo(ReceiveParameter receiveParameter, String payStatus,Double discountAmount) { private void insertAllOrderInfo(ReceiveParameter receiveParameter, String payStatus,Double discountAmount,String payChannel) {
AllOrderInfo allOrderInfo = new AllOrderInfo(); AllOrderInfo allOrderInfo = new AllOrderInfo();
allOrderInfo.setOrderNo(receiveParameter.getOrderNo()); allOrderInfo.setOrderNo(receiveParameter.getOrderNo());
allOrderInfo.setType(receiveParameter.getType()); allOrderInfo.setType(receiveParameter.getType());
@ -578,7 +580,7 @@ public class FyPayServiceImpl implements FyPayService {
allOrderInfo.setPayMoney(receiveParameter.getGoodsMoney()); allOrderInfo.setPayMoney(receiveParameter.getGoodsMoney());
allOrderInfo.setPayType(receiveParameter.getPayType()); allOrderInfo.setPayType(receiveParameter.getPayType());
allOrderInfo.setUserId(receiveParameter.getUserId()); allOrderInfo.setUserId(receiveParameter.getUserId());
allOrderInfo.setPayChannel("cashier"); allOrderInfo.setPayChannel(payChannel);
allOrderInfo.setStatus(payStatus); allOrderInfo.setStatus(payStatus);
allOrderInfo.setDiscountAmount(discountAmount); allOrderInfo.setDiscountAmount(discountAmount);
if (payStatus.equals("paid")) { if (payStatus.equals("paid")) {
@ -749,7 +751,7 @@ public class FyPayServiceImpl implements FyPayService {
BeanUtils.copyProperties(receiveParameterPos, receiveParameter); BeanUtils.copyProperties(receiveParameterPos, receiveParameter);
Double discountAmount = 0.0; Double discountAmount = 0.0;
if (ObjectUtil.isNotEmpty(oilOrder)) discountAmount = oilOrder.getDiscountAmount(); if (ObjectUtil.isNotEmpty(oilOrder)) discountAmount = oilOrder.getDiscountAmount();
this.insertAllOrderInfo(receiveParameter, receiveParameterPos.getPayType(),discountAmount); this.insertAllOrderInfo(receiveParameter, receiveParameterPos.getPayType(),discountAmount,"POS");
if (reqMap.get("trans_stat").equals("SUCCESS")) { if (reqMap.get("trans_stat").equals("SUCCESS")) {
payStatus = "paid"; payStatus = "paid";
if (!ObjectUtil.isEmpty(oilOrder)) { if (!ObjectUtil.isEmpty(oilOrder)) {

View File

@ -1246,6 +1246,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
UserBalance balance = userBalanceService.selectUserBalance(userId, store.getChainStoreId()); UserBalance balance = userBalanceService.selectUserBalance(userId, store.getChainStoreId());
// 根据用户id查询用户信息 // 根据用户id查询用户信息
LJUserVo userVo1 = userService.selectUserById(userId, storeId); LJUserVo userVo1 = userService.selectUserById(userId, storeId);
if (ObjectUtil.isEmpty(userVo1)){
res.put("error", "当前会员不存在!");
return res;
}
// 根据日期生成订单信息 // 根据日期生成订单信息
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");

View File

@ -34,6 +34,7 @@ public class PrintIntegralReport {
for (Map<String, Object> stringStringMap : o) { for (Map<String, Object> stringStringMap : o) {
sb.append("<tr><td>"+stringStringMap.get("giftName")+"</td>"); sb.append("<tr><td>"+stringStringMap.get("giftName")+"</td>");
sb.append("<td>"+((ObjectUtil.isNotEmpty(stringStringMap.get("markPurchases")))?stringStringMap.get("markPurchases").toString():"0")+"</td>"); sb.append("<td>"+((ObjectUtil.isNotEmpty(stringStringMap.get("markPurchases")))?stringStringMap.get("markPurchases").toString():"0")+"</td>");
sb.append("<td>"+ stringStringMap.get("price")+"</td></tr>"); sb.append("<td>"+ stringStringMap.get("price")+"</td></tr>");
} }
sb.append("</table>"); sb.append("</table>");

View File

@ -49,6 +49,9 @@ public class TagCodeRecordController extends BaseController {
@Resource @Resource
private OilTagService oilTagService; private OilTagService oilTagService;
@Resource
private TagCodeService tagCodeService;
@Resource @Resource
private ILJStaffService mtStaffService; private ILJStaffService mtStaffService;
@ -80,6 +83,18 @@ public class TagCodeRecordController extends BaseController {
tagCodeRecord.setId(tagCodeRecordDTO.getId()); tagCodeRecord.setId(tagCodeRecordDTO.getId());
tagCodeRecord.setStaffId(tagCodeRecordDTO.getStaffId()); tagCodeRecord.setStaffId(tagCodeRecordDTO.getStaffId());
tagCodeRecord.setStaffName(ljStaff.getRealName()); tagCodeRecord.setStaffName(ljStaff.getRealName());
TagCodeRecord tagCodeRecord1 = tagCodeRecordService.getById(tagCodeRecordDTO.getId());
OilTag oilTag = oilTagService.getById(tagCodeRecord1.getOilTagId());
TagCode tagCode = tagCodeService.selectByTagCodeSn(oilTag.getTagCodeSn());
String collection = tagCode.getCollection();
if(collection.contains("staffId")){
String[] split = collection.split("&staffId");
collection = split[0]+"&staffId="+tagCodeRecordDTO.getStaffId();
}else {
collection = collection+"&staffId="+tagCodeRecordDTO.getStaffId();
}
tagCode.setCollection(collection);
tagCodeService.updateById(tagCode);
return getSuccessResult(this.tagCodeRecordService.updateById(tagCodeRecord)); return getSuccessResult(this.tagCodeRecordService.updateById(tagCodeRecord));
} }
// 一键解绑 // 一键解绑
@ -185,8 +200,6 @@ public class TagCodeRecordController extends BaseController {
return getSuccessResult("该员工暂未绑定码牌!"); return getSuccessResult("该员工暂未绑定码牌!");
} }
@Resource
private TagCodeService tagCodeService;
/** /**
* 码牌与油站解绑 * 码牌与油站解绑
* *

View File

@ -20,5 +20,7 @@ public interface TagCodeService extends IService<TagCode> {
ResponseEntity<InputStreamResource> add(TagCodeDTO tagCodeDTO, HttpServletRequest request, HttpServletResponse response) throws Exception; ResponseEntity<InputStreamResource> add(TagCodeDTO tagCodeDTO, HttpServletRequest request, HttpServletResponse response) throws Exception;
ResponseEntity<InputStreamResource> exportZip(TagCodeDTO tagCodeDTO, HttpServletRequest request, HttpServletResponse response) throws Exception; ResponseEntity<InputStreamResource> exportZip(TagCodeDTO tagCodeDTO, HttpServletRequest request, HttpServletResponse response) throws Exception;
TagCode selectByTagCodeSn(String tagCodeSn);
} }

View File

@ -59,6 +59,9 @@ public class TagCodeServiceImpl extends ServiceImpl<TagCodeMapper, TagCode> impl
@Autowired @Autowired
private BackendFileController backendFileController; private BackendFileController backendFileController;
@Autowired
private TagCodeMapper tagCodeMapper;
@Override @Override
@Transactional @Transactional
public ResponseEntity<InputStreamResource> add(TagCodeDTO tagCodeDTO, HttpServletRequest request, HttpServletResponse response) throws Exception { public ResponseEntity<InputStreamResource> add(TagCodeDTO tagCodeDTO, HttpServletRequest request, HttpServletResponse response) throws Exception {
@ -165,80 +168,14 @@ public class TagCodeServiceImpl extends ServiceImpl<TagCodeMapper, TagCode> impl
return ResponseEntity.ok() return ResponseEntity.ok()
.body(new InputStreamResource(zipInputStream)); .body(new InputStreamResource(zipInputStream));
// boolean flag = false; }
// if (ObjectUtils.isNotEmpty(tagCodeDTO) && ObjectUtils.isNotEmpty(tagCodeDTO.getTotal())){
// int total = tagCodeDTO.getTotal();
// Random random1 = new Random();
// int i2 = random1.nextInt(1000);
// for (int i = 0; i < total; i++) {
// Random random = new Random();
// int i1 = random.nextInt(90000000);
// //String url = "https://oil.youkerr.com/";
// String url = "https://www.tuofeng.cc/oilRefuel?sn=byx"+i1;
// // String finalPath="/temp/qrCode/" + oilTag.getSnCode() + ".jpg";
// //String finalPath="D:\\office\\document\\photos\\tagCode\\"+"str"+i+".jpg";
// //String finalPath="/temp/tagCode/" + "byx"+i1 + ".jpg";
// //String finalPath="/temp/tagCode/"+ DateUtil.formatDate(new Date(), "yyyyMMdd") + "/"+i2 + "byx"+i1 + ".jpg";
//
// TagCode tagCode = new TagCode();
//
// tagCode.setCollection(url);
// tagCode.setTagCodeSn("byx"+i1);
// tagCode.setDeptId(Integer.parseInt(nowAccountInfo.getDeptId().toString()));
//
// //在图片上生成二维码
// String backgroundImage = "static/qrCodeImg/huanyingguanglin.jpg";
// InputStream backgroundStream = this.getClass().getClassLoader().getResourceAsStream(backgroundImage);
// String urls = "";
// urls = "/temp/tagCode/"+ DateUtil.formatDate(new Date(), "yyyyMMdd") + "-"+i2;
// File file1 = new File(urls);
// // String finalPath="/temp/tagCode/" + "byx"+i1 + ".jpg";
// String finalPath=urls+"/" + "byx"+i1 + ".jpg";
// qrCodeUtils.createLogoCodePictures(null, url, finalPath, null,null,urls);
//
//
// // 判断目录是否存在
// if (!file1.exists()) {
// file1.mkdirs();
// }
//
// File file =new File(finalPath);
// FileInputStream fileInputStream =new FileInputStream(file);
// // FileInputStream fileInputStream =new FileInputStream(file1);
// MultipartFile resFile = new MockMultipartFile("file", file.getName(), null, fileInputStream);
//// 返回图片路径
// String saveFile = backendFileController.saveFile(resFile);
// //return saveFile;
// tagCode.setImageUrl(saveFile);
// flag = save(tagCode);
// }
//
// //导出码牌
// //String IMAGE_DIRECTORY = "D:\\temp\\tagCode\\"+DateUtil.formatDate(new Date(), "yyyyMMdd")+"-"+i2;
// String IMAGE_DIRECTORY = "/temp/tagCode/"+DateUtil.formatDate(new Date(), "yyyyMMdd")+"-"+i2;
//
// List<File> imageFiles = getImageFiles(IMAGE_DIRECTORY);
// InputStream zipInputStream = createZipInputStream(imageFiles);
//
// response.setHeader("Content-Disposition", "attachment; filename=\"images.zip\"");
//
// return ResponseEntity.ok()
// .body(new InputStreamResource(zipInputStream));
// }else {
// InputStream inputStream = new InputStream() {
// @Override
// public int read() throws IOException {
// return 0;
// }
// };
// return ResponseEntity.ok()
// .body(new InputStreamResource(inputStream));
// }
//String IMAGE_DIRECTORY = "D:\\temp\\qrCode\\DateUtil.formatDate(new Date(), \"yyyyMMdd\") +";
@Override
public TagCode selectByTagCodeSn(String tagCodeSn) {
LambdaQueryWrapper<TagCode> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TagCode::getTagCodeSn, tagCodeSn);
TagCode tagCodes = tagCodeMapper.selectOne(queryWrapper);
return tagCodes;
} }
private List<File> getImageFiles(String directory) { private List<File> getImageFiles(String directory) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -195,10 +195,10 @@
</div> </div>
<div class="bottom-posi"> <div class="bottom-posi">
<div class="center-left-wrap"> <div class="center-left-wrap">
<div class="wrap-box" value="oilCard" <!-- <div class="wrap-box" value="oilCard"
:class="{ 'wrap-box2': 'oilCard' == payType }" > :class="{ 'wrap-box2': 'oilCard' == payType }" >
<span @click="payMethod('oilCard')">囤油卡</span> <span @click="payMethod('oilCard')">囤油卡</span>
</div> </div>-->
<div class="wrap-box" value="balance" <div class="wrap-box" value="balance"
:class="{ 'wrap-box2': 'balance' == payType }" > :class="{ 'wrap-box2': 'balance' == payType }" >
<span @click="payMethod('balance')">储值卡</span> <span @click="payMethod('balance')">储值卡</span>
@ -218,7 +218,7 @@
<div class="center-left-bottom"> <div class="center-left-bottom">
<div> <div>
<div class="bottom-price">{{ ((+oilActualPay) + (+goodsActualPay)).toFixed(2) }}</div> <div class="bottom-price">{{ ((+oilActualPay) + (+goodsActualPay)).toFixed(2) }}</div>
<div class="price-red">优惠合计{{ (oilDiscount + goodsDiscount + fullReduction + couponAmount).toFixed(2) }}/{{consumeRefuelMoney.toFixed(2)}}L</div> <div class="price-red">优惠合计{{ (oilDiscount + goodsDiscount + fullReduction + couponAmount).toFixed(2) }}<!--/{{consumeRefuelMoney.toFixed(2)}}L--></div>
</div> </div>
<el-button class="center-left-lv" :disabled="(oilAmount + goodsAmount)==0" @click="settlement">立即结算</el-button> <el-button class="center-left-lv" :disabled="(oilAmount + goodsAmount)==0" @click="settlement">立即结算</el-button>
</div> </div>
@ -1126,7 +1126,7 @@
<div v-else-if="payType == 'ALIPAY'">支付宝</div> <div v-else-if="payType == 'ALIPAY'">支付宝</div>
<div v-else-if="payType == 'UNIONPAY'">银联二维码</div> <div v-else-if="payType == 'UNIONPAY'">银联二维码</div>
<div v-else-if="payType == 'credit'">挂账</div> <div v-else-if="payType == 'credit'">挂账</div>
<div v-else-if="payType == 'oilCard'">囤油卡</div> <!-- <div v-else-if="payType == 'oilCard'">囤油卡</div>-->
<div v-else-if="payType == 'balance'">储值卡</div> <div v-else-if="payType == 'balance'">储值卡</div>
<div v-else>小程序码</div> <div v-else>小程序码</div>
</div> </div>
@ -1147,10 +1147,10 @@
<div>储值卡付款</div> <div>储值卡付款</div>
<div>{{ consumeAmount }}</div> <div>{{ consumeAmount }}</div>
</div> </div>
<div class="input-box" v-if="isMember && consumeRefuelMoney>0"> <!-- <div class="input-box" v-if="isMember && consumeRefuelMoney>0">
<div>囤油卡付款</div> <div>囤油卡付款</div>
<div>{{ consumeRefuelMoney.toFixed(2) }}</div> <div>{{ consumeRefuelMoney.toFixed(2) }}</div>
</div> </div>-->
<div class="input-box"> <div class="input-box">
<div>实付款</div> <div>实付款</div>
<div v-if="payType == 'credit'">0.00</div> <div v-if="payType == 'credit'">0.00</div>
@ -1926,6 +1926,7 @@
this_.isQuery = false; this_.isQuery = false;
clearInterval(timer); clearInterval(timer);
} }
await this_.getMemberAfter();
} }
}) })
}, 1000); }, 1000);
@ -3166,15 +3167,15 @@
}) })
this.goodsActualPay = this.goodsAmount - this.goodsDiscount; this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
}, },
getOilCoupon(){ async getOilCoupon() {
let type = 0; let type = 0;
// if (this.consumeAmount==0){ // if (this.consumeAmount==0){
if (this.consumeRefuelMoney>0){ if (this.consumeRefuelMoney > 0) {
type = 1; type = 1;
}else { } else {
if (this.consumeAmount>0){ if (this.consumeAmount > 0) {
type = 0; type = 0;
}else { } else {
type = 2; type = 2;
} }
} }
@ -3191,12 +3192,12 @@
this.paymentActive.mtUserLevel = this.member.gradeId this.paymentActive.mtUserLevel = this.member.gradeId
this.paymentActive.userId = this.member.id this.paymentActive.userId = this.member.id
let _this = this let _this = this
this.oilOrder.forEach(item => { for (const item of this.oilOrder) {
_this.paymentActive.amount = item.amount _this.paymentActive.amount = item.amount
_this.paymentActive.oilId = item.oilName _this.paymentActive.oilId = item.oilName
_this.paymentActive.storeId = item.storeId _this.paymentActive.storeId = item.storeId
getPaymentActive(_this.paymentActive).then(async res => { await getPaymentActive(_this.paymentActive).then(async res => {
item.activeId = res.data.activeId item.activeId = res.data.activeId
item.type = res.data.type item.type = res.data.type
let discount = { type: "", discount: 0, oilName: item.oilName, gunName: item.gunName } let discount = { type: "", discount: 0, oilName: item.oilName, gunName: item.gunName }
@ -3235,7 +3236,7 @@
} }
} }
// } // }
console.log(_this.oilDiscount, 111) console.log(_this.oilDiscount, _this.couponAmount, _this.fullReduction, 3239)
this.countAmountFull() this.countAmountFull()
if (this.isOilStorageCard) { if (this.isOilStorageCard) {
await this.countAmountFull() await this.countAmountFull()
@ -3247,7 +3248,7 @@
await this.countAmountFull() await this.countAmountFull()
} }
}) })
}) }
}, },
// //
getCoupon(){ getCoupon(){
@ -3876,6 +3877,7 @@
}, },
// //
changeRefuelMoney(){ changeRefuelMoney(){
this.isOilStorageCard = false
getRecord({mtUserId:this.member.id}).then(res => { getRecord({mtUserId:this.member.id}).then(res => {
this.oilCardAmount = 0 this.oilCardAmount = 0
let oilAmount = 0 let oilAmount = 0
@ -3888,7 +3890,7 @@
if (item.oilName==i.oilType){ if (item.oilName==i.oilType){
item.lockupPrice = i.lockupPrice item.lockupPrice = i.lockupPrice
amount = item.lockupPrice * item.liters amount = item.lockupPrice * item.liters
this.isOilStorageCard = true if (amount>0) this.isOilStorageCard = true
flag = false flag = false
}else { }else {
flag = true flag = true
@ -3898,6 +3900,7 @@
if (flag) amount = item.amount if (flag) amount = item.amount
oilAmount += amount oilAmount += amount
}) })
console.log("3903", this.isOilStorageCard)
if (oilAmount>0) this.oilCardAmount = this.oilAmount - oilAmount if (oilAmount>0) this.oilCardAmount = this.oilAmount - oilAmount
this.countAmountFull() this.countAmountFull()
}) })

View File

@ -56,9 +56,9 @@
<view style="width: 100%;display: flex;align-items: center;justify-content: space-between; "> <view style="width: 100%;display: flex;align-items: center;justify-content: space-between; ">
<view class="bai-box"> <view class="bai-box">
<view class="title-card">电子囤油卡</view> <view class="title-card">电子囤油卡</view>
<view class="">{{cardsList[cardsIndex].type || '暂无囤油'}}:{{cardsList[cardsIndex].refuelMoney || '0'}}L <!-- <view class="">{{cardsList[cardsIndex].type || '暂无囤油'}}:{{cardsList[cardsIndex].refuelMoney || '0'}}L
</view> </view>
<view>剩余油量{{cardsList[cardsIndex].refuelMoney || '0'}}L</view> <view>剩余油量{{cardsList[cardsIndex].refuelMoney || '0'}}L</view> -->
<!-- <view style="lins"> **** **** **** 970 </view> --> <!-- <view style="lins"> **** **** **** 970 </view> -->
</view> </view>
<!-- <view class=""> <!-- <view class="">
@ -176,7 +176,7 @@
console.log(res) console.log(res)
if (res.code == 200) { if (res.code == 200) {
this.cardsList = res.data.records this.cardsList = res.data.records
console.log(this.toil,111,res); console.log(this.toil, 111, res);
} }
}) })
}, },