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/api/fuyou/entity/Const.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Const.java index fc1531ef8..c69471fc9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Const.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Const.java @@ -49,8 +49,8 @@ public class Const { public static String NOTIFY_PUBLIC_KEYS="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbBAl3xSB7YeUnze4yYZmnTeT7OtXZr0sP10TsDVRH2SY/VEjgS9KPmHMmVeKZT3+6xKsUvulgVyie46GGtZPrnoh+glF1gzsYAXJ7dvR/R5nYO5VvfwK/ChPFTiKhbTtO4OKtchgBZuqCbsemG+gFIiVJo37dY0Kg0zISmFHdOQIDAQAB"; //异步通知(回调地址) -// public static String notify_url = "https://www.tuofeng.cc/oilAdmin/api/fyPay/notify"; - public static String notify_url = "https://8q4f124343.yicp.fun/api/fyPay/notify"; + public static String notify_url = "https://www.tuofeng.cc/oilAdmin/api/fyPay/notify"; +// public static String notify_url = "https://8q4f124343.yicp.fun/api/fyPay/notify"; //下单 public static String fuiou_21_url = "https://fundwx.fuiou.com/preCreate"; 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/member/service/impl/LJStaffServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java index 66788ef4f..f7f8b62a9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java @@ -269,6 +269,18 @@ public class LJStaffServiceImpl extends ServiceImpl impl e.printStackTrace(); } } + }else { + TAccount tAccount = accountService.selectAccountByStaffId(staff.getId()); + if (ObjectUtil.isNotEmpty(tAccount)) { + if (tAccount.getAccountName().matches("\\d+")) { + tAccount.setAccountName(staff.getMobile()); + } + try { + accountService.editAccount(tAccount, null); + } catch (Exception e) { + e.printStackTrace(); + } + } } return row; } 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/entity/OrderGoods.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/OrderGoods.java index c47611296..00e63a005 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/OrderGoods.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/OrderGoods.java @@ -38,6 +38,23 @@ public class OrderGoods extends BaseEntity implements Serializable { * 商品数量 */ private Integer num; + /** + * 商品单价 + */ + private Double retailPrice; + /** + * 商品会员价 + */ + private Double memberPrice; + /** + * 商品合计金额 + */ + private Double allAmount; + /** + * 商品实付金额 + */ + private Double payAmount; + } 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/CashierOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CashierOrderMapper.xml index 04a6fee07..80bbf4193 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CashierOrderMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CashierOrderMapper.xml @@ -99,6 +99,48 @@ ) AS numberOfStrokes, -- 笔数 + (SELECT count(*) FROM cashier_order + + store_id = #{order.storeId} + and oil_order_id is not null + + and staff_id = #{order.staffId} + + + and order_no like concat('%', #{order.orderNo}, '%') + + + and terminal like concat('%', #{order.terminal}, '%') + + + and date_format(pay_time,'%y%m%d') >= date_format(#{order.params.beginTime},'%y%m%d') + + + and date_format(pay_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d') + + + ) AS numberOfStrokesByOil, -- 笔数 + (SELECT count(*) FROM cashier_order + + store_id = #{order.storeId} + and goods_order_id is not null + + and staff_id = #{order.staffId} + + + and order_no like concat('%', #{order.orderNo}, '%') + + + and terminal like concat('%', #{order.terminal}, '%') + + + and date_format(pay_time,'%y%m%d') >= date_format(#{order.params.beginTime},'%y%m%d') + + + and date_format(pay_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d') + + + ) AS numberOfStrokesByGoods, -- 笔数 (SELECT sum(amount) FROM cashier_order store_id = #{order.storeId} 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/mapper/xml/OrderGoodsMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OrderGoodsMapper.xml index 395da0293..1199a20e9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OrderGoodsMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OrderGoodsMapper.xml @@ -2,7 +2,8 @@ - select mog.id,mog.order_id,mog.goods_id as goods_id,mg.id as goodsId,mg.name,mg.retail_price,mg.member_price,mog.num,mg.unit + select mog.id,mog.order_id,mog.goods_id as goods_id,mg.id as goodsId,mg.name,mog.retail_price, + mog.member_price,mog.num,mg.unit,mog.all_amount,mog.pay_amount from mt_order_goods mog inner join mt_goods mg on mog.goods_id = mg.id 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/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 6ede16b6d..8a29a3732 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 @@ -6,6 +6,8 @@ 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.convenienceSore.entity.LJGoods; +import com.fuint.business.convenienceSore.service.LJGoodsService; import com.fuint.business.order.entity.LJOrder; import com.fuint.business.order.entity.OrderGoods; import com.fuint.business.order.mapper.LJOrderMapper; @@ -122,6 +124,9 @@ public class LJOrderServiceImpl extends ServiceImpl impl return baseMapper.getStatisticsByTime(time, goodsId, payType); } + @Autowired + private LJGoodsService goodsService; + @Override public void addGoodOrder(LJOrder order,Integer goodsId) { if (ObjectUtil.isEmpty(order.getOrderNo())){ @@ -134,10 +139,15 @@ public class LJOrderServiceImpl extends ServiceImpl impl } baseMapper.insert(order); LJOrder ljOrder = this.selectGoodsOrder(order.getOrderNo()); + LJGoods ljGoods = goodsService.selectLJGoodsById(goodsId); OrderGoods orderGoods = new OrderGoods(); orderGoods.setGoodsId(goodsId); orderGoods.setOrderId(ljOrder.getId()); orderGoods.setNum(ljOrder.getGoodsNum()); + orderGoods.setRetailPrice(ljGoods.getRetailPrice()); + orderGoods.setMemberPrice(ljGoods.getMemberPrice()); + orderGoods.setAllAmount(order.getAmount()); + orderGoods.setPayAmount(order.getPayAmount()); orderGoodsService.save(orderGoods); } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java index a06a6aa5a..2afe2deb1 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java @@ -521,6 +521,7 @@ public class OilOrderServiceImpl extends ServiceImpl i // throw new RuntimeException("支付失败"); } }else { + cashierOrder.setPayAmount(oilAmount+goodsAmount-oilDiscount-goodsDiscount); this.insertAllOrderInfo(orderNo,storeId,oilAmount+goodsAmount,Double.valueOf(map.get("allAmount")),payType,userId,"PC","6","paid"); } 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 79562e954..65c6caa0d 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 @@ -40,6 +40,15 @@ public class OrderGoodsServiceImpl extends ServiceImpl¥{{ 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 bb9b03c29..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) : "--"}}