diff --git a/ms-biz/src/main/java/com/ms/api/bo/DsPurchaseSettingBo.java b/ms-biz/src/main/java/com/ms/api/bo/DsPurchaseSettingBo.java new file mode 100644 index 00000000..cda0323c --- /dev/null +++ b/ms-biz/src/main/java/com/ms/api/bo/DsPurchaseSettingBo.java @@ -0,0 +1,7 @@ +package com.ms.api.bo; + +import lombok.Data; + +@Data +public class DsPurchaseSettingBo { +} diff --git a/ms-api/src/main/java/com/ms/api/dto/order/PurchaseSettingDTO.java b/ms-biz/src/main/java/com/ms/api/bo/PurchaseSettingBO.java similarity index 93% rename from ms-api/src/main/java/com/ms/api/dto/order/PurchaseSettingDTO.java rename to ms-biz/src/main/java/com/ms/api/bo/PurchaseSettingBO.java index 68a75627..57dd0426 100644 --- a/ms-api/src/main/java/com/ms/api/dto/order/PurchaseSettingDTO.java +++ b/ms-biz/src/main/java/com/ms/api/bo/PurchaseSettingBO.java @@ -1,9 +1,9 @@ -package com.ms.api.dto.order; +package com.ms.api.bo; import lombok.Data; @Data -public class PurchaseSettingDTO { +public class PurchaseSettingBO { /** * 是否自动同步采购信息到商家备注 */ diff --git a/ms-biz/src/main/java/com/ms/api/service/PurchaseOrderService.java b/ms-biz/src/main/java/com/ms/api/service/PurchaseOrderService.java index f0b7ca9c..2a9b3c26 100644 --- a/ms-biz/src/main/java/com/ms/api/service/PurchaseOrderService.java +++ b/ms-biz/src/main/java/com/ms/api/service/PurchaseOrderService.java @@ -1,5 +1,7 @@ package com.ms.api.service; +import com.ms.api.bo.DsPurchaseSettingBo; +import com.ms.api.bo.PurchaseSettingBO; import com.ms.api.common.Pager; import com.ms.api.dto.order.SearchDsOrderFilterDTO; import com.ms.dal.entity.OpOrder; @@ -23,4 +25,10 @@ public interface PurchaseOrderService { int updateByPrimaryKey(PurchaseOrder record); Pager searchDsOrderList(String shopId, Integer page, Integer pageSize, SearchDsOrderFilterDTO filter, Boolean isEnsconceString, Boolean needOutstorageResult); + + PurchaseSettingBO getPurchaseSetting(Long shopId); + + boolean savePurchaseSetting(Long shopId, PurchaseSettingBO purchaseSettingBO); + + DsPurchaseSettingBo getDsPurchaseSettingByShopId(Long shopId); } diff --git a/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderServiceImpl.java b/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderServiceImpl.java index a244e5ae..d3645597 100644 --- a/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderServiceImpl.java @@ -9,6 +9,8 @@ import com.doudian.open.api.order_BatchSearchIndex.data.OrderBatchSearchIndexDat import com.doudian.open.api.order_BatchSearchIndex.data.PlainToEncryptIndexListItem; import com.doudian.open.api.order_BatchSearchIndex.param.OrderBatchSearchIndexParam; import com.doudian.open.api.order_BatchSearchIndex.param.PlainTextListItem; +import com.ms.api.bo.DsPurchaseSettingBo; +import com.ms.api.bo.PurchaseSettingBO; import com.ms.api.common.Pager; import com.ms.api.consts.*; import com.ms.api.dto.order.PurchaseSettingDTO; @@ -488,7 +490,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { return rows.stream().collect(Collectors.toMap(PurchaseOrderSetting::getPurchaseOrderId, x -> x)); } - public PurchaseSettingDTO getPurchaseSetting(Long shopId) { + public PurchaseSettingBO getPurchaseSetting(Long shopId) { PurchaseSetting purchaseSetting = purchaseSettingMapper.selectByShopId(shopId); // boolean isNewestVersion = purchaseSetting.version = PurchaseOrderConst.CURRENT_PURCHASE_SETTING_VERSION; @@ -521,28 +523,33 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { autoFillOrderMemoTpl = purchaseSetting.getAutoFillOrderMemoTpl(); } - PurchaseSettingDTO purchaseSettingDTO = new PurchaseSettingDTO(); - purchaseSettingDTO.setIsAppendShopRemark(isAppendShopRemark); - purchaseSettingDTO.setIsAppendShopNote(isAppendShopNote); - purchaseSettingDTO.setIsAutoFillRemark(isAutoFillRemark); - purchaseSettingDTO.setIsAutoFillOrderMemo(isAutoFillOrderMemo); - purchaseSettingDTO.setAppendShopRemarkTpl(appendShopRemarkTpl); - purchaseSettingDTO.setAppendShopNoteTpl(appendShopNoteTpl); - purchaseSettingDTO.setAutoFillRemarkTpl(autoFillRemarkTpl); - purchaseSettingDTO.setAutoFillOrderMemoTpl(autoFillOrderMemoTpl); + PurchaseSettingBO purchaseSettingBO = new PurchaseSettingBO(); + purchaseSettingBO.setIsAppendShopRemark(isAppendShopRemark); + purchaseSettingBO.setIsAppendShopNote(isAppendShopNote); + purchaseSettingBO.setIsAutoFillRemark(isAutoFillRemark); + purchaseSettingBO.setIsAutoFillOrderMemo(isAutoFillOrderMemo); + purchaseSettingBO.setAppendShopRemarkTpl(appendShopRemarkTpl); + purchaseSettingBO.setAppendShopNoteTpl(appendShopNoteTpl); + purchaseSettingBO.setAutoFillRemarkTpl(autoFillRemarkTpl); + purchaseSettingBO.setAutoFillOrderMemoTpl(autoFillOrderMemoTpl); if (purchaseSetting == null) { - savePurchaseSetting(shopId, purchaseSettingDTO); + savePurchaseSetting(shopId, purchaseSettingBO); } - return purchaseSettingDTO; + return purchaseSettingBO; } - public boolean savePurchaseSetting(Long shopId, PurchaseSettingDTO purchaseSettingDTO) { + public boolean savePurchaseSetting(Long shopId, PurchaseSettingBO purchaseSettingBO) { // todo: return false; } + + public DsPurchaseSettingBo getDsPurchaseSettingByShopId(Long shopId) { + // todo: + return null; + } } diff --git a/ms-biz/src/main/java/com/ms/api/spi/order/GetPurchaseSettingService.java b/ms-biz/src/main/java/com/ms/api/spi/order/GetPurchaseSettingService.java index 83819fcd..020136fb 100644 --- a/ms-biz/src/main/java/com/ms/api/spi/order/GetPurchaseSettingService.java +++ b/ms-biz/src/main/java/com/ms/api/spi/order/GetPurchaseSettingService.java @@ -4,18 +4,35 @@ import com.jinritemai.cloud.base.api.BaseRequest; import com.jinritemai.cloud.base.api.BaseResponse; import com.jinritemai.cloud.base.api.ExtensionService; import com.jinritemai.cloud.base.api.ExtensionServiceHandler; +import com.ms.api.bo.PurchaseSettingBO; import com.ms.api.common.SPIBaseService; import com.ms.api.dto.order.GetPurchaseSettingResponseDTO; +import com.ms.api.dto.order.PurchaseSettingDTO; +import com.ms.api.service.PurchaseOrderService; +import com.ms.api.util.PurchaseOrderUtil; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; @ExtensionService("getPurchaseSetting") @Slf4j @AllArgsConstructor public class GetPurchaseSettingService extends SPIBaseService implements ExtensionServiceHandler { + + @Autowired + private PurchaseOrderUtil purchaseOrderUtil; + + @Autowired + private PurchaseOrderService purchaseOrderService; + @Override public BaseResponse handle(BaseRequest req) { // GetPurchaseSettingRequestDTO requestDTO = req.getData(); + // todo: 获取shopid + Long shopId = 0L; + PurchaseSettingBO purchaseSettingBO = purchaseOrderUtil.getPurchaseSetting(shopId); + + return null; } } diff --git a/ms-biz/src/main/java/com/ms/api/util/PurchaseOrderUtil.java b/ms-biz/src/main/java/com/ms/api/util/PurchaseOrderUtil.java index 0c57a1ab..277004b6 100644 --- a/ms-biz/src/main/java/com/ms/api/util/PurchaseOrderUtil.java +++ b/ms-biz/src/main/java/com/ms/api/util/PurchaseOrderUtil.java @@ -10,20 +10,24 @@ import cn.hutool.core.lang.Validator; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.jinritemai.cloud.base.api.BaseResponse; +import com.ms.api.bo.PurchaseSettingBO; import com.ms.api.common.R; import com.ms.api.consts.DsOrderConst; import com.ms.api.consts.OrderConst; import com.ms.api.consts.PurchaseOrderConst; import com.ms.api.consts.SessionConst; -import com.ms.api.dto.order.OriginalAndCustomConsigneeInfoRequestDTO; -import com.ms.api.dto.order.OriginalAndCustomConsigneeInfoResponseDTO; -import com.ms.api.dto.order.SearchDsOrderFilterDTO; -import com.ms.api.dto.order.SearchDsOrderListRequestDTO; +import com.ms.api.dto.order.*; +import com.ms.api.service.PurchaseOrderService; import com.ms.api.tool.CommonTool; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; - +@Component public class PurchaseOrderUtil { + @Autowired + private PurchaseOrderService purchaseOrderService; + private OriginalAndCustomConsigneeInfoResponseDTO getOriginalAndCustomConsigneeInfo(OriginalAndCustomConsigneeInfoRequestDTO requestDTO) { return new OriginalAndCustomConsigneeInfoResponseDTO(); } @@ -211,8 +215,8 @@ public class PurchaseOrderUtil { return params; } - public int getPurchaseSetting(Long operateShopId) { - return 0; + public PurchaseSettingBO getPurchaseSetting(Long operateShopId) { + return purchaseOrderService.getPurchaseSetting(operateShopId); } }