diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/LJOrderService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/LJOrderService.java index 5dc294766..015f9702b 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/LJOrderService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/LJOrderService.java @@ -61,4 +61,11 @@ public interface LJOrderService extends IService { Map orderStatistics(LJOrder order); LJOrder getStatisticsByTime(Date time ,Integer goodsId); + + /** + * 添加商品订单信息 + * @param order + * @param goodsId 商品id + */ + void addGoodOrder(LJOrder order,Integer goodsId); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/LJOrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/LJOrderServiceImpl.java index f25502b04..78291e992 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/LJOrderServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/LJOrderServiceImpl.java @@ -1,26 +1,37 @@ package com.fuint.business.order.service.impl; +import cn.hutool.core.util.ObjectUtil; import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.business.order.entity.LJOrder; +import com.fuint.business.order.entity.OrderGoods; import com.fuint.business.order.mapper.LJOrderMapper; import com.fuint.business.order.service.LJOrderService; +import com.fuint.business.order.service.OrderGoodsService; import com.fuint.business.order.vo.Excel.LJOrderExcel; import com.fuint.business.order.vo.LJOrderVo; import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletResponse; +import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Map; +import java.util.UUID; @Service public class LJOrderServiceImpl extends ServiceImpl implements LJOrderService { + @Autowired + @Lazy + private OrderGoodsService orderGoodsService; + @Override public IPage selectOrderList(Page page, LJOrder order) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); @@ -110,4 +121,23 @@ public class LJOrderServiceImpl extends ServiceImpl impl public LJOrder getStatisticsByTime(Date time, Integer goodsId) { return baseMapper.getStatisticsByTime(time, goodsId); } + + @Override + public void addGoodOrder(LJOrder order,Integer goodsId) { + if (ObjectUtil.isEmpty(order.getOrderNo())){ +// 根据日期生成订单信息 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); + String timestamp = dateFormat.format(new Date()); + String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6); + String orderNo = "2345"+timestamp+randomString; + order.setOrderNo(orderNo); + } + baseMapper.insert(order); + LJOrder ljOrder = this.selectGoodsOrder(order.getOrderNo()); + OrderGoods orderGoods = new OrderGoods(); + orderGoods.setGoodsId(goodsId); + orderGoods.setOrderId(ljOrder.getId()); + orderGoods.setNum(ljOrder.getGoodsNum()); + orderGoodsService.save(orderGoods); + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OrderGoodsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OrderGoodsServiceImpl.java index 8043140e0..79562e954 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OrderGoodsServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OrderGoodsServiceImpl.java @@ -62,10 +62,11 @@ public class OrderGoodsServiceImpl extends ServiceImpl执行安装"; var strLodopUpdate = strFontTag + "需要升级!点击这里执行升级"; @@ -110,7 +128,7 @@ function getLodop(oOBJECT, oEMBED) { var strLodop7Update_ARM = strLodop7FontTag + "需升级," + strLodop7HrefARM; var strInstallOK = ",成功后请刷新本页面或重启浏览器。"; var LODOP; - try { + var isWinIE = (/MSIE/i.test(navigator.userAgent)) || (/Trident/i.test(navigator.userAgent)); var isWinIE64 = isWinIE && (/x64/i.test(navigator.userAgent)); var isLinuxX86 = (/Linux/i.test(navigator.platform)) && (/x86/i.test(navigator.platform)); @@ -186,4 +204,4 @@ function getLodop(oOBJECT, oEMBED) { alert("getLodop出错:" + err); } } -export { getLodop }; +export { getLodop,connectFlag }; diff --git a/fuintCashierWeb/src/utils/request.js b/fuintCashierWeb/src/utils/request.js index e2297c9d0..6d4541c86 100644 --- a/fuintCashierWeb/src/utils/request.js +++ b/fuintCashierWeb/src/utils/request.js @@ -49,7 +49,7 @@ service.interceptors.request.use(config => { const s_url = sessionObj.url; // 请求地址 const s_data = sessionObj.data; // 请求数据 const s_time = sessionObj.time; // 请求时间 - const interval = 2000; // 间隔时间(ms),小于此时间视为重复提交 + const interval = 999; // 间隔时间(ms),小于此时间视为重复提交 if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { const message = '数据正在处理,请耐心等待'; console.warn(`[${s_url}]: ` + message) diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue index 0227a3e1b..03f25ce72 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue @@ -1248,7 +1248,7 @@ import {addHangBill} from "@/api/cashier/hangbill"; import {addCreditUnit, listCreditUnit} from "@/api/cashier/creditunit"; import {cashierOrderByOrderNo} from "@/api/cashier/cashierorder"; - import {getLodop} from "@/api/LodopFuncs"; + import {getLodop,connectFlag} from "@/api/LodopFuncs"; import {giftCardExchange} from "@/api/cashier/giftCard/giftcard"; import BigNumber from "bignumber.js"; import { @@ -2183,11 +2183,16 @@ this.isPay = true }, - async printLocally() { + printLocally() { + if (!connectFlag){ + return + } + try { //初始化打印函数 let LODOP = getLodop(); // 初始化打印 - LODOP.PRINT_INIT(); - var bodyStyle = ` ` - var fromHtml = bodyStyle+this.$refs.report.innerHTML + var fromHtml = bodyStyle + this.$refs.report.innerHTML - LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", fromHtml); + LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", fromHtml); - LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW",true); + LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW", true); - // LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789'); - // let preview = LODOP.PREVIEW(); - // console.log("preview",preview); - LODOP.PRINT(); + // LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789'); + // let preview = LODOP.PREVIEW(); + // console.log("preview",preview); + LODOP.PRINT(); + } + }catch (e){ + console.log(e,'打印机报错') + } }, async printLocally1() { + if (!connectFlag){ + return + } //初始化打印函数 let LODOP = getLodop(); // 初始化打印 - LODOP.PRINT_INIT(); - var bodyStyle = ` ` - var fromHtml = bodyStyle+this.$refs.report1.innerHTML + var fromHtml = bodyStyle + this.$refs.report1.innerHTML - LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", fromHtml); + LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", fromHtml); - LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW",true); + LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW", true); - // LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789'); - // let preview = LODOP.PREVIEW(); - // console.log("preview",preview); - LODOP.PRINT(); + // LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789'); + // let preview = LODOP.PREVIEW(); + // console.log("preview",preview); + LODOP.PRINT(); + } }, async printLocally2() { + if (!connectFlag){ + return + } //初始化打印函数 let LODOP = getLodop(); // 初始化打印 - LODOP.PRINT_INIT(); - var bodyStyle = ` - ` - var fromHtml = bodyStyle+this.$refs.report2.innerHTML + .box-ge{ + border-bottom: 1px solid #000000 ; + box-sizing: border-box; + padding: 10px; + } + .box-title{ + font-size: 18px; + text-align: center; + align-items: center; + margin-top: 15px; + } + .input-hui{ + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + font-size: 14px; + margin: 15px 0px; + background: #b2b2b2; + box-sizing: border-box; + padding: 5px 0px; + } + .input-hui-frou{ + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + font-size: 14px; + margin: 15px 0px; + background: #b2b2b2; + box-sizing: border-box; + padding: 5px 0px; + div{ + width: 25%; + text-align: left; + } + } + .input-box-frou{ + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + font-size: 14px; + margin: 5px 0px; + div{ + width: 25%; + text-align: left; + } + } + .box-center{ + height: 500px; + } + + ` + var fromHtml = bodyStyle+this.$refs.report2.innerHTML - LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", fromHtml); + LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", fromHtml); - LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW",true); - - // LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789'); - // let preview = LODOP.PREVIEW(); - // console.log("preview",preview); - LODOP.PRINT(); + LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW",true); + // LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789'); + // let preview = LODOP.PREVIEW(); + // console.log("preview",preview); + LODOP.PRINT(); + } }, clear(){ // this.autofocus = false @@ -3854,24 +3873,15 @@ let isPaySuccess = false; await addLJGoods(_this.map).then( response => { + console.log('3867386738673867') _this.orderNo = response.data.orderNo; if (response.data.oilOrder!=null){ if (response.data.oilOrder.orderStatus == "paid"){ + _this.isPaySuccess = true; isPaySuccess = true _this.isPay = true; - _this.seekZero = 0 _this.loading = false; - _this.amount = 0 - // for (let i =0;i<_this.oilPreferentialData.length;i++){ - // _this.oilPreferentialData[i].oilPreferential.storeId = response.data.oilOrder.storeId - // _this.oilPreferentialData[i].oilPreferential.orderAmount = response.data.oilOrder.orderAmount - // _this.oilPreferentialData[i].oilPreferential.userId = response.data.oilOrder.userId - // _this.oilPreferentialData[i].oilPreferential.oilId = response.data.oilOrder.oils - // _this.oilPreferentialData[i].oilPreferential.mtUserLevel = _this.member.gradeId - // _this.oilPreferentialData[i].oilPreferential.cardFavorableId = _this.cardFavorableId - // usePaymentActive(_this.oilPreferentialData[i].oilPreferential).then(res => {}) - // } _this.printLocally() _this.resetting1() return; @@ -3882,8 +3892,6 @@ _this.isPaySuccess = true; isPaySuccess = true _this.isPay = true; - _this.seekZero = 0 - _this.amount = 0 _this.loading = false; _this.printLocally() _this.resetting1() diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue index caa7e6bcd..308308da7 100644 --- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue +++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue @@ -443,7 +443,7 @@ import {getOilNameList} from "@/api/cashier/oilnumgun"; import {getOrderGoods} from "@/api/cashier/goodsorder"; import {exportExcelCashierApi} from "@/api/order/exportExcel"; import {refundApi} from "@/api/cashier/refund"; -import {getLodop} from "@/api/LodopFuncs"; +import {connectFlag, getLodop} from "@/api/LodopFuncs"; import {getOilNumberGun} from "@/api/cashier/oilGuns"; import {formatDate} from "@/utils"; import ScanPayCodeDialog from "@/views/cashier/components/scanPayCodeDialog.vue"; @@ -564,6 +564,9 @@ import ScanPayCodeDialog from "@/views/cashier/components/scanPayCodeDialog.vue" }, async printLocally() { + if (!connectFlag){ + return + } //初始化打印函数 let LODOP = getLodop(); // 初始化打印 LODOP.PRINT_INIT(); diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Goods.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Goods.vue index c691c3c46..1a38f7b87 100644 --- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Goods.vue +++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Goods.vue @@ -301,7 +301,7 @@ import {getDicts} from "@/api/dict/data"; import { exportExcelGoodsOrderApi } from "@/api/order/exportExcel"; import {cashierOrder} from "@/api/cashier/cashierorder"; import {refundApi, getOrderInfoApi} from "@/api/cashier/refund"; -import {getLodop} from "@/api/LodopFuncs"; +import {connectFlag, getLodop} from "@/api/LodopFuncs"; export default { name: "order_Cashier", @@ -399,6 +399,9 @@ export default { }, async printLocally() { + if (!connectFlag){ + return + } //初始化打印函数 let LODOP = getLodop(); // 初始化打印 LODOP.PRINT_INIT(); diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Oil.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Oil.vue index 6e178d4c6..45c2aad87 100644 --- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Oil.vue +++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Oil.vue @@ -349,7 +349,7 @@ import {cashierOrder} from "@/api/cashier/cashierorder"; import {getOrderInfoApi, refundApi} from "@/api/cashier/refund"; import {exportExcelOilOrderApi} from "@/api/order/exportExcel"; - import {getLodop} from "@/api/LodopFuncs"; + import {connectFlag, getLodop} from "@/api/LodopFuncs"; import {getInfoByIdApi} from "@/api/cashier/cardfavorablerecord"; export default { @@ -429,6 +429,9 @@ }, methods:{ async printLocally() { + if (!connectFlag){ + return + } //初始化打印函数 let LODOP = getLodop(); // 初始化打印 LODOP.PRINT_INIT(); diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Ordinary.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Ordinary.vue index a5cd092e8..1679ebae4 100644 --- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Ordinary.vue +++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Ordinary.vue @@ -260,7 +260,7 @@ import {listOilOrder, oilOrderInfo} from "@/api/cashier/oilorder"; import {getOilNameList} from "@/api/cashier/oilnumgun"; import {getOilNumberGun} from "@/api/cashier/oilGuns"; import {refundApi} from "@/api/cashier/refund"; -import {getLodop} from "@/api/LodopFuncs"; +import {connectFlag, getLodop} from "@/api/LodopFuncs"; export default { name: "order_Cashier", @@ -390,6 +390,9 @@ import {getLodop} from "@/api/LodopFuncs"; }, async printLocally() { + if (!connectFlag){ + return + } //初始化打印函数 let LODOP = getLodop(); // 初始化打印 LODOP.PRINT_INIT(); diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Vip.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Vip.vue index ab152e876..60fc0fed9 100644 --- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Vip.vue +++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Vip.vue @@ -281,7 +281,7 @@ import {getDicts} from "@/api/dict/data"; import {queryStaffs} from "@/api/cashier/staff"; import {refundApi} from "@/api/cashier/refund"; import {exportExcelVipApi} from "@/api/order/exportExcel"; -import {getLodop} from "@/api/LodopFuncs"; +import {connectFlag, getLodop} from "@/api/LodopFuncs"; export default { name: "order_Cashier", @@ -379,6 +379,9 @@ export default { }, async printLocally() { + if (!connectFlag){ + return + } //初始化打印函数 let LODOP = getLodop(); // 初始化打印 LODOP.PRINT_INIT(); diff --git a/fuintCashierWeb/src/views/details/index.vue b/fuintCashierWeb/src/views/details/index.vue index 2d809d549..21c7499d9 100644 --- a/fuintCashierWeb/src/views/details/index.vue +++ b/fuintCashierWeb/src/views/details/index.vue @@ -927,7 +927,7 @@ import {getUserGradeInfo} from "@/api/cashier/usergrade"; import {getDicts} from "@/api/dict/data"; import {getSysConfig} from "@/api/cashier/user/sysconfig"; import {giftCardExchange} from "@/api/cashier/giftCard/giftcard"; -import {getLodop} from "@/api/LodopFuncs"; +import {connectFlag, getLodop} from "@/api/LodopFuncs"; export default { components: { @@ -1630,10 +1630,14 @@ export default { }, async printLocally1() { + if (!connectFlag){ + return + } //初始化打印函数 let LODOP = getLodop(); // 初始化打印 - LODOP.PRINT_INIT(); - var bodyStyle = ` ` - var fromHtml = bodyStyle+this.$refs.report1.innerHTML + var fromHtml = bodyStyle + this.$refs.report1.innerHTML - LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", fromHtml); + LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", fromHtml); - LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW",true); + LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW", true); - // LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789'); - // let preview = LODOP.PREVIEW(); - // console.log("preview",preview); - LODOP.PRINT(); + // LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789'); + // let preview = LODOP.PREVIEW(); + // console.log("preview",preview); + LODOP.PRINT(); + } }, async printLocally2() { + if (!connectFlag){ + return + } //初始化打印函数 let LODOP = getLodop(); // 初始化打印 - LODOP.PRINT_INIT(); - var bodyStyle = ` ` - var fromHtml = bodyStyle+this.$refs.report2.innerHTML + var fromHtml = bodyStyle + this.$refs.report2.innerHTML - LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", fromHtml); + LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", fromHtml); - LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW",true); + LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW", true); - // LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789'); - // let preview = LODOP.PREVIEW(); - // console.log("preview",preview); - LODOP.PRINT(); + // LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789'); + // let preview = LODOP.PREVIEW(); + // console.log("preview",preview); + LODOP.PRINT(); + } }, async collection() {