|
|
@@ -11,6 +11,7 @@ import com.ydtech.constants.enums.inv.InvoiceTypeEnum;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.core.page.PageRequest;
|
|
|
import com.ydtech.exception.SystemException;
|
|
|
+import com.ydtech.modules.admin.constants.BusinessTypeEnum;
|
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
|
import com.ydtech.modules.inv.dao.InvAccountIncoiceMapper;
|
|
|
import com.ydtech.modules.inv.model.*;
|
|
|
@@ -381,6 +382,11 @@ public class InvAccountIncoiceServiceImpl extends ServiceImpl<InvAccountIncoiceM
|
|
|
invAccountIncoice.setRate(invAccountIncoice.getRate() + "%");
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ if (!StringUtils.isNullOrEmpty(invAccountIncoices) && invAccountIncoices.size() > 0) {
|
|
|
+ matchBusinessQuality(invAccountIncoices);
|
|
|
+ }
|
|
|
+
|
|
|
File folder = new File(uploadFilePath);
|
|
|
if (folder.exists()) {
|
|
|
return EasyExcelUtils.downExcel(uploadFilePath, InvAccountIncoice.class, invAccountIncoices);
|
|
|
@@ -455,7 +461,9 @@ public class InvAccountIncoiceServiceImpl extends ServiceImpl<InvAccountIncoiceM
|
|
|
lambdaQuery.orderByDesc(InvAccountIncoice::getInvoiceTime);
|
|
|
|
|
|
Page<InvAccountIncoice> invAccountIncoicePage = page(page, lambdaQuery);
|
|
|
-
|
|
|
+ if (!StringUtils.isNullOrEmpty(invAccountIncoicePage.getRecords()) && invAccountIncoicePage.getRecords().size() > 0) {
|
|
|
+ invAccountIncoicePage.setRecords(matchBusinessQuality(invAccountIncoicePage.getRecords()));
|
|
|
+ }
|
|
|
/**
|
|
|
* 合计
|
|
|
*/
|
|
|
@@ -502,5 +510,31 @@ public class InvAccountIncoiceServiceImpl extends ServiceImpl<InvAccountIncoiceM
|
|
|
return invAccountIncoiceMapper.selectList(lambdaQuery);
|
|
|
}
|
|
|
|
|
|
+ public List<InvAccountIncoice> matchBusinessQuality(List<InvAccountIncoice> invAccountIncoices) {
|
|
|
+ List<String> accountIdList = invAccountIncoices
|
|
|
+ .stream()
|
|
|
+ .filter(account -> !StringUtils.isNullOrEmpty(account) && StringUtils.isNotEmpty(account.getAccountId()))
|
|
|
+ .map(InvAccountIncoice::getAccountId)
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ LambdaQueryWrapper<InvAccount> invAccountIncoiceSQL = new LambdaQueryWrapper<InvAccount>()
|
|
|
+ .in(InvAccount::getAccountId, accountIdList);
|
|
|
+ List<InvAccount> invAccountList = invAccountService.list(invAccountIncoiceSQL);
|
|
|
+ invAccountIncoices
|
|
|
+ .stream()
|
|
|
+ .filter(invaccount -> !StringUtils.isNullOrEmpty(invaccount) && StringUtils.isNotEmpty(invaccount.getAccountId()))
|
|
|
+ .forEach(invaccount -> {
|
|
|
+ invAccountList
|
|
|
+ .stream()
|
|
|
+ .filter(account -> !StringUtils.isNullOrEmpty(account) && StringUtils.isNotEmpty(account.getBusinessQuality()))
|
|
|
+ .forEach(account -> {
|
|
|
+ if (invaccount.getAccountId().equals(account.getAccountId())) {
|
|
|
+ invaccount.setBusinessQuality(BusinessTypeEnum.getBusinessType(account.getBusinessQuality()));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return invAccountIncoices;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|