From d570586be5ecdb51e36ccdc111f9f6bfe80a2fcb Mon Sep 17 00:00:00 2001 From: wangh <9483> Date: Wed, 28 Feb 2024 13:24:53 +0800 Subject: [PATCH] no message --- fuintAdmin/src/views/integral/gift/index.vue | 4 +- .../controller/IntegralOrdersController.java | 4 +- .../integral/mapper/IntegralOrdersMapper.java | 2 +- .../mapper/xml/IntegralGiftMapper.xml | 4 +- .../mapper/xml/IntegralOrdersMapper.xml | 72 ++++++++++++++--- .../service/IntegralOrdersService.java | 2 +- .../impl/IntegralOrdersServiceImpl.java | 7 +- .../controller/HandoverRecordController.java | 6 +- .../order/mapper/HandoverRecordMapper.java | 20 ++--- .../order/mapper/xml/HandoverRecordMapper.xml | 42 ++++++++-- .../order/service/HandoverRecordService.java | 4 +- .../service/impl/AllOrderInfoServiceImpl.java | 5 +- .../impl/HandoverRecordServiceImpl.java | 78 ++++++++++-------- fuintCashierWeb/src/api/cashier/handover.js | 4 +- .../views/cashier/NewComponents/Handover.vue | 79 ++++++++++++++----- .../cashier/NewComponents/HandoverDetails.vue | 39 ++++++--- .../views/cashier/NewComponents/Integral.vue | 61 +++++++++++--- .../integralOrder/pointsCashier.vue | 6 +- 18 files changed, 317 insertions(+), 122 deletions(-) diff --git a/fuintAdmin/src/views/integral/gift/index.vue b/fuintAdmin/src/views/integral/gift/index.vue index d12b96f68..fe4e646ac 100644 --- a/fuintAdmin/src/views/integral/gift/index.vue +++ b/fuintAdmin/src/views/integral/gift/index.vue @@ -666,7 +666,7 @@ export default { // 批量图片 giftImages: [], // 上传地址 - uploadAction: process.env.VUE_APP_SERVER_URL + 'backendApi/file/upload', + uploadAction: process.env.VUE_APP_BASE_API + 'backendApi/file/upload', uploadHeader: { 'Access-Token' : getToken() }, // 隐藏上传 hideUpload: false, @@ -676,7 +676,7 @@ export default { url:'http://localhost:8008/static/uploadImages/20231103/ffbbe7d3ee1441fdaf706802fa0f176a.png'} ], // 图片根目录 - imagePath: process.env.VUE_APP_SERVER_URL, + imagePath: process.env.VUE_APP_BASE_API, dialogImageUrl: "", dialogVisible: false, diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/controller/IntegralOrdersController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/controller/IntegralOrdersController.java index bb61ec102..03ea1b47e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/controller/IntegralOrdersController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/controller/IntegralOrdersController.java @@ -123,8 +123,8 @@ public class IntegralOrdersController extends BaseController { * @return */ @GetMapping("/statistics") - public ResponseObject statistics(Integer orderType) { - return getSuccessResult(this.integralOrdersService.statistics(orderType)); + public ResponseObject statistics(IntegralOrdersDTO integralOrders) { + return getSuccessResult(this.integralOrdersService.statistics(integralOrders)); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/IntegralOrdersMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/IntegralOrdersMapper.java index 0568b49ce..63b698ca5 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/IntegralOrdersMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/IntegralOrdersMapper.java @@ -97,7 +97,7 @@ public interface IntegralOrdersMapper { * 统计数据 * @return */ - Map statistics(@Param("storeId") Integer storeId, @Param("orderType") Integer orderType); + Map statistics(@Param("integralOrders") IntegralOrdersDTO integralOrders); List getListByOrderNo(@Param("orderNumber") String orderNumber,@Param("storeId") Integer storeId); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralGiftMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralGiftMapper.xml index 72c2730e7..3de91c393 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralGiftMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralGiftMapper.xml @@ -103,7 +103,9 @@ and ig.gift_name like CONCAT ('%',#{integralGift.giftName},'%') - and ig.delivery_method like CONCAT ('%',#{integralGift.deliveryMethod},'%') + and (ig.delivery_method like CONCAT ('%',#{integralGift.deliveryMethod},'%') + or ig.delivery_method = '[]' + ) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralOrdersMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralOrdersMapper.xml index 0826cbe04..6f000fcde 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralOrdersMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralOrdersMapper.xml @@ -295,16 +295,68 @@ diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralOrdersService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralOrdersService.java index c50086651..88334ab34 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralOrdersService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralOrdersService.java @@ -66,7 +66,7 @@ public interface IntegralOrdersService { * @return 是否成功 */ boolean deleteById(Integer id); - Map statistics(Integer orderType); + Map statistics(IntegralOrdersDTO integralOrders); IntegralOrders integralOrdersProcessing(IntegralOrdersRequest integralOrdersList); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java index 85ecd8d67..7a8316e54 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java @@ -156,9 +156,10 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService { } @Override - public Map statistics(Integer orderType) { + public Map statistics(IntegralOrdersDTO integralOrders) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); - return this.integralOrdersDao.statistics(nowAccountInfo.getStoreId(),orderType); + integralOrders.setStoreId(nowAccountInfo.getStoreId()); + return this.integralOrdersDao.statistics(integralOrders); } @Resource @@ -326,7 +327,7 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService { for (IntegralOrders integralOrders : listByOrderNo) { // 查询员工信息 LJStaff ljStaff = ljStaffMapper.selectById(integralOrders.getStaffId()); - + if (ObjectUtil.isEmpty(integralOrders.getIntegral())) integralOrders.setIntegral(0.0); totalPoints = totalPoints.add(new BigDecimal(integralOrders.getIntegral())); // 加兑换卷和优惠券判断 IntegralGift integralGift = integralGiftService.queryById(integralOrders.getGiftId()); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/HandoverRecordController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/HandoverRecordController.java index 93d888102..ba67e48b4 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/HandoverRecordController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/HandoverRecordController.java @@ -54,7 +54,7 @@ public class HandoverRecordController extends BaseController { @GetMapping("selectByTime") public ResponseObject selectByTime() { - return getSuccessResult(this.handoverRecordService.selectByTime()); + return getSuccessResult(this.handoverRecordService.selectByTime(null)); } /** @@ -107,8 +107,8 @@ public class HandoverRecordController extends BaseController { * @return */ @GetMapping("handover") - public ResponseObject handover() { - return getSuccessResult(handoverRecordService.handover()); + public ResponseObject handover(Integer staffId) { + return getSuccessResult(handoverRecordService.handover(staffId)); } @GetMapping("handoverByAllOrder") diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/HandoverRecordMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/HandoverRecordMapper.java index 77fb844a5..239acf2ad 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/HandoverRecordMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/HandoverRecordMapper.java @@ -85,25 +85,25 @@ public interface HandoverRecordMapper { int deleteById(Integer id); // 油品交易信息 - Map oilOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId); + Map oilOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId, @Param("staffId") Integer staffId); // 会员储值交易信息 - Map cardOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId); + Map cardOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId, @Param("staffId") Integer staffId); // 油卡交易信息 - Map fuelOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId); + Map fuelOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId, @Param("staffId") Integer staffId); // 普通交易 - Map goodsOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId); + Map goodsOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId, @Param("staffId") Integer staffId); - List> paymentAggregation(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId); + List> paymentAggregation(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId, @Param("staffId") Integer staffId); - List> oilNumberStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId); + List> oilNumberStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId, @Param("staffId") Integer staffId); - List> greaseGunStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId); + List> greaseGunStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId, @Param("staffId") Integer staffId); - List> employeeStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId); + List> employeeStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId, @Param("staffId") Integer staffId); - List> billingDetails(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId); + List> billingDetails(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId,@Param("staffId") Integer staffId); - List> returnedToTheAccount(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId); + List> returnedToTheAccount(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId,@Param("staffId") Integer staffId); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/HandoverRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/HandoverRecordMapper.xml index f2ad27be4..8f8323c14 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/HandoverRecordMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/HandoverRecordMapper.xml @@ -37,6 +37,9 @@ hr.store_id = #{handoverRecord.storeId} and hr.status = #{handoverRecord.status} + + + and hr.staff_id = #{handoverRecord.staffId} and hr.type = #{handoverRecord.type} @@ -208,7 +211,7 @@ limit 1 @@ -323,6 +350,9 @@ limit 1 where on1.store_id = #{storeId} and oo.store_id = 60 and oo.create_time BETWEEN #{startTime} AND #{endTime} + + and staff_id = #{staffId} + GROUP BY oo.oils @@ -338,7 +368,9 @@ limit 1 left join oil_gun og on oo.oil_gun_num = og.id where oo.store_id = #{storeId} and oo.create_time BETWEEN #{startTime} AND #{endTime} - + + and staff_id = #{staffId} + GROUP BY oo.oil_gun_num diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/HandoverRecordService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/HandoverRecordService.java index fdbe766ea..86b2c736b 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/HandoverRecordService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/HandoverRecordService.java @@ -33,7 +33,7 @@ public interface HandoverRecordService { */ IPage queryByPage(@Param("page") Page page, @Param("handoverRecord") HandoverRecord handoverRecord); - HandoverRecord selectByTime(); + HandoverRecord selectByTime(Integer staffId); /** * 新增数据 @@ -59,7 +59,7 @@ public interface HandoverRecordService { */ boolean deleteById(Integer id); - public Map handover(); + public Map handover(Integer staffId); public Map handoverByAllOrder(); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java index 3bf493cb7..91e340cbf 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java @@ -43,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.DecimalFormat; import java.util.Date; import java.util.HashMap; @@ -178,7 +179,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl 0) { + if (!"CASH".equals(allOrderInfo.getPayType()) && Double.valueOf(map.get("refundAmt")) > 0) { try { refund = fyPayService.refund(map); } catch (Exception e) { diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HandoverRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HandoverRecordServiceImpl.java index 42a4c86e7..b04ffa4c0 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HandoverRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HandoverRecordServiceImpl.java @@ -3,6 +3,7 @@ package com.fuint.business.order.service.impl; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.generator.config.IFileCreate; import com.fuint.business.member.entity.LJStaff; import com.fuint.business.member.service.ILJStaffService; import com.fuint.business.order.entity.HandoverRecord; @@ -19,6 +20,7 @@ import com.fuint.system.dict.entity.SysDictData; import com.fuint.system.dict.entity.SysDictType; import com.fuint.system.dict.service.ISysDictDataService; import com.fuint.system.dict.service.ISysDictTypeService; +import io.swagger.models.auth.In; import javafx.print.Printer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -83,10 +85,11 @@ public class HandoverRecordServiceImpl implements HandoverRecordService { } @Override - public HandoverRecord selectByTime() { + public HandoverRecord selectByTime(Integer staffId) { HandoverRecord handoverRecord = new HandoverRecord(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); handoverRecord.setStoreId(nowAccountInfo.getStoreId()); + handoverRecord.setStaffId(staffId); return handoverRecordMapper.selectByTime(handoverRecord); } @@ -100,7 +103,7 @@ public class HandoverRecordServiceImpl implements HandoverRecordService { public HandoverRecord insert(HandoverRecord handoverRecord) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); handoverRecord.setStoreId(nowAccountInfo.getStoreId()); - handoverRecord.setStaffId(nowAccountInfo.getStaffId()); + if (ObjectUtil.isEmpty(handoverRecord.getStaffId())) handoverRecord.setStaffId(nowAccountInfo.getStaffId()); this.handoverRecordMapper.insert(handoverRecord); return handoverRecord; @@ -130,7 +133,7 @@ public class HandoverRecordServiceImpl implements HandoverRecordService { } @Override - public Map handover() { + public Map handover(Integer staffId) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); MtStore mtStore = new MtStore(); @@ -148,15 +151,20 @@ public class HandoverRecordServiceImpl implements HandoverRecordService { Map handoverMap = new HashMap<>(); String startTime = "2023-01-01 12:12:12"; - HandoverRecord handoverRecord = selectByTime(); + + HandoverRecord handoverRecord = selectByTime(staffId); if (!ObjectUtil.isEmpty(handoverRecord) && !ObjectUtil.isEmpty(handoverRecord.getEndTime())) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); startTime = sdf.format(handoverRecord.getEndTime()); } - - LJStaff ljStaff = iljStaffService.selectStaffById(nowAccountInfo.getStaffId()); + String handoverType = "统一交班"; + Integer staff = nowAccountInfo.getStaffId(); + if (ObjectUtil.isNotEmpty(staffId)){ + staff = staffId; + handoverType = "个人交班"; + } + LJStaff ljStaff = iljStaffService.selectStaffById(staff); // String handover = iSysDictDataService.selectDictLabel("handover", ljStaff.getHandoverMode()); - String handoverType = "暂无"; // if (!ObjectUtil.isEmpty(handover)) { // handoverType = handover; @@ -164,7 +172,7 @@ public class HandoverRecordServiceImpl implements HandoverRecordService { // 填充 baseInfo Map baseInfo = new HashMap<>(); baseInfo.put("storeName", mtStore.getName()); - baseInfo.put("realName", nowAccountInfo.getRealName()); + baseInfo.put("realName", ljStaff.getRealName()); baseInfo.put("handoverType", handoverType); baseInfo.put("startTime", startTime); baseInfo.put("endTime", formattedEndTime); @@ -172,41 +180,41 @@ public class HandoverRecordServiceImpl implements HandoverRecordService { // baseInfo.put("handoverOut", ljStaff.getHandoverOut()); // 交班是否退出 handoverMap.put("baseInfo",baseInfo); // 获取订单汇总 - Map orderSummaryMap = orderSummary(startTime, formattedEndTime); + Map orderSummaryMap = orderSummary(startTime, formattedEndTime, staffId); handoverMap.put("orderSummary",orderSummaryMap); // 支付方式汇总 - List> paymentAggregationMap = paymentAggregation(startTime, formattedEndTime); + List> paymentAggregationMap = paymentAggregation(startTime, formattedEndTime, staffId); handoverMap.put("paymentAggregation",paymentAggregationMap); // 油号统计 - List> oilNumberStatisticsMap = oilNumberStatistics(startTime, formattedEndTime); + List> oilNumberStatisticsMap = oilNumberStatistics(startTime, formattedEndTime, staffId); handoverMap.put("oilNumberStatistics",oilNumberStatisticsMap); // 油枪统计 - List> greaseGunStatisticsMap = greaseGunStatistics(startTime, formattedEndTime); + List> greaseGunStatisticsMap = greaseGunStatistics(startTime, formattedEndTime, staffId); handoverMap.put("greaseGunStatistics",greaseGunStatisticsMap); // 员工统计 - List> employeeStatisticsMap = employeeStatistics(startTime, formattedEndTime); + List> employeeStatisticsMap = employeeStatistics(startTime, formattedEndTime, staffId); handoverMap.put("employeeStatistics",employeeStatisticsMap); // 挂账详情 - List> billingDetailsMap = billingDetails(startTime, formattedEndTime); + List> billingDetailsMap = billingDetails(startTime, formattedEndTime, staffId); handoverMap.put("billingDetails",billingDetailsMap); // 挂账归还 - List> returnedToTheAccountMap = returnedToTheAccount(startTime, formattedEndTime); + List> returnedToTheAccountMap = returnedToTheAccount(startTime, formattedEndTime, staffId) ; handoverMap.put("returnedToTheAccount",returnedToTheAccountMap); // 合计 return handoverMap; } - public Map orderSummary(String startTime, String endTime) { + public Map orderSummary(String startTime, String endTime, Integer staffId) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); Map allStatistics = new HashMap<>(); // 油品订单(订单) 油品订单(退款) 油品订单(实收) 油品优惠(实收) 油品交易(实收) - Map oilOrderStatistics = handoverRecordMapper.oilOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId()); + Map oilOrderStatistics = handoverRecordMapper.oilOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId(), staffId); // 会员储值(订单) 会员储值(退款) 会员储值(实收) 储值赠送(订单) 储值赠送(退款) 储值赠送(实际) - Map cardOrderStatistics = handoverRecordMapper.cardOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId()); - Map fuelOrderStatistics = handoverRecordMapper.fuelOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId()); + Map cardOrderStatistics = handoverRecordMapper.cardOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId(), staffId); + Map fuelOrderStatistics = handoverRecordMapper.fuelOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId(), staffId); // 普通收款(订单) 普通收款(退款) 普通收款(实收) - Map goodsOrderStatistics = handoverRecordMapper.goodsOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId()); + Map goodsOrderStatistics = handoverRecordMapper.goodsOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId(), staffId); if (!ObjectUtil.isEmpty(oilOrderStatistics)) { allStatistics.putAll(oilOrderStatistics); }else{ @@ -249,9 +257,9 @@ public class HandoverRecordServiceImpl implements HandoverRecordService { * 汇总统计 */ - public List> paymentAggregation(String startTime, String endTime) { + public List> paymentAggregation(String startTime, String endTime, Integer staffId) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); - List> paymentAggregation = handoverRecordMapper.paymentAggregation(startTime, endTime, nowAccountInfo.getStoreId()); + List> paymentAggregation = handoverRecordMapper.paymentAggregation(startTime, endTime, nowAccountInfo.getStoreId(),staffId); List> allRefundMapList = new ArrayList<>(); if (!ObjectUtil.isEmpty(paymentAggregation)) { for (Map stringStringMap : paymentAggregation) { @@ -298,9 +306,9 @@ public class HandoverRecordServiceImpl implements HandoverRecordService { return mapList; } - public Map paymentAggregation2(String startTime, String endTime) { + public Map paymentAggregation2(String startTime, String endTime,Integer staffId) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); - List> paymentAggregation = handoverRecordMapper.paymentAggregation(startTime, endTime, nowAccountInfo.getStoreId()); + List> paymentAggregation = handoverRecordMapper.paymentAggregation(startTime, endTime, nowAccountInfo.getStoreId() , staffId); // 共有四个 转为普通map Map allAggreMap = new HashMap<>(); Map allRefundMap = new HashMap<>(); @@ -358,40 +366,40 @@ public class HandoverRecordServiceImpl implements HandoverRecordService { /** * 油号统计 */ - public List> oilNumberStatistics (String startTime, String endTime) { + public List> oilNumberStatistics (String startTime, String endTime, Integer staffId) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); - List> oilNumberStatistics = handoverRecordMapper.oilNumberStatistics(startTime, endTime, nowAccountInfo.getStoreId()); + List> oilNumberStatistics = handoverRecordMapper.oilNumberStatistics(startTime, endTime, nowAccountInfo.getStoreId(), staffId); return oilNumberStatistics; } /** * 油枪统计 */ - public List> greaseGunStatistics (String startTime, String endTime) { + public List> greaseGunStatistics (String startTime, String endTime, Integer staffId) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); - List> greaseGunStatistics = handoverRecordMapper.greaseGunStatistics(startTime, endTime, nowAccountInfo.getStoreId()); + List> greaseGunStatistics = handoverRecordMapper.greaseGunStatistics(startTime, endTime, nowAccountInfo.getStoreId(), staffId); return greaseGunStatistics; } /** * 员工统计 */ - public List> employeeStatistics (String startTime, String endTime) { + public List> employeeStatistics (String startTime, String endTime, Integer staffId) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); - List> employeeStatistics = handoverRecordMapper.employeeStatistics(startTime, endTime, nowAccountInfo.getStoreId()); + List> employeeStatistics = handoverRecordMapper.employeeStatistics(startTime, endTime, nowAccountInfo.getStoreId(), staffId); return employeeStatistics; } // 挂账详情 - public List> billingDetails (String startTime, String endTime) { + public List> billingDetails (String startTime, String endTime, Integer staffId) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); - List> billingDetails = handoverRecordMapper.billingDetails(startTime, endTime, nowAccountInfo.getStoreId()); + List> billingDetails = handoverRecordMapper.billingDetails(startTime, endTime, nowAccountInfo.getStoreId(), staffId); return billingDetails; } // 挂账归还 - public List> returnedToTheAccount (String startTime, String endTime) { + public List> returnedToTheAccount (String startTime, String endTime, Integer staffId) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); - List> returnedToTheAccount = handoverRecordMapper.returnedToTheAccount(startTime, endTime, nowAccountInfo.getStoreId()); + List> returnedToTheAccount = handoverRecordMapper.returnedToTheAccount(startTime, endTime, nowAccountInfo.getStoreId(), staffId); return returnedToTheAccount; } @@ -431,7 +439,7 @@ public class HandoverRecordServiceImpl implements HandoverRecordService { Map handoverMap = new HashMap<>(); String startTime = "2023-01-01 12:12:12"; - HandoverRecord handoverRecord = selectByTime(); + HandoverRecord handoverRecord = selectByTime(null); if (!ObjectUtil.isEmpty(handoverRecord) && !ObjectUtil.isEmpty(handoverRecord.getEndTime())) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); startTime = sdf.format(handoverRecord.getEndTime()); diff --git a/fuintCashierWeb/src/api/cashier/handover.js b/fuintCashierWeb/src/api/cashier/handover.js index 85ebb04e2..d0b4e2bbd 100644 --- a/fuintCashierWeb/src/api/cashier/handover.js +++ b/fuintCashierWeb/src/api/cashier/handover.js @@ -1,10 +1,10 @@ import request from '@/utils/request' -export function getHandoverApi() { +export function getHandoverApi(query) { return request({ url: '/business/handoverRecord/handover', method: 'get', - // params: query + params: query }) } diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/Handover.vue b/fuintCashierWeb/src/views/cashier/NewComponents/Handover.vue index 787bcf2b8..e05b2b649 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/Handover.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/Handover.vue @@ -79,11 +79,11 @@
¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardOrder : '0' }}
-
-
会员储值(退款)
-
¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardRefund : '0' }}
+ + + -
+
会员储值(实收)
¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardPaid : '0' }}
@@ -94,11 +94,11 @@
¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardGiftOrder : '0' }}
-
-
储值赠送(退款)
-
¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardGiftRefund : '0' }}
+ + + -
+
储值赠送(实际)
¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardGiftPaid : '0' }}
@@ -111,11 +111,11 @@
¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.fuelOrder : '0' }}
-
-
存油储值(退款)
-
¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.fuelRefund : '0' }}
+ + + -
+
存油储值(实收)
¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.fuelPaid : '0' }}
@@ -377,12 +377,24 @@
交班
+
+ + {{staff.staffName?staff.staffName:"选择员工交班"}} + + +
本地打印
交班记录
+ + + + + @@ -392,23 +404,52 @@ import BigNumber from "bignumber.js"; import {removeUserId} from "@/utils/auth"; import { getLodop } from "@/api/LodopFuncs"; import Vue from 'vue'; +import SelectStaff from "@/components/local/selectStaff.vue"; export default { name: "Handover", + components: {SelectStaff}, data() { return { handoverList : {}, - + openStaff: false, + staff:{ + staffId:'', + staffName:null + } } }, created() { this.getHandover(); }, methods: { + clean() { + this.staff={ + staffId:'', + staffName:null + } + }, + // 选择员工 + chooseStaff() { + this.openStaff = true + }, + handleDataFromChild(data) { + this.openStaff = false + + this.staff.staffId = data.mtStaffId, + this.staff.staffName = data.realName + console.log("realName",this.staff.staffName) + this.getHandover(); + }, getHandover() { - getHandoverApi().then(res=>{ + + getHandoverApi({staffId: this.staff.staffId}).then(res=>{ this.handoverList = res.data; console.log("this.handoverList",this.handoverList) + // this.staff={ + // staffId:'', + // staffName:null + // } }) }, orderSummary() { @@ -608,13 +649,15 @@ import Vue from 'vue'; recordData:JSON.stringify(recordData), type:0, status:this.handoverList.baseInfo.handoverType, + staffId:this.staff.staffId } addHandoverApi(handoverRecord).then(res=>{ if (flag) { - removeUserId(); - this.$store.dispatch('LogOut').then(() => { - location.href = '/'; - }) + this.clean() + // removeUserId(); + // this.$store.dispatch('LogOut').then(() => { + // location.href = '/'; + // }) } this.getHandover(); }) diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/HandoverDetails.vue b/fuintCashierWeb/src/views/cashier/NewComponents/HandoverDetails.vue index 62ff3c861..409a77f32 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/HandoverDetails.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/HandoverDetails.vue @@ -7,16 +7,22 @@ 交班详情 - - - - - - - - - - + + + 统一交班 + 个人交班 + + + + + + + 交班 @@ -100,6 +106,7 @@ import {getStatisticsApi } from "@/api/cashier/integralOrder/order"; import Detail from '@/views/cashier/NewComponents/integralOrder/detail' import {getDicts} from "@/api/dict/data"; import HandoverOnly from "@/views/cashier/NewComponents/HandoverOnly"; +import {listStaff} from "@/api/staff/staff"; export default { name: "pointsCashier", @@ -128,7 +135,7 @@ export default { defaultSort: {prop: 'createTime', order: 'descending'}, total: 0, - + staffList:[], statisticsForm: { num:0, exchangeQuantity:0, @@ -141,6 +148,7 @@ export default { this.getList(); this.getStatistics(); this.getStatus(); + this.getStaffList(); }, methods: { getList(){ @@ -174,6 +182,14 @@ export default { this.getList(); }, + getStaffList() { + listStaff(this.addDateRange({ page: 1, + pageSize: 10000})).then(response => { + this.staffList = response.data.records; + + } + ); + }, resetQuery(){ this.queryParams = { giftName: '', @@ -184,6 +200,7 @@ export default { pageSize:10 }, this.dateRange = [] + this.getList(); }, printLocally(data) { printLocallyApi(data).then(res=>{ diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/Integral.vue b/fuintCashierWeb/src/views/cashier/NewComponents/Integral.vue index 741385b49..dc4dcd73b 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/Integral.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/Integral.vue @@ -37,7 +37,7 @@ border-radius: 5px;text-align: center">
- 会员等级:{{ member.gradeId?getGrade(member.gradeId):'未知' }} + 会员等级:{{ gradeName }}
@@ -198,7 +198,7 @@ {{member.remark ? member.remark : "--"}} - {{member.gradeId ? member.gradeId : "--"}} + {{member.gradeId ? getGradeName(gradeList,member.gradeId) : "--"}}