|
|
@@ -0,0 +1,62 @@
|
|
|
+package com.usoftchina.saas.sale.service.impl;
|
|
|
+
|
|
|
+import com.usoft.b2b.access.entity.UserAccount;
|
|
|
+import com.usoft.b2b.access.utils.AccessUtils;
|
|
|
+import com.usoftchina.saas.account.api.AccountApi;
|
|
|
+import com.usoftchina.saas.account.api.CompanyApi;
|
|
|
+import com.usoftchina.saas.context.BaseContextHolder;
|
|
|
+import com.usoftchina.saas.exception.BizException;
|
|
|
+import com.usoftchina.saas.sale.dto.apcheck.SaveOperationData;
|
|
|
+import com.usoftchina.saas.sale.service.ApCheckService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.ui.ModelMap;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Author chenwei
|
|
|
+ * @Date 2019/01/28
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class ApCheckServiceImpl implements ApCheckService {
|
|
|
+
|
|
|
+ @Value("${b2b.baseUrl.common}")
|
|
|
+ private String b2bUrl;
|
|
|
+ @Autowired
|
|
|
+ private AccountApi accountApi;
|
|
|
+ @Autowired
|
|
|
+ private CompanyApi companyApi;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String getCustApcheck(int count, int page, String searchFilter, String sorting) {
|
|
|
+ Long userUU = accountApi.getAccountById(BaseContextHolder.getUserId()).getData().getUu();
|
|
|
+ Long enUU = companyApi.getCompanyById(BaseContextHolder.getCompanyId()).getData().getUu();
|
|
|
+ UserAccount account = new UserAccount();
|
|
|
+ account.setAppId("SAAS");
|
|
|
+ account.setUserUU(userUU);
|
|
|
+ account.setSpaceUU(enUU);
|
|
|
+ String getUrl = b2bUrl + "/sale/apCheck/customer?count=" + count + "&page=" + page + "&searchFilter=" + searchFilter + " &sorting=" + sorting;
|
|
|
+ String result = null;
|
|
|
+ try {
|
|
|
+ result = AccessUtils.getForObject(getUrl, account, String.class);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new BizException(80000, e.getMessage());
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String getAllByKeywords(Long fromDate, Long endDate, Long customerUU, Double taxRate, String factory, String prodTitle, String suuorname, String prodSpec) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ModelMap operationSave(SaveOperationData saveOperationData) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String apCheckInfo(Long id) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+}
|