diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/AllOrderInfoController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/AllOrderInfoController.java index 5177281d7..fe3d01050 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/AllOrderInfoController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/AllOrderInfoController.java @@ -42,6 +42,15 @@ public class AllOrderInfoController extends BaseController { return getSuccessResult(list); } + @GetMapping("getPageListByPos") + public ResponseObject getPageListByPos(AllOrderInfo allOrderInfo, + @RequestParam(value = "page",defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){ + Page page =new Page(pageNo,pageSize); + IPage list = allOrderInfoService.getPageListByPos(page, allOrderInfo); + return getSuccessResult(list); + } + @GetMapping("sumPayMoney") 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 ba67e48b4..796cdffe5 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 @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.order.entity.HandoverRecord; import com.fuint.business.order.service.HandoverRecordService; +import com.fuint.common.dto.AccountInfo; +import com.fuint.common.util.TokenUtil; import com.fuint.framework.web.BaseController; import com.fuint.framework.web.ResponseObject; import org.springframework.http.HttpHeaders; @@ -111,6 +113,12 @@ public class HandoverRecordController extends BaseController { return getSuccessResult(handoverRecordService.handover(staffId)); } + @GetMapping("handoverByPos") + public ResponseObject handoverByPos() { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + return getSuccessResult(handoverRecordService.handover(nowAccountInfo.getStaffId())); + } + @GetMapping("handoverByAllOrder") public ResponseObject handoverByAllOrder() { return getSuccessResult(handoverRecordService.handoverByAllOrder()); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml index 41ceef06e..10259421f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml @@ -174,6 +174,7 @@ aoi.create_by AS createBy, aoi.update_time AS updateTime, aoi.update_by AS updateBy, + aoi.content AS content, mu.name userName, mu.mobile userMobile from all_order_info aoi @@ -185,6 +186,9 @@ and aoi.order_no = #{allOrderInfo.orderNo} + + and aoi.status = #{allOrderInfo.status} + and aoi.pay_channel = #{allOrderInfo.payChannel} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/AllOrderInfoService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/AllOrderInfoService.java index e2635f1d7..88efe5c74 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/AllOrderInfoService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/AllOrderInfoService.java @@ -23,6 +23,7 @@ public interface AllOrderInfoService { * @return */ IPage getPageList(Page page, AllOrderInfo allOrderInfo); + IPage getPageListByPos(Page page, AllOrderInfo allOrderInfo); /** * 统计总的金额 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 86b2c736b..e69c0eee8 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 @@ -60,6 +60,7 @@ public interface HandoverRecordService { boolean deleteById(Integer id); public Map handover(Integer staffId); + public Map handoverByPos(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 4e4ece96d..3a13deb0e 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 @@ -28,8 +28,10 @@ import com.fuint.business.order.vo.Excel.OilDepotExcel; import com.fuint.business.order.vo.Excel.TradingExcel; import com.fuint.business.order.vo.OrderGoodsVo; import com.fuint.business.petrolStationManagement.entity.OilGun; +import com.fuint.business.petrolStationManagement.entity.OilName; import com.fuint.business.petrolStationManagement.entity.OilTracking; import com.fuint.business.petrolStationManagement.service.OilGunService; +import com.fuint.business.petrolStationManagement.service.OilNameService; import com.fuint.business.petrolStationManagement.service.OilTankService; import com.fuint.business.petrolStationManagement.service.OilTrackingService; import com.fuint.business.store.entity.MtStore; @@ -84,6 +86,27 @@ public class AllOrderInfoServiceImpl extends ServiceImpl getPageListByPos(Page page, AllOrderInfo allOrderInfo) { + AccountInfo accountInfoByToken = TokenUtil.getNowAccountInfo(); + allOrderInfo.setPayChannel("POS"); + allOrderInfo.setStoreId(accountInfoByToken.getStoreId()); + IPage pageList = allOrderInfoMapper.getPageList(page, allOrderInfo); + for (AllOrderInfoVo record : pageList.getRecords()) { + if ("油品订单".equals(record.getContent())) { + OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(record.getOrderNo()); + OilName oilName = oilNameService.selectOilNameById(Integer.parseInt(oilOrder.getOils())); + record.setOilName(oilName.getOilName()); + record.setShengshu(oilOrder.getOilNum()); + } + } + return pageList; + } + public String sumPayMoney(AllOrderInfo allOrderInfo){ String sumPayMoney = allOrderInfoMapper.sumPayMoney(allOrderInfo); @@ -160,8 +183,8 @@ public class AllOrderInfoServiceImpl extends ServiceImpl sysDepts = sysDeptMapper.selectChildrenDeptById2(new Page(1,10000),nowAccountInfo.getDeptId(),allOrderInfo.getDeptId(),allOrderInfo.getDeptType()); - if (ObjectUtil.isEmpty(sysDepts.getRecords())) throw new RuntimeException("组织下没有油站!"); + if (ObjectUtil.isEmpty(sysDepts.getRecords())) { + throw new RuntimeException("组织下没有油站!"); + } allOrderInfo.setStoreIds(sysDepts.getRecords().stream().map(SysDeptVo::getDeptId).collect(Collectors.toList())); List mtStores = mtStoreMapper.queryStoresByDeptIds(allOrderInfo.getStoreIds()); - if (ObjectUtil.isEmpty(mtStores)) throw new RuntimeException("组织下没有油站"); + if (ObjectUtil.isEmpty(mtStores)) { + throw new RuntimeException("组织下没有油站"); + } allOrderInfo.setStoreIds(mtStores.stream().map(MtStore::getId).map(Long::valueOf).collect(Collectors.toList())); } else { List depts = new ArrayList<>(); @@ -464,12 +491,16 @@ public class AllOrderInfoServiceImpl extends ServiceImpl sysDepts = sysDeptMapper.selectChildrenDeptById2( new Page(1,10000),nowAccountInfo.getDeptId(),allOrderInfo.getDeptId(),allOrderInfo.getDeptType()); - if (ObjectUtil.isEmpty(sysDepts.getRecords())) throw new RuntimeException("组织下没有油站!"); + if (ObjectUtil.isEmpty(sysDepts.getRecords())) { + throw new RuntimeException("组织下没有油站!"); + } allOrderInfo.setStoreIds(sysDepts.getRecords().stream().map(SysDeptVo::getDeptId).collect(Collectors.toList())); List mtStores = mtStoreMapper.queryStoresByDeptIds(allOrderInfo.getStoreIds()); - if (ObjectUtil.isEmpty(mtStores)) throw new RuntimeException("组织下没有油站"); + if (ObjectUtil.isEmpty(mtStores)) { + throw new RuntimeException("组织下没有油站"); + } allOrderInfo.setStoreIds(mtStores.stream().map(MtStore::getId).map(Long::valueOf).collect(Collectors.toList())); } else { List depts = new ArrayList<>(); 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 741a93c4f..e2352a350 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 @@ -124,7 +124,49 @@ public class HandoverRecordServiceImpl implements HandoverRecordService { return this.handoverRecordMapper.deleteById(id) > 0; } - @Override + + public Map handoverByPos(Integer staffId) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + MtStore mtStore = new MtStore(); + try { + mtStore = storeService.queryStoreById2(nowAccountInfo.getStoreId()); + } catch (BusinessCheckException e) { + e.printStackTrace(); + } + // 获取当前日期 + LocalDate today = LocalDate.now(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + // 格式化当前时间 + String formattedEndTime = LocalDateTime.now().format(formatter); + + Map handoverMap = new HashMap<>(); + + String startTime = "2023-01-01 12:12:12"; + + 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()); + } + String handoverType = "POS机交班"; + Integer staff = nowAccountInfo.getStaffId(); + LJStaff ljStaff = iljStaffService.selectStaffById(staff); + + // 填充 baseInfo + Map baseInfo = new HashMap<>(); + baseInfo.put("storeName", mtStore.getName()); + baseInfo.put("realName", ljStaff.getRealName()); + baseInfo.put("handoverType", handoverType); + baseInfo.put("startTime", startTime); + baseInfo.put("endTime", formattedEndTime); + + // 订单查询 + // 订单金额,优惠金额,会员充值,退款金额,实收金额 + return baseInfo; + } + + + @Override public Map handover(Integer staffId) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/vo/AllOrderInfoVo.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/vo/AllOrderInfoVo.java index cfc821232..00dbc84d1 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/vo/AllOrderInfoVo.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/vo/AllOrderInfoVo.java @@ -9,6 +9,7 @@ public class AllOrderInfoVo extends AllOrderInfo { private String userMobile; private String storeName; private String mchntCd; + private String orderStatus; private Double sumPayMoney; //交易金额 @@ -26,6 +27,11 @@ public class AllOrderInfoVo extends AllOrderInfo { + private String oilName; + private Double shengshu; + + + private String CASH; private String WECHAT; private String ALIPAY; diff --git a/pos-uni/pagesHome/BusinessData/BusinessData.vue b/pos-uni/pagesHome/BusinessData/BusinessData.vue index 81d7df504..c3da585e3 100644 --- a/pos-uni/pagesHome/BusinessData/BusinessData.vue +++ b/pos-uni/pagesHome/BusinessData/BusinessData.vue @@ -12,7 +12,10 @@ - + + 营业收入 @@ -104,14 +107,30 @@ titles: "经营数据", startTime: "", endTime: "", + startTimeValue: "", + endTimeValue: "", + showStartTime: false, + showEndTime: false, dataForm: { - } + }, + } }, onShow() { // this.actList = ["1", "1", "1", "1", "1", ] // this.status = "nomore" 底部刷新结束 + let start = new Date(); + start.setHours(0) + start.setMinutes(0) + start.setSeconds(0) + start.setMilliseconds(0) + // formatDateToYYMMDDHHMM(start); + // formatDateToYYMMDDHHMM(new Date()); + this.startTime = this.formatDateToYYMMDDHHMM(start); + this.endTime = this.formatDateToYYMMDDHHMM(new Date()); + // this.startTime = start + // this.endTime = new Date() this.getIndexData() }, onPullDownRefresh() { @@ -131,6 +150,26 @@ goback() { uni.navigateBack() }, + clickStartTime(e) { + this.showStartTime = true + console.log(123, e) + // const date = new Date(timestamp); + + }, + clickEndTime(e) { + this.showEndTime = true + + }, + clickStart(e) { + console.log('123123', e) + this.showStartTime = false + this.startTime = this.formatDateToYYMMDDHHMM(new Date(e.value)); + }, + clickEnd(e) { + this.showEndTime = false + this.startTime = this.formatDateToYYMMDDHHMM(new Date(e.value)); + + }, // 获取销售数据 getIndexData() { request({ @@ -147,8 +186,38 @@ }) } }) + }, + formatTimestamp(timestamp) { + // const date = new Date(Number(timestamp)); + // const year = date.getFullYear(); + // const month = String(date.getMonth() + 1).padStart(2, '0'); + // const day = String(date.getDate()).padStart(2, '0'); + // const hours = String(date.getHours()).padStart(2, '0'); + // const minutes = String(date.getMinutes()).padStart(2, '0'); + // const seconds = String(date.getSeconds()).padStart(2, '0'); + + // return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; + }, + formatDateToYYMMDDHHMM(date) { + const year = String(date.getFullYear()); // 获取两位数的年份 + const month = String(date.getMonth() + 1).padStart(2, '0'); // 获取月份,并确保是两位数 + const day = String(date.getDate()).padStart(2, '0'); // 获取日期,并确保是两位数 + const hours = String(date.getHours()).padStart(2, '0'); // 获取小时,并确保是两位数 + const minutes = String(date.getMinutes()).padStart(2, '0'); // 获取分钟,并确保是两位数 + + // return `${year}/${month}/${day} ${hours}:${minutes}`; + return `${year}/${month}/${day}`; } - } + + }, + watch: { + // startTime(newVal) { + // this.startTime = this.formatTimestamp(newVal); + // }, + // endTime(newVal) { + // this.endTime = this.formatTimestamp(newVal); + // } + }, } diff --git a/pos-uni/pagesHome/changeShifts/changeShifts.vue b/pos-uni/pagesHome/changeShifts/changeShifts.vue index e2a7abc37..c4a20fa5b 100644 --- a/pos-uni/pagesHome/changeShifts/changeShifts.vue +++ b/pos-uni/pagesHome/changeShifts/changeShifts.vue @@ -3,9 +3,10 @@ - 收银员:李莎 + 收银员:{{ handoverList && handoverList.baseInfo ? handoverList.baseInfo.realName : '未知姓名' }} + - 今日累计:¥400.00 + 今日累计:¥{{indexData.totalPayMoney}} 交班记录 @@ -18,16 +19,28 @@ 员工交接单 - 门店:京博加油站璃月分站 - 上班时间:2024-05-13 08:30 - 下班时间:2024-05-13 17:30 - 交班模式:门店统一交班 + 门店:{{handoverList && handoverList.baseInfo ? handoverList.baseInfo.storeName : '-'}} + + + 上班时间:{{ handoverList && handoverList.baseInfo ? handoverList.baseInfo.startTime : '-' }} + + 下班时间:{{ handoverList && handoverList.baseInfo ? handoverList.baseInfo.endTime : '-' }} - 订单金额:100.00 - 优惠金额:0.00 - 会员充值:300.00 - 退款金额:0.00 - 实收金额:400.00 + + 订单金额:{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.oilOrder : 0+ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardOrder : 0 }} + + + 优惠金额:{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.oilDiacount : 0 }} + + + 会员充值:{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardPaid : 0 }} + + + 退款金额:{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.oilRefund : 0 + handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardRefund : 0 }} + + + 实收金额:{{ (Number)(handoverList && handoverList.orderSummary ? handoverList.orderSummary.oilPaid : 0) + (Number)(handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardPaid : 0) }} + @@ -41,18 +54,27 @@