| | |
| | | import me.zhengjie.modules.treatment.rest.CmnInsuranceController; |
| | | import me.zhengjie.utils.*; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.CacheManager; |
| | | import org.springframework.cache.annotation.CacheConfig; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.Pageable; |
| | |
| | | private final MongoTemplate mongoTemplate; |
| | | private final UserLevelWageRepository userLevelWageRepository; |
| | | private final UserInsuranceRepository userInsuranceRepository; |
| | | |
| | | @Autowired |
| | | private CacheManager cacheManager; |
| | | |
| | | @Override |
| | | public Object queryAll(UserQueryCriteria criteria, Pageable pageable) { |
| | |
| | | // c.add(Calendar.MONTH, 0); |
| | | // c.set(Calendar.DAY_OF_MONTH, 1); |
| | | // String todayMonth = df.format(c.getTime()); |
| | | String nextMonth_ = df.format(new Date(nextMonth)); |
| | | String nextMonth_ = df.format(new Date(nextMonth)).substring(0,7) + "-01"; |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(df.parse(nextMonth_)); |
| | | cal.add(Calendar.MONTH, 1); |
| | |
| | | String nextMonthFirstDay = df.format(cal.getTime()); |
| | | List<TaskDaliyMongo> daliyMongoList; |
| | | try { |
| | | // daliyMongoList = mongoTemplate.find(Query.query(new Criteria("userId").is(SecurityUtils.getCurrentUserId()).and("fillDate").gte(new SimpleDateFormat("yyyy-MM-dd").parse(todayMonth)).lte(new SimpleDateFormat("yyyy-MM-dd").parse(nextMonth_))), TaskDaliyMongo.class); |
| | | // daliyMongoList = mongoTemplate.find(Query.query(new Criteria("userId").is(SecurityUtils.getCurrentUserId()).and("fillDate").gte(new SimpleDateFormat("yyyy-MM-dd").parse(nextMonth_)).lt(new SimpleDateFormat("yyyy-MM-dd").parse(nextMonthFirstDay))), TaskDaliyMongo.class); |
| | | daliyMongoList = mongoTemplate.find(Query.query(new Criteria("userId").is(SecurityUtils.getCurrentUserId()).and("fillDate").gte(new SimpleDateFormat("yyyy-MM-dd").parse(nextMonth_)).lt(new SimpleDateFormat("yyyy-MM-dd").parse(nextMonthFirstDay))), TaskDaliyMongo.class); |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException(e); |
| | |
| | | throw new EntityExistException(User.class, "phone", resources.getPhone()); |
| | | } |
| | | redisUtils.del(CacheKey.TOTAL_USER); |
| | | redisUtils.del("user::AllUser"); |
| | | userRepository.save(resources); |
| | | // 判断用户级别变更 |
| | | checkUserLevel(resources.getId(), null, resources.getLevelId()); |
| | |
| | | user.setLevelId(resources.getLevelId()); |
| | | // 临时新用户级别ID |
| | | Long tempNewLevelId = user.getLevelId(); |
| | | redisUtils.del("user::AllUser"); |
| | | userRepository.save(user); |
| | | // 判断用户级别变更 |
| | | checkUserLevel(user.getId(), tempOldLevelId, tempNewLevelId); |
| | |
| | | // 获取当前年份 |
| | | int currentYear = Calendar.getInstance().get(Calendar.YEAR); |
| | | |
| | | // for (int i = 0; i < 2; i++) { |
| | | // // 第一条记录 |
| | | // SysUserLevelOther sysUserLevelOther = new SysUserLevelOther(); |
| | | // sysUserLevelOther.setUserId(resources.getId()); |
| | | // sysUserLevelOther.setLevelId(cmnLevel.getId()); |
| | | // sysUserLevelOther.setPersonalPerformanceProportion(Double.valueOf(0)); |
| | | // |
| | | // if (i == 1) { |
| | | // // 计算剩余年假 |
| | | // Double annualLeave = getAnnualLeave(calendar); |
| | | // sysUserLevelOther.setAnnualLeaveDays(annualLeave); |
| | | // } else { |
| | | // calendar.add(Calendar.YEAR, 1); |
| | | // // 设置月份为一月 |
| | | // calendar.set(Calendar.MONTH, Calendar.JANUARY); |
| | | // // 设置月份为一日 |
| | | // calendar.set(Calendar.DAY_OF_MONTH, 1); |
| | | // |
| | | // sysUserLevelOther.setAnnualLeaveDays(5.0); |
| | | // } |
| | | // // 年月 |
| | | // sysUserLevelOther.setYearMonth(sdf.format(calendar.getTime())); |
| | | // |
| | | // |
| | | // sysUserLevelOtherRepository.save(sysUserLevelOther); |
| | | // } |
| | | |
| | | // 添加两条数据 |
| | | for (int i = 0; i < 2; i++) { |
| | | if (i == 0) { |