|
|
@@ -169,6 +169,7 @@ public class performancetargetboard extends Controller {
|
|
|
|
|
|
long sa_saleareaid= content.getLong("sa_saleareaid");
|
|
|
long year= content.getLong("year");
|
|
|
+ int selectmonth= content.getIntValue("month");
|
|
|
JSONObject jsonObject =new JSONObject();
|
|
|
|
|
|
BigDecimal gcproportion =BigDecimal.ZERO;
|
|
|
@@ -197,8 +198,8 @@ public class performancetargetboard extends Controller {
|
|
|
BigDecimal gcgccompletedamount=BigDecimal.ZERO;
|
|
|
BigDecimal zzgccompletedamount=BigDecimal.ZERO;
|
|
|
BigDecimal previouscompletedamount=BigDecimal.ZERO;
|
|
|
- List<Integer> months = getCurrentQuarterMonths();
|
|
|
- List<Integer> previousmonths =getPreviousQuarterMonthsCalendar();
|
|
|
+ List<Integer> months = getCurrentQuarterMonths(selectmonth);
|
|
|
+ List<Integer> previousmonths =getPreviousQuarterMonthsCalendar(selectmonth);
|
|
|
if(salestargetrows.isNotEmpty()){
|
|
|
for(int month : months){
|
|
|
rw_quarter=rw_quarter.add(salestargetrows.get(0).getBigDecimal("m"+month+"l"));
|
|
|
@@ -413,9 +414,7 @@ public class performancetargetboard extends Controller {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public List<Integer> getCurrentQuarterMonths() {
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
- int currentMonth = calendar.get(Calendar.MONTH) + 1; // 月份从0开始,需要+1
|
|
|
+ public List<Integer> getCurrentQuarterMonths(int currentMonth) {
|
|
|
int quarterStartMonth = ((currentMonth - 1) / 3) * 3 + 1;
|
|
|
|
|
|
List<Integer> quarterMonths = new ArrayList<>();
|
|
|
@@ -426,14 +425,9 @@ public class performancetargetboard extends Controller {
|
|
|
return quarterMonths;
|
|
|
}
|
|
|
|
|
|
- public List<Integer> getPreviousQuarterMonthsCalendar() {
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
- int currentMonth = calendar.get(Calendar.MONTH) + 1; // 月份从0开始,需要+1
|
|
|
- int currentYear = calendar.get(Calendar.YEAR);
|
|
|
-
|
|
|
+ public List<Integer> getPreviousQuarterMonthsCalendar(int currentMonth) {
|
|
|
int currentQuarter = (currentMonth - 1) / 3 + 1;
|
|
|
int lastQuarter = currentQuarter - 1;
|
|
|
- int lastQuarterYear = currentYear;
|
|
|
List<Integer> quarterMonths = new ArrayList<>();
|
|
|
// 处理跨年情况
|
|
|
if (lastQuarter == 0) {
|