|
@@ -20,6 +20,7 @@ import com.keao.edu.user.enums.ExamStatusEnum;
|
|
|
import com.keao.edu.user.page.ExaminationQueryInfo;
|
|
|
import com.keao.edu.user.service.*;
|
|
|
import com.keao.edu.util.collection.MapUtil;
|
|
|
+import com.keao.edu.util.date.DateUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -67,7 +68,7 @@ public class ExaminationBasicServiceImpl extends BaseServiceImpl<Long, Examinati
|
|
|
@Autowired
|
|
|
private ExamRegistrationPaymentDao examRegistrationPaymentDao;
|
|
|
@Autowired
|
|
|
- private SysUserFeignService sysUserFeignService;
|
|
|
+ private ExamManualLedgerDao examManualLedgerDao;
|
|
|
@Autowired
|
|
|
private ExamTeacherSalaryService examTeacherSalaryService;
|
|
|
|
|
@@ -484,10 +485,40 @@ public class ExaminationBasicServiceImpl extends BaseServiceImpl<Long, Examinati
|
|
|
|
|
|
@Override
|
|
|
public Object homeBalanceOfPayment(String tenantId,Integer day) {
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if(day == null){
|
|
|
+ day = 7;
|
|
|
+ }
|
|
|
+ day = day * -1;
|
|
|
+
|
|
|
BigDecimal annualIncome = examRegistrationPaymentDao.getAnnualIncome(tenantId);
|
|
|
BigDecimal monthIncome = examRegistrationPaymentDao.getMonthIncome(tenantId);
|
|
|
- List<Map<String,BigDecimal>> dayIncomes = examRegistrationPaymentDao.getDayIncome(tenantId,day);
|
|
|
- return null;
|
|
|
+
|
|
|
+ LocalDate today = LocalDate.now();
|
|
|
+ List<String> days=new ArrayList<>();
|
|
|
+ days.add(today.toString());
|
|
|
+ for (int i = -1 ;i > day;i--){
|
|
|
+ days.add(today.plusDays(i).toString());
|
|
|
+ }
|
|
|
+ Map<String,BigDecimal> dayIncomes = MapUtil.convertMybatisMap(examRegistrationPaymentDao.getDayIncome(tenantId,days),String.class,BigDecimal.class);
|
|
|
+ Map<String,BigDecimal> dayPayments = MapUtil.convertMybatisMap(examManualLedgerDao.getDayPayment(tenantId,days),String.class,BigDecimal.class);
|
|
|
+ days.forEach(e->{
|
|
|
+ if(dayIncomes.get(e) == null){
|
|
|
+ dayIncomes.put(e,BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ if(dayPayments.get(e) == null){
|
|
|
+ dayPayments.put(e,BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ BigDecimal annualPayment = examManualLedgerDao.getAnnualPayment(tenantId);
|
|
|
+ BigDecimal monthPayment = examManualLedgerDao.getMonthPayment(tenantId);
|
|
|
+ HashMap<Object, Object> resultMap = new HashMap<>();
|
|
|
+ resultMap.put("annualIncome",annualIncome);
|
|
|
+ resultMap.put("monthIncome",monthIncome);
|
|
|
+ resultMap.put("dayIncomes",dayIncomes);
|
|
|
+ resultMap.put("annualPayment",annualPayment);
|
|
|
+ resultMap.put("monthPayment",monthPayment);
|
|
|
+ resultMap.put("dayPayments",dayPayments);
|
|
|
+ return resultMap;
|
|
|
}
|
|
|
}
|