|
|
@@ -0,0 +1,383 @@
|
|
|
+package com.lc.ibps.business.service.impl;
|
|
|
+
|
|
|
+import com.lc.ibps.base.core.constants.StringPool;
|
|
|
+import com.lc.ibps.base.core.util.AppUtil;
|
|
|
+import com.lc.ibps.base.core.util.BeanUtils;
|
|
|
+import com.lc.ibps.base.framework.table.ICommonDao;
|
|
|
+import com.lc.ibps.base.web.context.ContextUtil;
|
|
|
+import com.lc.ibps.business.dto.*;
|
|
|
+import com.lc.ibps.business.service.StaffTrainService;
|
|
|
+import com.lc.ibps.cloud.entity.APIResult;
|
|
|
+import com.lc.ibps.org.api.IPartyPositionService;
|
|
|
+import com.lc.ibps.org.party.persistence.entity.PartyPositionPo;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.YearMonth;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
+import java.time.format.TextStyle;
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class StaffTrainServiceImpl implements StaffTrainService {
|
|
|
+
|
|
|
+ private static final Logger logger = LoggerFactory.getLogger(StaffTrainServiceImpl.class);
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ICommonDao<?> commonDao;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<TrainingDashBoardBlkDTO> getTrainingDashBoardByBlk(String dept, String types, String dates) {
|
|
|
+
|
|
|
+ List<TrainingDashBoardBlkDTO> list = new ArrayList<>();
|
|
|
+ TrainingDashBoardBlkDTO dashBoardDTO = new TrainingDashBoardBlkDTO();
|
|
|
+
|
|
|
+ // 近一周发布计划
|
|
|
+ dashBoardDTO.setWeekDtoList(getLastSeven(dept));
|
|
|
+
|
|
|
+ String dateCondition = "";String year = "";
|
|
|
+
|
|
|
+ // 在岗人员培训统计情况
|
|
|
+ if (dates.contains("-")){
|
|
|
+ year = dates.substring(0,4);
|
|
|
+ // 月
|
|
|
+ dashBoardDTO.setPxrytjqkDtoList(getYmdData(getAllDatesOfMonth(dates),dept,"month",""));
|
|
|
+ dateCondition = String.format(" AND DATE_FORMAT(pei_xun_shi_jian_, '%%Y-%%m') = '%s'", dates);
|
|
|
+ }else {
|
|
|
+ // 年
|
|
|
+ year =dates;
|
|
|
+ dashBoardDTO.setPxrytjqkDtoList(getYmdData(getYearMonth(),dept,"year",dates));
|
|
|
+ dateCondition = String.format(" AND DATE_FORMAT(pei_xun_shi_jian_, '%%Y') = '%s'", dates);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 在岗培训计划 自动创建 or 手动创建
|
|
|
+ dashBoardDTO.setPlanDto(getPlanRate(dept,dateCondition));
|
|
|
+
|
|
|
+ // 在岗个人培训次数排名
|
|
|
+ dashBoardDTO.setUserRankList(getUserTrainRank(dept,dateCondition));
|
|
|
+
|
|
|
+ // 在岗培训类别占比
|
|
|
+ dashBoardDTO.setTypeDto(getTypeRate(dept,dateCondition));
|
|
|
+
|
|
|
+ // 在岗培训对象占比
|
|
|
+ dashBoardDTO.setObjectDto(getObjectRate(dept,dateCondition));
|
|
|
+
|
|
|
+ // 本年度岗前培训计划
|
|
|
+ //dashBoardDTO.setNdgqpxList(getCurrentYearData(getYearMonth(),dept,year));
|
|
|
+
|
|
|
+ // 本年度岗前培训类别占比
|
|
|
+ //dashBoardDTO.setYearPreWorkDto(getYearPre(dept,year));
|
|
|
+
|
|
|
+ list.add(dashBoardDTO);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ public TrainYearPreWorkBlkDTO getYearPre(String dept,String year){
|
|
|
+ TrainYearPreWorkBlkDTO preWorkDto = new TrainYearPreWorkBlkDTO();
|
|
|
+ preWorkDto.setRemark("本年度岗前培训类别占比");
|
|
|
+ List<TrainRateBlkDTO> rateDtoList = new ArrayList<>();
|
|
|
+ String sql = "select pei_xun_lei_bie_,count(pei_xun_lei_bie_)as nums from t_rypxcjb where " +
|
|
|
+ " shi_fou_guo_shen_='已结束' %s group by pei_xun_lei_bie_";
|
|
|
+ String talSql = "SELECT count(*) AS total FROM t_rypxcjb WHERE shi_fou_guo_shen_ = '已结束' %s ";
|
|
|
+ String dateCondition = String.format(" AND di_dian_ = '%s' ", getDiDian());
|
|
|
+ if (BeanUtils.isNotEmpty(dept)){
|
|
|
+ dateCondition += String.format(" AND bian_zhi_bu_men_ = '%s' ", dept);
|
|
|
+ }
|
|
|
+ dateCondition += String.format(" AND DATE_FORMAT(pei_xun_shi_jian_,'%%Y')='%s' ", year);
|
|
|
+ sql = String.format(sql,dateCondition);
|
|
|
+ talSql = String.format(talSql,dateCondition);
|
|
|
+ List<Map<String,Object>> list = (List<Map<String, Object>>) commonDao.query(sql);
|
|
|
+ Map<String,Object> sumMap = commonDao.queryOne(talSql);
|
|
|
+ int total = Integer.parseInt(sumMap==null?"0":sumMap.get("total").toString());
|
|
|
+ preWorkDto.setYearPreWorkTotal(total);
|
|
|
+ if (BeanUtils.isNotEmpty(list)){
|
|
|
+ for (Map<String,Object> map : list){
|
|
|
+ TrainRateBlkDTO rateDto = new TrainRateBlkDTO();
|
|
|
+ String nums = map.get("nums").toString();
|
|
|
+ rateDto.setTypeName(map.get("pei_xun_lei_bie_").toString());
|
|
|
+ rateDto.setTypeNum(nums);
|
|
|
+ rateDto.setRate(getRate(total,Integer.parseInt(nums)));
|
|
|
+ rateDtoList.add(rateDto);
|
|
|
+ }
|
|
|
+ preWorkDto.setYearProWorkDtoList(rateDtoList);
|
|
|
+ }
|
|
|
+ return preWorkDto;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<Map<String, Object>> getCurrentYearData(List<String> dateStr, String dept,String year) {
|
|
|
+ String baseSql = "SELECT count(*) AS total FROM t_rypxcjb WHERE shi_fou_guo_shen_ = '已结束' and di_dian_='%s'";
|
|
|
+ baseSql = String.format(baseSql,getDiDian());
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
+ for (String date : dateStr) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("date", date + "月");
|
|
|
+ String formattedDate = year + "-" + (Integer.parseInt(date) < 10 ? "0" + date : date);
|
|
|
+ StringBuilder queryBuilder = new StringBuilder(baseSql)
|
|
|
+ .append("AND DATE_FORMAT(pei_xun_shi_jian_, '%Y-%m') = '").append(formattedDate).append("' ");
|
|
|
+ if (BeanUtils.isNotEmpty(dept)) {
|
|
|
+ queryBuilder.append("AND bian_zhi_bu_men_ = '").append(dept).append("' ");
|
|
|
+ }
|
|
|
+ String countSql = queryBuilder.toString();
|
|
|
+ Map<String, Object> countResult = commonDao.queryOne(countSql);
|
|
|
+ map.put("num", Integer.parseInt(countResult==null?"0":countResult.get("total").toString()));
|
|
|
+ list.add(map);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ public TrainObjectBlkDTO getObjectRate(String dept,String dateCondition){
|
|
|
+ TrainObjectBlkDTO objectDto = new TrainObjectBlkDTO();
|
|
|
+ objectDto.setRemark("在岗培训对象占比");
|
|
|
+ List<TrainRateBlkDTO> rateDtoList = new ArrayList<>();
|
|
|
+ String sql = "select pei_xun_lei_xing_,count(pei_xun_lei_xing_)as nums from t_rypxcjb where " +
|
|
|
+ " shi_fou_guo_shen_='已结束' %s group by pei_xun_lei_xing_";
|
|
|
+ String talSql = "SELECT COUNT(*) as total_num from t_rypxcjb where shi_fou_guo_shen_='已结束' %s ";
|
|
|
+ dateCondition += String.format(" AND di_dian_ = '%s' ", getDiDian());
|
|
|
+ if (BeanUtils.isNotEmpty(dept)){
|
|
|
+ dateCondition += String.format(" AND bian_zhi_bu_men_ = '%s' ", dept);
|
|
|
+ }
|
|
|
+ sql = String.format(sql,dateCondition);
|
|
|
+ talSql = String.format(talSql,dateCondition);
|
|
|
+ List<Map<String,Object>> list = (List<Map<String, Object>>) commonDao.query(sql);
|
|
|
+ int total = Integer.parseInt(commonDao.queryOne(talSql).get("total_num").toString());
|
|
|
+ objectDto.setObjectTotal(total);
|
|
|
+ if (BeanUtils.isNotEmpty(list)){
|
|
|
+ for (Map<String,Object> map : list){
|
|
|
+ TrainRateBlkDTO rateDto = new TrainRateBlkDTO();
|
|
|
+ String nums = map.get("nums").toString();
|
|
|
+ rateDto.setTypeName(map.get("pei_xun_lei_xing_").toString());
|
|
|
+ rateDto.setTypeNum(nums);
|
|
|
+ rateDto.setRate(getRate(total,Integer.parseInt(nums)));
|
|
|
+ rateDtoList.add(rateDto);
|
|
|
+ }
|
|
|
+ objectDto.setObjectDtoList(rateDtoList);
|
|
|
+ }
|
|
|
+ return objectDto;
|
|
|
+ }
|
|
|
+
|
|
|
+ public TrainTypeBlkDTO getTypeRate(String dept,String dateCondition){
|
|
|
+ TrainTypeBlkDTO typeDto = new TrainTypeBlkDTO();
|
|
|
+ typeDto.setRemark("在岗培训类别占比");
|
|
|
+ List<TrainRateBlkDTO> rateDtoList = new ArrayList<>();
|
|
|
+ String sql = "select pei_xun_lei_bie_,count(pei_xun_lei_bie_)as nums from t_rypxcjb where " +
|
|
|
+ " shi_fou_guo_shen_='已结束' %s group by pei_xun_lei_bie_";
|
|
|
+ String talSql = "select COUNT(*) AS total_num from t_rypxcjb where shi_fou_guo_shen_='已结束' %s ";
|
|
|
+ dateCondition += String.format(" AND di_dian_ = '%s' ", getDiDian());
|
|
|
+ if (BeanUtils.isNotEmpty(dept)){
|
|
|
+ dateCondition += String.format(" AND bian_zhi_bu_men_ = '%s' ", dept);
|
|
|
+ }
|
|
|
+ sql = String.format(sql,dateCondition);
|
|
|
+ talSql = String.format(talSql,dateCondition);
|
|
|
+ int total = Integer.parseInt(commonDao.queryOne(talSql).get("total_num").toString());
|
|
|
+ List<Map<String,Object>> list = (List<Map<String, Object>>) commonDao.query(sql);
|
|
|
+ typeDto.setTypeTotal(total);
|
|
|
+ if (BeanUtils.isNotEmpty(list)){
|
|
|
+ for (Map<String,Object> map : list){
|
|
|
+ TrainRateBlkDTO rateDto = new TrainRateBlkDTO();
|
|
|
+ String nums = map.get("nums").toString();
|
|
|
+ rateDto.setTypeName(map.get("pei_xun_lei_bie_").toString());
|
|
|
+ rateDto.setTypeNum(nums);
|
|
|
+ rateDto.setRate(getRate(total,Integer.parseInt(nums)));
|
|
|
+ rateDtoList.add(rateDto);
|
|
|
+ }
|
|
|
+ typeDto.setTypeDtoList(rateDtoList);
|
|
|
+ }
|
|
|
+ return typeDto;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<TrainRankDto> getUserTrainRank(String dept, String dateCondition){
|
|
|
+ String sql = "SELECT a.ren_yuan_id_ userId,e.NAME_ userName,a.rank as count from (select ren_yuan_id_,COUNT(ren_yuan_id_)as rank from t_qdxxb " +
|
|
|
+ "where guan_lian_id_ in(select id_ from t_rypxcjb where shi_fou_guo_shen_='已结束' %s) " +
|
|
|
+ "GROUP BY ren_yuan_id_) a ,ibps_party_employee e WHERE e.id_=a.ren_yuan_id_ ";
|
|
|
+ dateCondition += String.format(" AND di_dian_ = '%s' ", getDiDian());
|
|
|
+ if (BeanUtils.isNotEmpty(dept)){
|
|
|
+ dateCondition += String.format(" AND bian_zhi_bu_men_ = '%s'", dept);
|
|
|
+ }
|
|
|
+ sql = sql + " ORDER BY a.rank desc ";
|
|
|
+ sql = String.format(sql,dateCondition);
|
|
|
+ List<Map<String,Object>> list = (List<Map<String, Object>>) commonDao.query(sql);
|
|
|
+ List<TrainRankDto> rankedResults = new ArrayList<>();
|
|
|
+ int rank = 1;
|
|
|
+ for (Map<String,Object> map : list) {
|
|
|
+ TrainRankDto dto = new TrainRankDto();
|
|
|
+ dto.setUserId(map.get("userId").toString());
|
|
|
+ dto.setUserName(map.get("userName").toString());
|
|
|
+ dto.setCount(Integer.parseInt(map.get("count").toString()));
|
|
|
+ dto.setRank(rank++);
|
|
|
+ rankedResults.add(dto);
|
|
|
+ }
|
|
|
+ return rankedResults;
|
|
|
+ }
|
|
|
+
|
|
|
+ public TrainGuardAutoPlanDto getPlanRate(String dept, String dateCondition){
|
|
|
+ TrainGuardAutoPlanDto planDto = new TrainGuardAutoPlanDto();
|
|
|
+ String planSql = "select count(*) as auto from t_rypxcjb where ji_hua_wai_jian_ in(select id_ from t_ndrypxjhzb " +
|
|
|
+ "where di_dian_='"+getDiDian()+"') %s";
|
|
|
+ String sumSql = "select count(*) as total from t_rypxcjb where 1=1 %s ";
|
|
|
+ String condition = String.format(" AND di_dian_ = '%s' and shi_fou_guo_shen_='已结束' ", getDiDian());
|
|
|
+ if (BeanUtils.isNotEmpty(dept)){
|
|
|
+ condition += String.format(" AND bian_zhi_bu_men_ = '%s' ", dept);
|
|
|
+ }
|
|
|
+ condition += dateCondition;
|
|
|
+ planSql = String.format(planSql,condition);
|
|
|
+ sumSql = String.format(sumSql,condition);
|
|
|
+ int autoNum = Integer.parseInt(commonDao.queryOne(planSql).get("auto").toString());
|
|
|
+ int total = Integer.parseInt(commonDao.queryOne(sumSql).get("total").toString());
|
|
|
+ int manual = total - autoNum;
|
|
|
+ planDto.setTotal(total);
|
|
|
+ planDto.setAutoNum(autoNum);
|
|
|
+ planDto.setManual(manual);
|
|
|
+ planDto.setRemark("自动创建培训计划占比");
|
|
|
+ planDto.setRate(getRate(total,autoNum));
|
|
|
+ return planDto;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getRate(int total,int count){
|
|
|
+ BigDecimal sum = new BigDecimal(total);
|
|
|
+ BigDecimal sign = new BigDecimal(count);
|
|
|
+ if (sum.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
+ BigDecimal percentage = sign.divide(sum, 10, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
|
|
|
+ percentage = percentage.setScale(2, RoundingMode.HALF_UP);
|
|
|
+ return percentage.toString();
|
|
|
+ }else {
|
|
|
+ return "0.00";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<TraineeStatisticsDto> getYmdData(List<String> dateStr, String dept, String type, String year) {
|
|
|
+ List<TraineeStatisticsDto> statisticsDtoList = new ArrayList<>();
|
|
|
+ // 定义SQL模板
|
|
|
+ String countSqlTemplate = "SELECT COALESCE(SUM(num), 0) AS total_num FROM (" +
|
|
|
+ "SELECT LENGTH(pei_xun_ren_yuan_) - LENGTH(REPLACE(pei_xun_ren_yuan_, ',', '')) + 1 AS num " +
|
|
|
+ "FROM t_rypxcjb " +
|
|
|
+ "WHERE shi_fou_guo_shen_ = '已结束' %s) AS subquery";
|
|
|
+
|
|
|
+ String signSqlTemplate = "SELECT count(DISTINCT b.ren_yuan_id_) total_num from t_rypxcjb a,t_qdxxb b " +
|
|
|
+ " WHERE a.id_ =b.guan_lian_id_ and FIND_IN_SET(b.ren_yuan_id_,a.pei_xun_ren_yuan_) " +
|
|
|
+ " and a.shi_fou_guo_shen_ = '已结束' %s ";
|
|
|
+
|
|
|
+ String sumRealSqlTemplate = "SELECT COALESCE(SUM(num),0) AS realNum FROM (" +
|
|
|
+ "SELECT count(id_) as num FROM t_qdxxb " +
|
|
|
+ "WHERE guan_lian_id_ IN (SELECT id_ FROM t_rypxcjb " +
|
|
|
+ "WHERE shi_fou_guo_shen_ = '已结束' %s) " +
|
|
|
+ "GROUP BY guan_lian_id_, ren_yuan_id_) AS re";
|
|
|
+
|
|
|
+ for (String date : dateStr) {
|
|
|
+ TraineeStatisticsDto traineeDto = new TraineeStatisticsDto();
|
|
|
+
|
|
|
+ String dateCondition = "";String params;
|
|
|
+ if ("year".equals(type)) {
|
|
|
+ traineeDto.setDayName(date + "月");
|
|
|
+ date = Integer.parseInt(date)<10?year + "-0" + date : year + "-" + date;
|
|
|
+ traineeDto.setDate(date);
|
|
|
+ dateCondition = String.format("AND DATE_FORMAT(pei_xun_shi_jian_, '%%Y-%%m') = '%s'", date);
|
|
|
+ } else if ("month".equals(type)) {
|
|
|
+ traineeDto.setDate(date);
|
|
|
+ dateCondition = String.format("AND DATE_FORMAT(pei_xun_shi_jian_, '%%Y-%%m-%%d') = '%s'", date);
|
|
|
+ traineeDto.setDayName(getDayName(date));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (BeanUtils.isNotEmpty(dept)) {
|
|
|
+ params = dateCondition + String.format(" AND a.bian_zhi_bu_men_ = '%s'", dept);
|
|
|
+ dateCondition += String.format(" AND bian_zhi_bu_men_ = '%s'", dept);
|
|
|
+ }else {
|
|
|
+ params = dateCondition + String.format(" AND a.di_dian_ = '%s'", getDiDian());
|
|
|
+ }
|
|
|
+ dateCondition += String.format(" AND di_dian_ = '%s'", getDiDian());
|
|
|
+ String countSql = String.format(countSqlTemplate, dateCondition);
|
|
|
+ String sumRealSql = String.format(sumRealSqlTemplate, dateCondition);
|
|
|
+ String signSql = String.format(signSqlTemplate, params);
|
|
|
+ // 应该签到总数
|
|
|
+ Map<String, Object> countResult = commonDao.queryOne(countSql);
|
|
|
+ int numAll = Integer.parseInt(countResult.get("total_num").toString());
|
|
|
+ traineeDto.setNumAll(numAll);
|
|
|
+ // 总签到人数
|
|
|
+ Map<String, Object> realResult = commonDao.queryOne(sumRealSql);
|
|
|
+ int numReal = Integer.parseInt(realResult==null?"0":realResult.get("realNum").toString());
|
|
|
+ traineeDto.setNumReal(numReal);
|
|
|
+ // 未签到人数
|
|
|
+ // 实际参训签到(属于该培训的)
|
|
|
+ Map<String, Object> signMap = commonDao.queryOne(signSql);
|
|
|
+ int numSign = Integer.parseInt(signMap==null?"0":signMap.get("total_num").toString());
|
|
|
+ traineeDto.setNumUn(numAll==0?0:numAll-numSign);
|
|
|
+
|
|
|
+ statisticsDtoList.add(traineeDto);
|
|
|
+ }
|
|
|
+ return statisticsDtoList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<TrainWeekDto> getLastSeven(String dept){
|
|
|
+ List<TrainWeekDto> weekDtoList = new ArrayList<>();
|
|
|
+ List<String> lastWeek = getLastSevenDaysDates();
|
|
|
+ for (String dateStr : lastWeek) {
|
|
|
+ TrainWeekDto weekDto = new TrainWeekDto();
|
|
|
+ weekDto.setDate(dateStr);
|
|
|
+ weekDto.setDayName(getDayName(dateStr));
|
|
|
+ String sql = "select count(*) value from t_rypxcjb where shi_fou_guo_shen_='未发布' " +
|
|
|
+ " and di_dian_='%s' and date_format(pei_xun_shi_jian_,'%%Y-%%m-%%d')='%s' ";
|
|
|
+ if (BeanUtils.isNotEmpty(dept)){
|
|
|
+ sql = sql+" and bian_zhi_bu_men_ = '%s'";
|
|
|
+ sql = String.format(sql,getDiDian(),dateStr,dept);
|
|
|
+ }else {
|
|
|
+ sql = String.format(sql,getDiDian(),dateStr);
|
|
|
+ }
|
|
|
+ Map<String,Object> map = commonDao.queryOne(sql);
|
|
|
+ weekDto.setValue(map.get("value"));
|
|
|
+ weekDtoList.add(weekDto);
|
|
|
+ }
|
|
|
+ weekDtoList.sort(Comparator.comparing(TrainWeekDto::getDate));
|
|
|
+ return weekDtoList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<String> getLastSevenDaysDates() {
|
|
|
+ List<String> datesStrings = new ArrayList<>();
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ LocalDate today = LocalDate.now();
|
|
|
+ for (int i = 0; i < 7; i++) {
|
|
|
+ LocalDate date = today.minusDays(i);
|
|
|
+ datesStrings.add(date.format(formatter));
|
|
|
+ }
|
|
|
+ return datesStrings;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getDayName(String dateString){
|
|
|
+ LocalDate date = LocalDate.parse(dateString, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
+ return date.getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.CHINA);
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<String> getYearMonth(){
|
|
|
+ List<String> years = new ArrayList<>();
|
|
|
+ for (int day = 1; day <=12; day++) {
|
|
|
+ years.add("" + day);
|
|
|
+ }
|
|
|
+ return years;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<String> getAllDatesOfMonth(String yearMonthStr) {
|
|
|
+ YearMonth yearMonth = YearMonth.parse(yearMonthStr, DateTimeFormatter.ofPattern("yyyy-MM"));
|
|
|
+ List<String> dates = new ArrayList<>();
|
|
|
+ for (int day = 1; day <= yearMonth.lengthOfMonth(); day++) {
|
|
|
+ dates.add(yearMonth.atDay(day).toString());
|
|
|
+ }
|
|
|
+ return dates;
|
|
|
+ }
|
|
|
+
|
|
|
+ private String getDiDian() {
|
|
|
+ IPartyPositionService partyPositionService = AppUtil.getBean(IPartyPositionService.class);
|
|
|
+ APIResult<List<PartyPositionPo>> result = partyPositionService.findByUserId(ContextUtil.getCurrentUserId());
|
|
|
+ String diDian ="";
|
|
|
+ try {
|
|
|
+ diDian = result.getData().get(0).getPath().split(StringPool.BACK_SLASH + StringPool.DOT)[1];
|
|
|
+ }catch (Exception ex){
|
|
|
+ logger.error("Can't get didian information",ex);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return diDian;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|