|
|
@@ -1,6 +1,7 @@
|
|
|
package com.txz.cif.dubbo.client;
|
|
|
|
|
|
|
|
|
+import com.txz.cif.dto.RecycleInfoDTO;
|
|
|
import com.txz.operating.dto.ConfigDTO;
|
|
|
import com.txz.operating.result.Result;
|
|
|
import com.txz.operating.service.OperatingConfigDubboService;
|
|
|
@@ -8,14 +9,30 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.Reference;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
+
|
|
|
@Slf4j
|
|
|
@Component
|
|
|
public class OperatingConfigDubboServiceClient {
|
|
|
-
|
|
|
+
|
|
|
@Reference
|
|
|
private OperatingConfigDubboService operatingConfigDubboService;
|
|
|
-
|
|
|
- public Result<ConfigDTO> getConfigByCode(String code){
|
|
|
+
|
|
|
+ public Result<ConfigDTO> getConfigByCode(String code) {
|
|
|
return operatingConfigDubboService.getConfigByCode(code);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取回收信息
|
|
|
+ */
|
|
|
+ public RecycleInfoDTO getRecycleInfo() {
|
|
|
+ BigDecimal recycleProportion = new BigDecimal(this.getConfigByCode("recycle_proportion").getData().getValueInfo());
|
|
|
+ BigDecimal successTotalOrderNum = new BigDecimal(this.getConfigByCode("success_total_order_num").getData().getValueInfo());
|
|
|
+ BigDecimal recycleNum = new BigDecimal(this.getConfigByCode("recycle_num").getData().getValueInfo());
|
|
|
+ return RecycleInfoDTO.builder()
|
|
|
+ .recycleProportion(recycleProportion)
|
|
|
+ .successTotalOrderNum(successTotalOrderNum)
|
|
|
+ .recycleNum(recycleNum)
|
|
|
+ .build();
|
|
|
+ }
|
|
|
}
|