Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
5bd6bfd66f
|
|
@ -1,8 +1,11 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.account.dto.ShopBranchDTO;
|
||||
import com.czg.account.entity.ShopConfig;
|
||||
import com.czg.account.enums.BranchDataSyncMethodEnum;
|
||||
import com.czg.account.param.ShopBranchParam;
|
||||
import com.czg.account.service.ShopBranchService;
|
||||
import com.czg.account.service.ShopConfigService;
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
|
|
@ -22,6 +25,8 @@ public class ShopBranchController {
|
|||
|
||||
@Resource
|
||||
private ShopBranchService shopBranchService;
|
||||
@Resource
|
||||
private ShopConfigService shopConfigService;
|
||||
|
||||
/**
|
||||
* 分店列表
|
||||
|
|
@ -86,4 +91,16 @@ public class ShopBranchController {
|
|||
shopBranchService.accountDisable(branchShopId);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据同步方式
|
||||
* @return 数据同步方式 auto-实时自动同步 manual-手动同步
|
||||
*/
|
||||
@GetMapping("/get/dataSyncMethod")
|
||||
@OperationLog("分店管理-获取数据同步方式")
|
||||
public CzgResult<String> getDataSyncMethod() {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
ShopConfig shopConfig = shopConfigService.getById(shopId);
|
||||
return CzgResult.success(shopConfig == null? BranchDataSyncMethodEnum.AUTO.getValue() : shopConfig.getBranchDataSyncMethod());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package com.czg.account.param;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 分店查询入参
|
||||
* @author tankaikai
|
||||
* @since 2025-04-07 18:02
|
||||
*/
|
||||
@Data
|
||||
public class ShopBranchParam implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 分店名称
|
||||
*/
|
||||
private String branchShopName;
|
||||
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private Long shopId;
|
||||
}
|
||||
|
|
@ -23,7 +23,6 @@ import lombok.NoArgsConstructor;
|
|||
* @since 2025-02-13
|
||||
*/
|
||||
@Data
|
||||
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_order_info")
|
||||
|
|
@ -128,6 +127,10 @@ public class OrderInfo implements Serializable {
|
|||
* 台桌名称
|
||||
*/
|
||||
private String tableName;
|
||||
/**
|
||||
* 退款方式 现金退款-cash 原路退回-payBack
|
||||
*/
|
||||
private String refundType;
|
||||
|
||||
/**
|
||||
* 订单类型-
|
||||
|
|
|
|||
|
|
@ -71,6 +71,10 @@ public class OrderInfoVo implements Serializable {
|
|||
* miniapp小程序
|
||||
*/
|
||||
private String orderType;
|
||||
/**
|
||||
* 退款方式 现金退款-cash 原路退回-payBack
|
||||
*/
|
||||
private String refundType;
|
||||
|
||||
/**
|
||||
* 平台类型 pc 收银机客户端 wechat 微信小程序 alipay 支付宝小程序 admin-pc PC管理端 admin-app APP管理端
|
||||
|
|
|
|||
|
|
@ -667,7 +667,9 @@ public class PayServiceImpl implements PayService {
|
|||
refundOrder(orderInfo.getShopId(), orderInfo.getId(), orderInfo.getPayOrderId(),
|
||||
refPayOrderNo, StrUtil.isBlank(param.getRefundReason()) ? "退款" : param.getRefundReason(), param.getRefundAmount());
|
||||
}
|
||||
orderInfo.setRefundType("payBack");
|
||||
}
|
||||
orderInfo.setRefundType("cash");
|
||||
} else {
|
||||
orderInfo.setOrderAmount(orderInfo.getOrderAmount().subtract(param.getRefundAmount()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,23 +4,17 @@ import cn.hutool.core.bean.BeanUtil;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.account.entity.ShopInfo;
|
||||
import com.czg.account.entity.SysRole;
|
||||
import com.czg.account.service.ShopInfoService;
|
||||
import com.czg.account.service.SyncNoticeService;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.product.entity.*;
|
||||
import com.czg.product.service.*;
|
||||
import com.czg.product.vo.ProductGroupVo;
|
||||
import com.czg.service.product.mapper.ConsInfoMapper;
|
||||
import com.czg.service.product.mapper.ProdConsRelationMapper;
|
||||
import com.czg.service.product.mapper.ProdSkuMapper;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -31,7 +25,6 @@ import java.util.Map;
|
|||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.mybatisflex.core.query.QueryMethods.column;
|
||||
|
||||
|
|
@ -64,6 +57,8 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
|||
private ConsGroupService consGroupService;
|
||||
@Resource
|
||||
private ProdConsRelationService prodConsRelationService;
|
||||
@Resource
|
||||
private SyncNoticeService syncNoticeService;
|
||||
|
||||
private void checkShopInfo(Long sourceShopId, Long targetShopId) {
|
||||
AssertUtil.isNull(sourceShopId, "{}不能为空", "源店铺ID");
|
||||
|
|
@ -78,6 +73,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
|||
|| targetShop.getIsHeadShop() == null || targetShop.getIsHeadShop().equals(1)) {
|
||||
throw new CzgException("同步失败,目标店铺是主店铺或目标店铺是单店");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue