|
@@ -12,6 +12,7 @@ import com.usoftchina.saas.exception.BizException;
|
|
|
import com.usoftchina.saas.sale.dto.apcheck.SaveOperationData;
|
|
import com.usoftchina.saas.sale.dto.apcheck.SaveOperationData;
|
|
|
import com.usoftchina.saas.sale.service.ApCheckService;
|
|
import com.usoftchina.saas.sale.service.ApCheckService;
|
|
|
import com.usoftchina.saas.utils.JsonUtils;
|
|
import com.usoftchina.saas.utils.JsonUtils;
|
|
|
|
|
+import com.usoftchina.saas.utils.ObjectUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -30,6 +31,8 @@ public class ApCheckServiceImpl implements ApCheckService {
|
|
|
private String b2bUrl;
|
|
private String b2bUrl;
|
|
|
|
|
|
|
|
private final static String SAVEAPCHECKURL = "/sale/apCheck/operation/save";
|
|
private final static String SAVEAPCHECKURL = "/sale/apCheck/operation/save";
|
|
|
|
|
+ private final static String CUSTAPCHECKURL = "/sale/apCheck/customer";
|
|
|
|
|
+ private final static String GETALLBYKEYWORDSURL = "/sale/apCheck/getAllByKeywords";
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private AccountApi accountApi;
|
|
private AccountApi accountApi;
|
|
@@ -45,7 +48,7 @@ public class ApCheckServiceImpl implements ApCheckService {
|
|
|
account.setAppId("SAAS");
|
|
account.setAppId("SAAS");
|
|
|
account.setUserUU(userUU);
|
|
account.setUserUU(userUU);
|
|
|
account.setSpaceUU(enUU);
|
|
account.setSpaceUU(enUU);
|
|
|
- String getUrl = b2bUrl + "/sale/apCheck/customer?count=" + count + "&page=" + page + "&searchFilter=" + searchFilter + " &sorting=" + sorting;
|
|
|
|
|
|
|
+ String getUrl = b2bUrl + CUSTAPCHECKURL + "?count=" + count + "&page=" + page + "&searchFilter=" + searchFilter + " &sorting=" + sorting;
|
|
|
String result = null;
|
|
String result = null;
|
|
|
try {
|
|
try {
|
|
|
result = AccessUtils.getForObject(getUrl, account, String.class);
|
|
result = AccessUtils.getForObject(getUrl, account, String.class);
|
|
@@ -57,7 +60,32 @@ public class ApCheckServiceImpl implements ApCheckService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String getAllByKeywords(Long fromDate, Long endDate, Long customerUU, Double taxRate, String factory, String prodTitle, String suuorname, String prodSpec) {
|
|
public String getAllByKeywords(Long fromDate, Long endDate, Long customerUU, Double taxRate, String factory, String prodTitle, String suuorname, String prodSpec) {
|
|
|
- return null;
|
|
|
|
|
|
|
+ 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 + GETALLBYKEYWORDSURL + "?fromDate=" + fromDate + "&endDate=" + endDate + "&customerUU=" + customerUU + "&suuorname=" + suuorname;
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(taxRate)){
|
|
|
|
|
+ getUrl += "&taxRate=" + taxRate;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(factory)){
|
|
|
|
|
+ getUrl += "&factory=" + factory;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(prodTitle)){
|
|
|
|
|
+ getUrl += "&prodTitle=" + prodTitle;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(prodSpec)){
|
|
|
|
|
+ getUrl += "&prodSpec=" + prodSpec;
|
|
|
|
|
+ }
|
|
|
|
|
+ String result = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ result = AccessUtils.getForObject(getUrl, account, String.class);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ throw new BizException(80000, e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -86,6 +114,19 @@ public class ApCheckServiceImpl implements ApCheckService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String apCheckInfo(Long id) {
|
|
public String apCheckInfo(Long id) {
|
|
|
|
|
+ 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 url = b2bUrl + "/sale/apCheck/" + id + "/info";
|
|
|
|
|
+ String result = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ result = AccessUtils.getForObject(url, account, String.class);
|
|
|
|
|
+ } catch (Exception e){
|
|
|
|
|
+ throw new BizException(80000, e.getMessage());
|
|
|
|
|
+ }
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|