# 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-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
@click="handleAdd"
>新增二维码</el-button>
</el-col>
</el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row>
@ -46,12 +46,12 @@
<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="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">
<span v-if="scope.row.mtStatus == 1"></span>
<span v-else></span>
</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="createTime" width="150"/>

View File

@ -434,7 +434,9 @@ public class FyPayServiceImpl implements FyPayService {
}
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)) {
@ -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.setOrderNo(receiveParameter.getOrderNo());
allOrderInfo.setType(receiveParameter.getType());
@ -578,7 +580,7 @@ public class FyPayServiceImpl implements FyPayService {
allOrderInfo.setPayMoney(receiveParameter.getGoodsMoney());
allOrderInfo.setPayType(receiveParameter.getPayType());
allOrderInfo.setUserId(receiveParameter.getUserId());
allOrderInfo.setPayChannel("cashier");
allOrderInfo.setPayChannel(payChannel);
allOrderInfo.setStatus(payStatus);
allOrderInfo.setDiscountAmount(discountAmount);
if (payStatus.equals("paid")) {
@ -749,7 +751,7 @@ public class FyPayServiceImpl implements FyPayService {
BeanUtils.copyProperties(receiveParameterPos, receiveParameter);
Double discountAmount = 0.0;
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")) {
payStatus = "paid";
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());
// 根据用户id查询用户信息
LJUserVo userVo1 = userService.selectUserById(userId, storeId);
if (ObjectUtil.isEmpty(userVo1)){
res.put("error", "当前会员不存在!");
return res;
}
// 根据日期生成订单信息
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");

View File

@ -34,6 +34,7 @@ public class PrintIntegralReport {
for (Map<String, Object> stringStringMap : o) {
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>"+ stringStringMap.get("price")+"</td></tr>");
}
sb.append("</table>");

View File

@ -49,6 +49,9 @@ public class TagCodeRecordController extends BaseController {
@Resource
private OilTagService oilTagService;
@Resource
private TagCodeService tagCodeService;
@Resource
private ILJStaffService mtStaffService;
@ -80,6 +83,18 @@ public class TagCodeRecordController extends BaseController {
tagCodeRecord.setId(tagCodeRecordDTO.getId());
tagCodeRecord.setStaffId(tagCodeRecordDTO.getStaffId());
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));
}
// 一键解绑
@ -185,8 +200,6 @@ public class TagCodeRecordController extends BaseController {
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> 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
private BackendFileController backendFileController;
@Autowired
private TagCodeMapper tagCodeMapper;
@Override
@Transactional
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()
.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) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

View File

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

View File

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