|
@@ -6,7 +6,6 @@ import com.caimei.modules.user.entity.*;
|
|
|
import com.caimei.utils.MathUtil;
|
|
|
import com.thinkgem.jeesite.common.utils.ObjectUtils;
|
|
|
import com.thinkgem.jeesite.common.utils.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -560,17 +559,17 @@ public class ClubPortraitService {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
// 新注册机构
|
|
|
- if (0 == clubSales.getType() || 3 == clubSales.getType()) {
|
|
|
+ if (0 == clubSales.getType() || 4 == clubSales.getType()) {
|
|
|
|
|
|
int spClub = 0, unSpClub = 0;
|
|
|
ArrayList<OrderPortrait> orderPortraits = new ArrayList<>();
|
|
|
OrderPortrait orderPortrait = new OrderPortrait();
|
|
|
- List<clubData> clubList = cmPortraitDao.getNewClubInfo(clubSales);
|
|
|
+ List<ClubData> clubList = cmPortraitDao.getNewClubInfo(clubSales);
|
|
|
int length = clubList.size();
|
|
|
NumberFormat instance = NumberFormat.getInstance();
|
|
|
instance.setMaximumFractionDigits(2);
|
|
|
if (length != 0) {
|
|
|
- for (clubData club : clubList) {
|
|
|
+ for (ClubData club : clubList) {
|
|
|
if ( null == club.getSpID() || 1342 == club.getSpID()) {
|
|
|
// 未分配协销结构与
|
|
|
spClub++;
|
|
@@ -605,11 +604,11 @@ public class ClubPortraitService {
|
|
|
clubSales.setEndTime(endTime);
|
|
|
}
|
|
|
// 机构咨询记录
|
|
|
- if (1 == clubSales.getType() || 3 == clubSales.getType()) {
|
|
|
+ if (1 == clubSales.getType() || 4 == clubSales.getType()) {
|
|
|
// 机构咨询记录
|
|
|
- List<clubData> clubRemark = cmPortraitDao.getClubRemark(clubSales);
|
|
|
+ List<ClubData> clubRemark = cmPortraitDao.getClubRemark(clubSales);
|
|
|
// 游客咨询记录
|
|
|
- List<clubData> clubVisitorRemark = cmPortraitDao.getClubVisitorRemark(clubSales);
|
|
|
+ List<ClubData> clubVisitorRemark = cmPortraitDao.getClubVisitorRemark(clubSales);
|
|
|
// 新注册机构
|
|
|
List<Integer> clubIdList = cmPortraitDao.getNewClubId(clubSales);
|
|
|
int total = 0;
|
|
@@ -625,7 +624,7 @@ public class ClubPortraitService {
|
|
|
int fillClub = 0, fillRemark = 0 ;
|
|
|
// 未填写过机构数、咨询记录数
|
|
|
int unFillClub = 0;
|
|
|
- for (clubData remark : clubRemark) {
|
|
|
+ for (ClubData remark : clubRemark) {
|
|
|
total += remark.getNumber();
|
|
|
clubRemarkNumber += remark.getNumber();
|
|
|
for (Integer clubId : clubIdList) {
|
|
@@ -657,7 +656,7 @@ public class ClubPortraitService {
|
|
|
orderPortrait = new OrderPortrait();
|
|
|
}
|
|
|
if (clubVisitorRemark.size() != 0) {
|
|
|
- for (clubData tourist : clubVisitorRemark) {
|
|
|
+ for (ClubData tourist : clubVisitorRemark) {
|
|
|
total += tourist.getNumber();
|
|
|
touristRemarkNumber += tourist.getNumber();
|
|
|
}
|
|
@@ -682,7 +681,7 @@ public class ClubPortraitService {
|
|
|
clubSales.setPortrait(orderPortraits);
|
|
|
}
|
|
|
// 机构活跃
|
|
|
- if (2 == clubSales.getType() || 3 == clubSales.getType()) {
|
|
|
+ if (2 == clubSales.getType() || 4 == clubSales.getType()) {
|
|
|
if (expty) {
|
|
|
// 默认前一周
|
|
|
calendar.setTime(date);
|
|
@@ -704,17 +703,17 @@ public class ClubPortraitService {
|
|
|
for (String activeDate : activeDateList) {
|
|
|
names.add(activeDate);
|
|
|
// 该天用户活跃数据
|
|
|
- List<clubData> activeInfo = cmPortraitDao.getActiveInfo(activeDate, clubSales.getSpID());
|
|
|
+ List<ClubData> activeInfo = cmPortraitDao.getActiveInfo(activeDate, clubSales.getSpID());
|
|
|
Integer activeNumber = 0;
|
|
|
Integer unActiveNumber = 0;
|
|
|
if (null != activeInfo && activeInfo.size() > 0) {
|
|
|
// 活跃数据
|
|
|
- List<clubData> activeClubList = activeInfo.stream().filter(ac -> ac.getActiveStatus().equals(0)).collect(Collectors.toList());
|
|
|
+ List<ClubData> activeClubList = activeInfo.stream().filter(ac -> ac.getActiveStatus().equals(0)).collect(Collectors.toList());
|
|
|
if (null != activeClubList && activeClubList.size() > 0) {
|
|
|
activeNumber = activeClubList.get(0).getNumber();
|
|
|
}
|
|
|
// 不活跃数据
|
|
|
- List<clubData> unActiveClubList = activeInfo.stream().filter(ac -> ac.getActiveStatus().equals(1)).collect(Collectors.toList());
|
|
|
+ List<ClubData> unActiveClubList = activeInfo.stream().filter(ac -> ac.getActiveStatus().equals(1)).collect(Collectors.toList());
|
|
|
if (null != unActiveClubList && unActiveClubList.size() > 0) {
|
|
|
unActiveNumber = unActiveClubList.get(0).getNumber();
|
|
|
}
|
|
@@ -726,6 +725,30 @@ public class ClubPortraitService {
|
|
|
clubSales.setValues(active);
|
|
|
clubSales.setValues1(unActive);
|
|
|
}
|
|
|
+ // 机构活跃占比
|
|
|
+ if (3 == clubSales.getType() || 4 == clubSales.getType()) {
|
|
|
+ ArrayList<OrderPortrait> orderPortraits = new ArrayList<>();
|
|
|
+ OrderPortrait orderPortrait = new OrderPortrait();
|
|
|
+ List<ClubData> clubActive = cmPortraitDao.getClubActive();
|
|
|
+ int active = 0, unActive = 0, max = 0;
|
|
|
+ for (ClubData clubData : clubActive) {
|
|
|
+ max += clubData.getNumber();
|
|
|
+ if (0 == clubData.getActiveStatus()) {
|
|
|
+ active += clubData.getNumber();
|
|
|
+ } else {
|
|
|
+ unActive += clubData.getNumber();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ orderPortrait.setName("活跃机构 " + MathUtil.mul(MathUtil.div(active, max, 2), 100) + "%" + active + " 个");
|
|
|
+ orderPortrait.setValue(active);
|
|
|
+ orderPortraits.add(orderPortrait);
|
|
|
+ orderPortrait = new OrderPortrait();
|
|
|
+ orderPortrait.setName("不活跃机构 " + MathUtil.mul(MathUtil.div(unActive, max, 2), 100) + "%" + unActive + " 个");
|
|
|
+ orderPortrait.setValue(unActive);
|
|
|
+ orderPortraits.add(orderPortrait);
|
|
|
+ clubSales.setClubProportionTotal(max);
|
|
|
+ clubSales.setClubProportion(orderPortraits);
|
|
|
+ }
|
|
|
try {
|
|
|
clubSales.setStartTime(dateFormat.format(dateFormat.parse(clubSales.getStartTime())));;
|
|
|
clubSales.setEndTime(dateFormat.format(dateFormat.parse(clubSales.getEndTime())));;
|