|
@@ -22,7 +22,6 @@ import com.fjhx.customer.entity.customer.po.Customer;
|
|
import com.fjhx.customer.entity.customer.vo.CustomerVo;
|
|
import com.fjhx.customer.entity.customer.vo.CustomerVo;
|
|
import com.fjhx.customer.service.customer.CustomerService;
|
|
import com.fjhx.customer.service.customer.CustomerService;
|
|
import com.fjhx.flow.service.flow.FlowExampleService;
|
|
import com.fjhx.flow.service.flow.FlowExampleService;
|
|
-import com.fjhx.sale.entity.contract.vo.ContractProductVo;
|
|
|
|
import com.fjhx.sale.entity.contract.vo.ContractVo;
|
|
import com.fjhx.sale.entity.contract.vo.ContractVo;
|
|
import com.fjhx.sale.entity.quotation.po.QuotationPay;
|
|
import com.fjhx.sale.entity.quotation.po.QuotationPay;
|
|
import com.fjhx.sale.entity.quotation.po.QuotationProduct;
|
|
import com.fjhx.sale.entity.quotation.po.QuotationProduct;
|
|
@@ -109,9 +108,9 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
|
|
|
|
|
|
// 赋值用户名称
|
|
// 赋值用户名称
|
|
UserUtil.assignmentNickName(saleQuotationVoList, BasePo::getCreateUser, SaleQuotationVo::setUserName);
|
|
UserUtil.assignmentNickName(saleQuotationVoList, BasePo::getCreateUser, SaleQuotationVo::setUserName);
|
|
- // 赋值买方公司名称
|
|
|
|
- corporationService.attributeAssign(saleQuotationVoList, SaleQuotationVo::getBuyCorporationId, (item, corporation) -> {
|
|
|
|
- item.setBuyCorporationName(corporation.getName());
|
|
|
|
|
|
+ // 赋值买方公司名称(客户)
|
|
|
|
+ customerService.attributeAssign(saleQuotationVoList, SaleQuotationVo::getBuyCorporationId, (item, customer) -> {
|
|
|
|
+ item.setBuyCorporationName(customer.getName());
|
|
});
|
|
});
|
|
// 赋值卖方公司名称
|
|
// 赋值卖方公司名称
|
|
corporationService.attributeAssign(saleQuotationVoList, SaleQuotationVo::getSellCorporationId, (item, corporation) -> {
|
|
corporationService.attributeAssign(saleQuotationVoList, SaleQuotationVo::getSellCorporationId, (item, corporation) -> {
|
|
@@ -134,17 +133,17 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
|
|
if (ObjectUtil.isNotEmpty(result)) {
|
|
if (ObjectUtil.isNotEmpty(result)) {
|
|
//赋值合同模板名称
|
|
//赋值合同模板名称
|
|
ContractTemplate contractTemplate = contractTemplateService.getById(result.getContractTemplateId());
|
|
ContractTemplate contractTemplate = contractTemplateService.getById(result.getContractTemplateId());
|
|
- if(ObjectUtil.isNotEmpty(contractTemplate)){
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(contractTemplate)) {
|
|
result.setContractTemplateName(contractTemplate.getTemplateName());
|
|
result.setContractTemplateName(contractTemplate.getTemplateName());
|
|
}
|
|
}
|
|
//赋值买方公司名称(客户)
|
|
//赋值买方公司名称(客户)
|
|
Customer customer = customerService.getById(result.getBuyCorporationId());
|
|
Customer customer = customerService.getById(result.getBuyCorporationId());
|
|
- if(ObjectUtil.isNotEmpty(customer)){
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(customer)) {
|
|
result.setBuyCorporationName(customer.getName());
|
|
result.setBuyCorporationName(customer.getName());
|
|
}
|
|
}
|
|
//赋值卖方公司名称(多公司)
|
|
//赋值卖方公司名称(多公司)
|
|
Corporation corporation = corporationService.getById(result.getSellCorporationId());
|
|
Corporation corporation = corporationService.getById(result.getSellCorporationId());
|
|
- if(ObjectUtil.isNotEmpty(corporation)){
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(corporation)) {
|
|
result.setSellCorporationName(corporation.getName());
|
|
result.setSellCorporationName(corporation.getName());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -353,7 +352,7 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
//存放来源存量与增量的数据列表
|
|
//存放来源存量与增量的数据列表
|
|
- List<Map<String,Object>> stockList = new ArrayList<>();
|
|
|
|
|
|
+ List<Map<String, Object>> stockList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
//来源存量(在指定时间外的数量)
|
|
//来源存量(在指定时间外的数量)
|
|
@@ -397,28 +396,28 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
|
|
|
|
|
|
Map<String, List<CustomerVo>> sourceStockMap = sourceStockList.stream().collect(Collectors.groupingBy(Customer::getSource));
|
|
Map<String, List<CustomerVo>> sourceStockMap = sourceStockList.stream().collect(Collectors.groupingBy(Customer::getSource));
|
|
|
|
|
|
- if (dictTenantDataVos.size()==0){
|
|
|
|
|
|
+ if (dictTenantDataVos.size() == 0) {
|
|
throw new ServiceException("数据有误:该租户没有配客户来源字典");
|
|
throw new ServiceException("数据有误:该租户没有配客户来源字典");
|
|
}
|
|
}
|
|
|
|
|
|
//赋值 增量 存量数据
|
|
//赋值 增量 存量数据
|
|
for (DictTenantDataVo dictTenantDataVo : dictTenantDataVos) {
|
|
for (DictTenantDataVo dictTenantDataVo : dictTenantDataVos) {
|
|
//存放来源存量与增量的数据
|
|
//存放来源存量与增量的数据
|
|
- Map<String,Object> stockMap = new HashMap<>();
|
|
|
|
|
|
+ Map<String, Object> stockMap = new HashMap<>();
|
|
//赋值初使值
|
|
//赋值初使值
|
|
- stockMap.put("source",dictTenantDataVo.getDictValue());
|
|
|
|
- stockMap.put("stockAmount",0);
|
|
|
|
- stockMap.put("incrementAmount",0);
|
|
|
|
|
|
+ stockMap.put("source", dictTenantDataVo.getDictValue());
|
|
|
|
+ stockMap.put("stockAmount", 0);
|
|
|
|
+ stockMap.put("incrementAmount", 0);
|
|
|
|
|
|
//赋值增量数据
|
|
//赋值增量数据
|
|
List<CustomerVo> customers = sourceIncrementMap.get(dictTenantDataVo.getDictKey());
|
|
List<CustomerVo> customers = sourceIncrementMap.get(dictTenantDataVo.getDictKey());
|
|
- if (ObjectUtil.isNotEmpty(customers)){
|
|
|
|
- stockMap.put("incrementAmount",customers.get(0).getCount());
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(customers)) {
|
|
|
|
+ stockMap.put("incrementAmount", customers.get(0).getCount());
|
|
}
|
|
}
|
|
//赋值存量数据
|
|
//赋值存量数据
|
|
List<CustomerVo> customerVos = sourceStockMap.get(dictTenantDataVo.getDictKey());
|
|
List<CustomerVo> customerVos = sourceStockMap.get(dictTenantDataVo.getDictKey());
|
|
- if (ObjectUtil.isNotEmpty(customerVos)){
|
|
|
|
- stockMap.put("stockAmount",customerVos.get(0).getCount());
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(customerVos)) {
|
|
|
|
+ stockMap.put("stockAmount", customerVos.get(0).getCount());
|
|
}
|
|
}
|
|
stockList.add(stockMap);
|
|
stockList.add(stockMap);
|
|
}
|
|
}
|
|
@@ -439,7 +438,7 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
//存放询盘数据 成交单的列表
|
|
//存放询盘数据 成交单的列表
|
|
- List<Map<String,Object>> saleList = new ArrayList<>();
|
|
|
|
|
|
+ List<Map<String, Object>> saleList = new ArrayList<>();
|
|
|
|
|
|
QueryWrapper<Object> query = Wrappers.query();
|
|
QueryWrapper<Object> query = Wrappers.query();
|
|
query.ge("DATE_FORMAT(sq.create_time,'%Y-%m')", dto.getBeginTime());
|
|
query.ge("DATE_FORMAT(sq.create_time,'%Y-%m')", dto.getBeginTime());
|
|
@@ -472,7 +471,7 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
|
|
DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
List<DictTenantDataVo> dictTenantDataVoList = getDict("customer_status");
|
|
List<DictTenantDataVo> dictTenantDataVoList = getDict("customer_status");
|
|
|
|
|
|
- if (dictTenantDataVoList.size()==0){
|
|
|
|
|
|
+ if (dictTenantDataVoList.size() == 0) {
|
|
throw new ServiceException("数据有误:该租户没有配客户类型字典");
|
|
throw new ServiceException("数据有误:该租户没有配客户类型字典");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -481,20 +480,20 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
|
|
//存放询盘数据 成交单的数据
|
|
//存放询盘数据 成交单的数据
|
|
Map<String, Object> saleMap = new HashMap<>();
|
|
Map<String, Object> saleMap = new HashMap<>();
|
|
//赋值初使值
|
|
//赋值初使值
|
|
- saleMap.put("status",dictTenantDataVo.getDictValue());
|
|
|
|
- saleMap.put("contractAmount",0);
|
|
|
|
- saleMap.put("saleAmount",0);
|
|
|
|
|
|
+ saleMap.put("status", dictTenantDataVo.getDictValue());
|
|
|
|
+ saleMap.put("contractAmount", 0);
|
|
|
|
+ saleMap.put("saleAmount", 0);
|
|
|
|
|
|
//赋值询盘数据
|
|
//赋值询盘数据
|
|
List<SaleQuotationVo> saleQuotationVoList = saleStatisticsMap.get(dictTenantDataVo.getDictKey());
|
|
List<SaleQuotationVo> saleQuotationVoList = saleStatisticsMap.get(dictTenantDataVo.getDictKey());
|
|
- if (ObjectUtil.isNotEmpty(saleQuotationVoList)){
|
|
|
|
- saleMap.put("saleAmount",saleQuotationVoList.get(0).getCount());
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(saleQuotationVoList)) {
|
|
|
|
+ saleMap.put("saleAmount", saleQuotationVoList.get(0).getCount());
|
|
}
|
|
}
|
|
|
|
|
|
//赋值成交单数据
|
|
//赋值成交单数据
|
|
List<SaleQuotationVo> saleQuotationList = contractStatisticsMap.get(dictTenantDataVo.getDictKey());
|
|
List<SaleQuotationVo> saleQuotationList = contractStatisticsMap.get(dictTenantDataVo.getDictKey());
|
|
- if (ObjectUtil.isNotEmpty(saleQuotationList)){
|
|
|
|
- saleMap.put("contractAmount",saleQuotationList.get(0).getCount());
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(saleQuotationList)) {
|
|
|
|
+ saleMap.put("contractAmount", saleQuotationList.get(0).getCount());
|
|
}
|
|
}
|
|
saleList.add(saleMap);
|
|
saleList.add(saleMap);
|
|
}
|
|
}
|
|
@@ -641,7 +640,7 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
|
|
|
|
|
|
|
|
|
|
//根据字典编码获取字典的数据
|
|
//根据字典编码获取字典的数据
|
|
- private List<DictTenantDataVo> getDict(String code){
|
|
|
|
|
|
+ private List<DictTenantDataVo> getDict(String code) {
|
|
DictTenantDataSelectDto dto = new DictTenantDataSelectDto();
|
|
DictTenantDataSelectDto dto = new DictTenantDataSelectDto();
|
|
dto.setDictCode(code);
|
|
dto.setDictCode(code);
|
|
return dictTenantDataService.getList(dto);
|
|
return dictTenantDataService.getList(dto);
|