|
|
@@ -633,28 +633,14 @@ public class CorpsDescController extends BladeController {
|
|
|
.eq(PjCorpsDesc::getSalesCompanyId, AuthUtil.getDeptId())
|
|
|
.eq(PjCorpsDesc::getCorpType, "KH");
|
|
|
//客户总数量
|
|
|
- List<PjCorpsDesc> corpsDescList = corpsDescService.list(corpsDescQueryWrapper);
|
|
|
- for (PjCorpsDesc corpsDesc : corpsDescList) {
|
|
|
- PjOrder order = new PjOrder();
|
|
|
- order.setCustomerId(corpsDesc.getId());
|
|
|
- order.setBsType("XS");
|
|
|
- order.setActualPaymentStatus(2);
|
|
|
- order.setCorpType("1");
|
|
|
- int count = orderService.corpAnalysis(order);
|
|
|
- if (count == 0) {
|
|
|
- unsales++;
|
|
|
- }
|
|
|
- order.setCorpType("2");
|
|
|
- int count1 = orderService.corpAnalysis(order);
|
|
|
- if (count1 > 0) {
|
|
|
- coreCorp++;
|
|
|
- }
|
|
|
- }
|
|
|
+ int count = corpsDescService.count(corpsDescQueryWrapper);
|
|
|
+ coreCorp = orderService.coreCorp(AuthUtil.getTenantId(),"XS",AuthUtil.getDeptId());
|
|
|
+ unsales = count - coreCorp;
|
|
|
if (unsales > 0) {
|
|
|
- lossRate = lossRate.add(new BigDecimal(unsales).divide(new BigDecimal(corpsDescList.size()), MathContext.DECIMAL32));
|
|
|
+ lossRate = lossRate.add(new BigDecimal(unsales).divide(new BigDecimal(count), MathContext.DECIMAL32));
|
|
|
}
|
|
|
|
|
|
- map.put("sumNumber", corpsDescList.size());
|
|
|
+ map.put("sumNumber", count);
|
|
|
map.put("coreCorp", coreCorp);
|
|
|
map.put("lossRate", lossRate);
|
|
|
return R.data(map);
|