PbCseFeeobjupdateServiceImpl.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. package com.xjrsoft.module.student.service.impl;
  2. import cn.hutool.core.util.StrUtil;
  3. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  4. import com.github.yulichang.base.MPJBaseServiceImpl;
  5. import com.github.yulichang.wrapper.MPJLambdaWrapper;
  6. import com.xjrsoft.common.enums.DeleteMark;
  7. import com.xjrsoft.common.enums.EnabledMark;
  8. import com.xjrsoft.module.base.entity.BaseMajorSet;
  9. import com.xjrsoft.module.student.dto.EnrollmentStatisticsCalendarInfoDto;
  10. import com.xjrsoft.module.student.dto.EnrollmentStatisticsGraduationInfoDto;
  11. import com.xjrsoft.module.student.dto.EnrollmentStatisticsInfoDto;
  12. import com.xjrsoft.module.student.entity.BaseMajorCategor;
  13. import com.xjrsoft.module.student.entity.EnrollmentStatisticsInfo;
  14. import com.xjrsoft.module.student.entity.PbCseFeeitem2;
  15. import com.xjrsoft.module.student.entity.PbCseFeeobjupdate;
  16. import com.xjrsoft.module.student.entity.PbCseSpecplan;
  17. import com.xjrsoft.module.student.entity.PbVXssfdetail;
  18. import com.xjrsoft.module.student.mapper.EnrollmentStatisticsInfoMapper;
  19. import com.xjrsoft.module.student.mapper.PbCseFeeobjupdateMapper;
  20. import com.xjrsoft.module.student.mapper.PbVXsxxsfytbMapper;
  21. import com.xjrsoft.module.student.service.IPbCseFeeobjupdateService;
  22. import com.xjrsoft.module.student.service.IPbCseSpecplanService;
  23. import com.xjrsoft.module.student.vo.ChargingSituationVo;
  24. import com.xjrsoft.module.student.vo.EnrollmentStatisticsCalendarInfoVo;
  25. import com.xjrsoft.module.student.vo.EnrollmentStatisticsGraduationInfoVo;
  26. import com.xjrsoft.module.student.vo.EnrollmentStatisticsInfoKeyValue;
  27. import com.xjrsoft.module.student.vo.EnrollmentStatisticsInfoVo;
  28. import com.xjrsoft.module.student.vo.PbVXsxxsfytbSpecnameCountVo;
  29. import com.xjrsoft.module.student.vo.ProfessionalHeadCoun;
  30. import com.yomahub.liteflow.util.JsonUtil;
  31. import lombok.AllArgsConstructor;
  32. import org.springframework.stereotype.Service;
  33. import java.math.BigDecimal;
  34. import java.math.RoundingMode;
  35. import java.text.DecimalFormat;
  36. import java.time.LocalDate;
  37. import java.time.format.DateTimeFormatter;
  38. import java.util.ArrayList;
  39. import java.util.HashMap;
  40. import java.util.LinkedHashMap;
  41. import java.util.List;
  42. import java.util.Map;
  43. import java.util.stream.Collectors;
  44. /**
  45. * @title:
  46. * @Author szs
  47. * @Date: 2024-03-29
  48. * @Version 1.0
  49. */
  50. @Service
  51. @AllArgsConstructor
  52. public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobjupdateMapper, PbCseFeeobjupdate> implements IPbCseFeeobjupdateService {
  53. private final IPbCseSpecplanService pbCseSpecplanService;
  54. private final PbVXsxxsfytbMapper pbVXsxxsfytbMapper;
  55. private final EnrollmentStatisticsInfoMapper enrollmentStatisticsInfoMapper;
  56. @Override
  57. public EnrollmentStatisticsInfoVo getEnrollmentStatisticsInfo(EnrollmentStatisticsInfoDto dto) {
  58. EnrollmentStatisticsInfoVo result = new EnrollmentStatisticsInfoVo();
  59. //获取所有学生的信息
  60. MPJLambdaWrapper<PbCseFeeobjupdate> pbCseFeeobjupdateMPJLambdaWrapper = new MPJLambdaWrapper<>();
  61. pbCseFeeobjupdateMPJLambdaWrapper
  62. .disableSubLogicDel()
  63. .distinct()
  64. .selectAs(PbCseFeeobjupdate::getSpecname, PbCseFeeobjupdate::getSpecname)
  65. .selectAs(PbCseFeeobjupdate::getPersonalid, PbCseFeeobjupdate::getPersonalid)
  66. .select("IFNULL(resourcename,'无') Resourcename")
  67. // .selectAs(PbCseFeeobjupdate::getResourcename, PbCseFeeobjupdate::getResourcename)
  68. .selectAs(PbCseFeeobjupdate::getQuartername, PbCseFeeobjupdate::getQuartername)
  69. .selectAs(PbCseFeeobjupdate::getSex, PbCseFeeobjupdate::getSex)
  70. .selectAs(PbCseFeeobjupdate::getGraduations, PbCseFeeobjupdate::getGraduations)
  71. .eq(dto.getYear() != null, PbCseFeeobjupdate::getEnteryear, dto.getYear())
  72. ;
  73. List<PbCseFeeobjupdate> pbCseFeeobjupdateList = this.selectJoinList(PbCseFeeobjupdate.class, pbCseFeeobjupdateMPJLambdaWrapper);
  74. if(pbCseFeeobjupdateList.isEmpty()){
  75. return null;
  76. }
  77. //专业排行
  78. Map<String, Long> professionalHeadCount = pbCseFeeobjupdateList.stream().filter(x -> x.getSpecname() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getSpecname, Collectors.counting()));
  79. if (!professionalHeadCount.isEmpty()) {
  80. professionalHeadCount = professionalHeadCount.entrySet().stream()
  81. .sorted(Map.Entry.<String, Long>comparingByValue().reversed())
  82. .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
  83. (e1, e2) -> e1, LinkedHashMap::new));
  84. }
  85. //查询每个专业的缴费人数
  86. List<PbVXsxxsfytbSpecnameCountVo> specnameCountVos = pbVXsxxsfytbMapper.getSpecnameCount(dto);
  87. Map<String, Integer> specnameCountMap = new HashMap<>();
  88. for (PbVXsxxsfytbSpecnameCountVo specnameCountVo : specnameCountVos) {
  89. specnameCountMap.put(specnameCountVo.getSpecname(), specnameCountVo.getStudentCount());
  90. }
  91. //专业计划人数,余数
  92. MPJLambdaWrapper<PbCseSpecplan> pbCseSpecplanMPJLambdaWrapper = new MPJLambdaWrapper<>();
  93. pbCseSpecplanMPJLambdaWrapper
  94. .disableSubLogicDel()
  95. .distinct()
  96. .select("ifnull(t2.name,t.specname) as kkey")
  97. .selectAs(PbCseSpecplan::getNum, EnrollmentStatisticsInfoKeyValue::getValue)
  98. .leftJoin(BaseMajorSet.class, BaseMajorSet::getName, PbCseSpecplan::getSpecname)
  99. .leftJoin(BaseMajorCategor.class, BaseMajorCategor::getId, BaseMajorSet::getMajorCategorId)
  100. .eq(dto.getYear() != null, PbCseSpecplan::getXyear, dto.getYear())
  101. ;
  102. List<EnrollmentStatisticsInfoKeyValue> pbCseSpecplanList = pbCseSpecplanService.selectJoinList(EnrollmentStatisticsInfoKeyValue.class, pbCseSpecplanMPJLambdaWrapper);
  103. Map<String, Long> pbCseSpecplanSumMap = pbCseSpecplanList.stream().collect(Collectors.groupingBy(EnrollmentStatisticsInfoKeyValue::getKkey, Collectors.summingLong(EnrollmentStatisticsInfoKeyValue::getValue)));
  104. List<ProfessionalHeadCoun> professionalHeadCountRes = new ArrayList<>();
  105. for (Map.Entry<String, Long> entry : professionalHeadCount.entrySet()) {
  106. professionalHeadCountRes.add(new ProfessionalHeadCoun() {{
  107. setKey(entry.getKey());
  108. setValue(entry.getValue());
  109. if (pbCseSpecplanSumMap.get(entry.getKey()) != null) {
  110. setPlannedNumber(pbCseSpecplanSumMap.get(entry.getKey()));
  111. setRemainder(pbCseSpecplanSumMap.get(entry.getKey()) - entry.getValue());
  112. setPaymentCount(specnameCountMap.get(entry.getKey()));
  113. }
  114. if (specnameCountMap.get(entry.getKey()) != null) {
  115. setPaymentCount(specnameCountMap.get(entry.getKey()));
  116. }
  117. }});
  118. }
  119. //学生类型
  120. // Map<String, Long> studentSource = pbCseFeeobjupdateList.stream().filter(x -> x.getResourcename() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getResourcename, Collectors.counting()));
  121. // List<EnrollmentStatisticsInfoKeyValue> studentSourceRes = new ArrayList<>();
  122. // for (Map.Entry<String, Long> entry : studentSource.entrySet()) {
  123. // studentSourceRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
  124. // }
  125. Map<String, Long> graduations = pbCseFeeobjupdateList.stream().filter(x -> x.getGraduations() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getGraduations, Collectors.counting()));
  126. List<EnrollmentStatisticsInfoKeyValue> graduationsRes = new ArrayList<>();
  127. for (Map.Entry<String, Long> entry : graduations.entrySet()) {
  128. graduationsRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
  129. }
  130. //住宿类型
  131. Map<String, Long> accommodationType = pbCseFeeobjupdateList.stream().filter(x -> x.getQuartername() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getQuartername, Collectors.counting()));
  132. List<EnrollmentStatisticsInfoKeyValue> accommodationTypeRes = new ArrayList<>();
  133. for (Map.Entry<String, Long> entry : accommodationType.entrySet()) {
  134. accommodationTypeRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
  135. }
  136. //性别
  137. Map<String, Long> gender = pbCseFeeobjupdateList.stream().collect(Collectors.groupingBy(PbCseFeeobjupdate::getSex, Collectors.counting()));
  138. List<EnrollmentStatisticsInfoKeyValue> genderRes = new ArrayList<>();
  139. for (Map.Entry<String, Long> entry : gender.entrySet()) {
  140. genderRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
  141. }
  142. result.setRegistrationPopulation(pbCseFeeobjupdateList.size());
  143. result.setProfessionalHeadCount(professionalHeadCountRes);
  144. result.setStudentSource(graduationsRes);
  145. result.setAccommodationType(accommodationTypeRes);
  146. result.setGender(genderRes);
  147. //获取所有学生的收费明细
  148. MPJLambdaWrapper<PbCseFeeobjupdate> feeobjupdateXssfdetailMPJLambdaWrapper = new MPJLambdaWrapper<>();
  149. feeobjupdateXssfdetailMPJLambdaWrapper
  150. .select("count(distinct t1.personalid) as payers")
  151. .selectSum(PbVXssfdetail::getMny, EnrollmentStatisticsInfoVo::getRecordedAmountOfMoney)
  152. .leftJoin(PbVXssfdetail.class, PbVXssfdetail::getPersonalid, PbCseFeeobjupdate::getPersonalid)
  153. .eq(dto.getYear() != null, PbCseFeeobjupdate::getEnteryear, dto.getYear())
  154. ;
  155. EnrollmentStatisticsInfoVo enrollmentStatisticsInfoVo = this.selectJoinOne(EnrollmentStatisticsInfoVo.class, feeobjupdateXssfdetailMPJLambdaWrapper);
  156. //退费金额
  157. // MPJLambdaWrapper<PbCseFeeobjupdate> feeobjupdateXssfdetailMPJLambdaWrapper = new MPJLambdaWrapper<>();
  158. // feeobjupdateXssfdetailMPJLambdaWrapper
  159. // .selectCount(PbVXssfdetail::getPersonalid, EnrollmentStatisticsInfoVo::getPayers)
  160. // .selectSum(PbVXssfdetail::getMny, EnrollmentStatisticsInfoVo::getRecordedAmountOfMoney)
  161. // .leftJoin(PbVXssfdetail.class, PbVXssfdetail::getPersonalid, PbCseFeeobjupdate::getPersonalid)
  162. // .eq(dto.getYear() != null, PbCseFeeobjupdate::getEnteryear, dto.getYear())
  163. // ;
  164. // EnrollmentStatisticsInfoVo enrollmentStatisticsInfoVo = this.selectJoinOne(EnrollmentStatisticsInfoVo.class, feeobjupdateXssfdetailMPJLambdaWrapper);
  165. //缴费人数,入账金额
  166. long count = pbCseFeeobjupdateList.stream().filter(x -> x.getPaymnystate() != null && "已缴费".equals(x.getPaymnystate())).count();
  167. result.setPayers(Long.valueOf(count).intValue() );
  168. if (enrollmentStatisticsInfoVo != null) {
  169. if (enrollmentStatisticsInfoVo.getRecordedAmountOfMoney() != null) {
  170. result.setRecordedAmountOfMoney(enrollmentStatisticsInfoVo.getRecordedAmountOfMoney().setScale(2, RoundingMode.DOWN));
  171. }
  172. }
  173. //获取所有学生的缴费详情
  174. MPJLambdaWrapper<PbCseFeeobjupdate> feeobjupdateMPJLambdaWrapper = new MPJLambdaWrapper<>();
  175. feeobjupdateMPJLambdaWrapper
  176. .selectAs(PbCseFeeitem2::getShortname, PbVXssfdetail::getFeeitemname)
  177. .selectAs(PbCseFeeobjupdate::getPersonalid, PbVXssfdetail::getPersonalid)
  178. .selectAs(PbVXssfdetail::getMny, PbVXssfdetail::getMny)
  179. .leftJoin(PbVXssfdetail.class, PbVXssfdetail::getPersonalid, PbCseFeeobjupdate::getPersonalid)
  180. .leftJoin(PbCseFeeitem2.class, PbCseFeeitem2::getFeeitemname, PbVXssfdetail::getFeeitemname)
  181. .eq(dto.getYear() != null, PbCseFeeobjupdate::getEnteryear, dto.getYear())
  182. .isNotNull(PbVXssfdetail::getFeeitemname)
  183. ;
  184. List<PbVXssfdetail> pbVXssfdetails = this.selectJoinList(PbVXssfdetail.class, feeobjupdateMPJLambdaWrapper);
  185. //收费项目情况统计
  186. Map<String, Long> pbVXssfdetailMap = pbVXssfdetails.stream().collect(Collectors.groupingBy(PbVXssfdetail::getFeeitemname, Collectors.counting()));
  187. Map<String, BigDecimal> pbVXssfdetailSumMap = pbVXssfdetails.stream()
  188. .collect(Collectors.groupingBy(PbVXssfdetail::getFeeitemname,
  189. Collectors.mapping(PbVXssfdetail::getMny, Collectors.reducing(BigDecimal.ZERO, BigDecimal::add))));
  190. List<ChargingSituationVo> chargingSituationVoRes = new ArrayList<>();
  191. DecimalFormat df = new DecimalFormat("#.##");
  192. for (Map.Entry<String, Long> entry : pbVXssfdetailMap.entrySet()) {
  193. chargingSituationVoRes.add(new ChargingSituationVo() {{
  194. setFeeitemname(entry.getKey());
  195. setPaid(entry.getValue());
  196. if (entry.getKey().equals("普通中专、职业高中、成人中专普通宿舍") && !accommodationType.isEmpty() && accommodationType.get("住宿") != null) {
  197. setUnpaid(accommodationType.get("住宿") - entry.getValue());
  198. setRateOfPayment(df.format((double) entry.getValue() / accommodationType.get("住宿") * 100) + "%");
  199. } else {
  200. setUnpaid(result.getRegistrationPopulation() - entry.getValue());
  201. setRateOfPayment(df.format((double) entry.getValue() / result.getRegistrationPopulation() * 100) + "%");
  202. }
  203. if (pbVXssfdetailSumMap.get(entry.getKey()) != null) {
  204. setRecordedmoney(pbVXssfdetailSumMap.get(entry.getKey()).setScale(2, RoundingMode.DOWN));
  205. }
  206. }});
  207. }
  208. result.setChargingSituationVoList(chargingSituationVoRes);
  209. return result;
  210. }
  211. @Override
  212. public EnrollmentStatisticsCalendarInfoVo getEnrollmentStatisticsCalendarInfo(EnrollmentStatisticsCalendarInfoDto dto) {
  213. EnrollmentStatisticsCalendarInfoVo result = new EnrollmentStatisticsCalendarInfoVo();
  214. LocalDate endDate = LocalDate.parse(dto.getEndDay());
  215. DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
  216. LocalDate nextDay = endDate.plusDays(1);
  217. dto.setEndDay(nextDay.format(formatter));
  218. String year = String.valueOf(endDate.getYear());
  219. //根据年月获取招生数量
  220. MPJLambdaWrapper<PbCseFeeobjupdate> pbCseFeeobjupdateByYearMonth = new MPJLambdaWrapper<>();
  221. pbCseFeeobjupdateByYearMonth
  222. .distinct()
  223. .selectAs(PbCseFeeobjupdate::getPersonalid, PbCseFeeobjupdate::getPersonalid)
  224. .selectAs(PbCseFeeobjupdate::getCratetime, PbCseFeeobjupdate::getCratetime)
  225. .eq(PbCseFeeobjupdate::getEnteryear, year)
  226. .between(PbCseFeeobjupdate::getCratetime, dto.getStartDay(), dto.getEndDay())
  227. ;
  228. List<PbCseFeeobjupdate> pbCseFeeobjupdateByYearMonthList = this.selectJoinList(PbCseFeeobjupdate.class, pbCseFeeobjupdateByYearMonth);
  229. if(pbCseFeeobjupdateByYearMonthList.isEmpty()){
  230. return null;
  231. }
  232. //每日招生人数
  233. Map<String, Long> cratetime = pbCseFeeobjupdateByYearMonthList.stream().collect(Collectors.groupingBy(pbCseFeeobjupdate -> pbCseFeeobjupdate.getCratetime().substring(0, 10), Collectors.counting()));
  234. if (!cratetime.isEmpty()) {
  235. cratetime = cratetime.entrySet().stream()
  236. .sorted(Map.Entry.comparingByKey())
  237. .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
  238. (e1, e2) -> e1, LinkedHashMap::new));
  239. }
  240. List<EnrollmentStatisticsInfoKeyValue> cratetimeRes = new ArrayList<>();
  241. for (Map.Entry<String, Long> entry : cratetime.entrySet()) {
  242. cratetimeRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
  243. }
  244. result.setCratetimeList(cratetimeRes);
  245. return result;
  246. }
  247. @Override
  248. public EnrollmentStatisticsGraduationInfoVo getEnrollmentStatisticsGraduationInfo(EnrollmentStatisticsGraduationInfoDto dto) {
  249. EnrollmentStatisticsGraduationInfoVo result = new EnrollmentStatisticsGraduationInfoVo();
  250. LocalDate day = LocalDate.parse(dto.getDay());
  251. String year = String.valueOf(day.getYear());
  252. //根据天获取毕业院校
  253. MPJLambdaWrapper<PbCseFeeobjupdate> pbCseFeeobjupdateByDay = new MPJLambdaWrapper<>();
  254. pbCseFeeobjupdateByDay
  255. .distinct()
  256. .selectAs(PbCseFeeobjupdate::getPersonalid, PbCseFeeobjupdate::getPersonalid)
  257. .select("ifnull(t.graduations,'未知') as graduations")
  258. .eq(PbCseFeeobjupdate::getEnteryear, year)
  259. .like(PbCseFeeobjupdate::getCratetime, day)
  260. ;
  261. List<PbCseFeeobjupdate> pbCseFeeobjupdateByDayList = this.selectJoinList(PbCseFeeobjupdate.class, pbCseFeeobjupdateByDay);
  262. if(pbCseFeeobjupdateByDayList.isEmpty()){
  263. return null;
  264. }
  265. //毕业学校排行
  266. Map<String, Long> graduations = pbCseFeeobjupdateByDayList.stream().collect(Collectors.groupingBy(PbCseFeeobjupdate::getGraduations, Collectors.counting()));
  267. if (!graduations.isEmpty()) {
  268. graduations = graduations.entrySet().stream()
  269. .sorted(Map.Entry.<String, Long>comparingByValue().reversed())
  270. .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
  271. (e1, e2) -> e1, LinkedHashMap::new));
  272. }
  273. List<EnrollmentStatisticsInfoKeyValue> graduationRes = new ArrayList<>();
  274. for (Map.Entry<String, Long> entry : graduations.entrySet()) {
  275. graduationRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
  276. }
  277. result.setGraduationList(graduationRes);
  278. return result;
  279. }
  280. @Override
  281. public EnrollmentStatisticsInfoVo getLastEnrollmentStatisticsInfo(EnrollmentStatisticsInfoDto dto) {
  282. List<EnrollmentStatisticsInfo> list = enrollmentStatisticsInfoMapper.selectList(
  283. new QueryWrapper<EnrollmentStatisticsInfo>().lambda()
  284. .eq(EnrollmentStatisticsInfo::getDeleteMark, DeleteMark.NODELETE.getCode())
  285. .eq(EnrollmentStatisticsInfo::getEnabledMark, EnabledMark.ENABLED.getCode())
  286. .eq(EnrollmentStatisticsInfo::getDataType, 1)
  287. .orderByDesc(EnrollmentStatisticsInfo::getCreateDate)
  288. );
  289. if(!list.isEmpty()){
  290. EnrollmentStatisticsInfo result = list.get(0);
  291. EnrollmentStatisticsInfoVo resultVo = JsonUtil.parseObject(result.getDataJson(), EnrollmentStatisticsInfoVo.class);
  292. resultVo.setUpdateDate(result.getCreateDate());
  293. return resultVo;
  294. }
  295. return null;
  296. }
  297. @Override
  298. public EnrollmentStatisticsGraduationInfoVo getLastEnrollmentStatisticsGraduationInfo(EnrollmentStatisticsGraduationInfoDto dto) {
  299. List<EnrollmentStatisticsInfo> list = enrollmentStatisticsInfoMapper.selectList(
  300. new QueryWrapper<EnrollmentStatisticsInfo>().lambda()
  301. .eq(EnrollmentStatisticsInfo::getDeleteMark, DeleteMark.NODELETE.getCode())
  302. .eq(EnrollmentStatisticsInfo::getEnabledMark, EnabledMark.ENABLED.getCode())
  303. .eq(EnrollmentStatisticsInfo::getDataType, 2)
  304. .eq(StrUtil.isNotEmpty(dto.getDay()), EnrollmentStatisticsInfo::getDataDay, dto.getDay())
  305. .orderByDesc(EnrollmentStatisticsInfo::getCreateDate)
  306. );
  307. if(!list.isEmpty()){
  308. EnrollmentStatisticsInfo result = list.get(0);
  309. EnrollmentStatisticsGraduationInfoVo resultVo = JsonUtil.parseObject(result.getDataJson(), EnrollmentStatisticsGraduationInfoVo.class);
  310. return resultVo;
  311. }
  312. return null;
  313. }
  314. @Override
  315. public EnrollmentStatisticsCalendarInfoVo getLastEnrollmentStatisticsCalendarInfo(EnrollmentStatisticsCalendarInfoDto dto) {
  316. List<EnrollmentStatisticsInfo> list = enrollmentStatisticsInfoMapper.selectList(
  317. new QueryWrapper<EnrollmentStatisticsInfo>().lambda()
  318. .eq(EnrollmentStatisticsInfo::getDeleteMark, DeleteMark.NODELETE.getCode())
  319. .eq(EnrollmentStatisticsInfo::getEnabledMark, EnabledMark.ENABLED.getCode())
  320. .eq(EnrollmentStatisticsInfo::getDataType, 3)
  321. .eq(EnrollmentStatisticsInfo::getDataDay, LocalDate.now())
  322. .eq(StrUtil.isNotEmpty(dto.getStartDay()), EnrollmentStatisticsInfo::getDataStartDay, dto.getStartDay())
  323. .eq(StrUtil.isNotEmpty(dto.getEndDay()), EnrollmentStatisticsInfo::getDataEndDay, dto.getEndDay())
  324. .orderByDesc(EnrollmentStatisticsInfo::getCreateDate)
  325. );
  326. if(!list.isEmpty()){
  327. EnrollmentStatisticsInfo result = list.get(0);
  328. EnrollmentStatisticsCalendarInfoVo resultVo = JsonUtil.parseObject(result.getDataJson(), EnrollmentStatisticsCalendarInfoVo.class);
  329. return resultVo;
  330. }
  331. return null;
  332. }
  333. }