|
|
@ -9,10 +9,12 @@ import com.epmet.screen.dto.form.ContactMassLineChartFormDTO; |
|
|
|
import com.epmet.screen.dto.form.FineExampleFormDTO; |
|
|
|
import com.epmet.screen.dto.form.VolunteerServiceFormDTO; |
|
|
|
import com.epmet.screen.dto.result.*; |
|
|
|
import com.epmet.screen.constant.*; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.List; |
|
|
@ -31,8 +33,6 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { |
|
|
|
@Autowired |
|
|
|
private ScreenPartyLinkMassesDataDao screenPartyLinkMassesDataDao; |
|
|
|
@Autowired |
|
|
|
private GrassrootsPartyDevServiceImpl grassrootsPartyDevServiceImpl; |
|
|
|
@Autowired |
|
|
|
private ScreenPartyBranchDataDao screenPartyBranchDataDao; |
|
|
|
@Autowired |
|
|
|
private ScreenPioneerDataDao screenPioneerDataDao; |
|
|
@ -65,7 +65,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { |
|
|
|
*/ |
|
|
|
public String getRatio(Double d){ |
|
|
|
BigDecimal bigDecimal = new BigDecimal(d * NumConstant.ONE_HUNDRED); |
|
|
|
return bigDecimal.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).toPlainString().concat("%"); |
|
|
|
return bigDecimal.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).toPlainString().concat(ScreenConstant.RATIO); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -110,8 +110,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { |
|
|
|
List<Integer> organizeData = new ArrayList<>(); |
|
|
|
List<Integer> joinData = new ArrayList<>(); |
|
|
|
List<Integer> averageJoinUserData = new ArrayList<>(); |
|
|
|
Map<String, String> x = grassrootsPartyDevServiceImpl.getX(); |
|
|
|
result.setXAxis(x.values().stream().collect(Collectors.toList())); |
|
|
|
result.setXAxis(this.getX()); |
|
|
|
List<VolunteerServiceResult> volunteerServiceResults = screenPartyBranchDataDao.selectVolunteerServiceResult(volunteerServiceFormDTO.getAgencyId()); |
|
|
|
if (volunteerServiceResults.size() == NumConstant.ZERO){ |
|
|
|
for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) { |
|
|
@ -135,4 +134,20 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { |
|
|
|
result.setAverageJoinUserData(averageJoinUserData); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 获取之前的12个月份【不包括当前月】 |
|
|
|
* @author zxc |
|
|
|
* @date 2020/8/21 10:19 上午 |
|
|
|
*/ |
|
|
|
public List<String> getX(){ |
|
|
|
List<String> xAxis = new ArrayList<>(); |
|
|
|
LocalDate today = LocalDate.now(); |
|
|
|
for(int i = NumConstant.TWELVE;i >= NumConstant.ONE; i--){ |
|
|
|
LocalDate localDate = today.minusMonths(i); |
|
|
|
String s = localDate.getMonth().getValue() + ScreenConstant.MONTH; |
|
|
|
xAxis.add(s); |
|
|
|
} |
|
|
|
return xAxis; |
|
|
|
} |
|
|
|
} |
|
|
|