项目中日历管理学习使用

news2024/11/17 12:53:52

一些项目中会有日历或日期设置,最基本的会显示工作日,休息日,节假日等等,下面就是基于项目中的日历管理功能,要显示工作日,休息日,节假日

效果图

在这里插入图片描述

获取国家法定节假日工具类

public class HolidayUtils {

    private static Logger logger = LoggerFactory.getLogger(HolidayUtils.class);

    public static Map<String,Map<String,OtherData>> monthToHolidayDate = new ConcurrentHashMap<>(12);
    public static Map<String,OtherData> dateToOtherData = new ConcurrentHashMap<>(12);

    public static void main(String[] args) {
        System.out.println(getAllHoliday(2024));
    }

    /**
     * 获取周末和节假日
     *
     * @param year
     * @return
     */
    public static List<String> getAllHoliday(int year) {

        // 获取所有的周末
        Set<String> allWeekend = getAllWeekend(year);
        // http://timor.tech/api/holiday api文档地址
        Map apiHoliday = getApiHoliday(year);
        Integer code = (Integer) apiHoliday.get("code");
        if (code != 0) {
            return null;
        }
        Map<String, Map<String, Object>> holiday = (Map<String, Map<String, Object>>) apiHoliday.get("holiday");
        Set<String> strings = holiday.keySet();
        for (String str : strings) {
            Map<String, Object> stringObjectMap = holiday.get(str);
            Integer wage = (Integer) stringObjectMap.get("wage");
            String date = (String) stringObjectMap.get("date");
            //筛选掉补班
            if (wage.equals(1)) {
                allWeekend.remove(date);
            } else {
                allWeekend.add(date);
            }
            int monthByDate = CalendarUtils.getMonthByDate(CalendarUtils.parseDateStrToDate(date, "yyyy-MM-dd"));
            if (!monthToHolidayDate.containsKey(monthByDate)){
                monthToHolidayDate.put(monthByDate+"",new HashMap<>());
            }
            Map<String, OtherData> dateToOtherData = monthToHolidayDate.get(monthByDate);
            if (dateToOtherData == null) dateToOtherData = new HashMap<>();
            if (!dateToOtherData.containsKey(date)){
                OtherData otherData = new OtherData();
                otherData.putAll(stringObjectMap);
                dateToOtherData.put(date,otherData);
                dateToOtherData.put(date,otherData);
            }
        }

        List<String> result = new ArrayList<>(allWeekend);
        result = result.stream().sorted().collect(Collectors.toList());
        return result;
    }

    /**
     * 获取节假日不含周末
     *
     * @param year
     * @return
     */
    private static Map getApiHoliday(int year) {
        String url = "http://timor.tech/api/holiday/year/" + year;
        String rsa = HttpUtil.get(url);
        logger.info("rsa:{}",rsa);
        Map map = JsonConverter.jsonStrToObject(rsa, Map.class);
        return map;
    }

    /**
     * 获取周末  月从0开始
     *
     * @param year
     * @return
     */
    public static Set<String> getAllWeekend(int year) {
        Set<String> dateList = new HashSet<>();
        SimpleDateFormat simdf = new SimpleDateFormat("yyyy-MM-dd");
        Calendar calendar = new GregorianCalendar(year, 0, 1);
        Calendar endCalendar = new GregorianCalendar(year, 11, 31);
        while (true) {
            int weekday = calendar.get(Calendar.DAY_OF_WEEK);
            if (weekday == 1 || weekday == 7) {
                dateList.add(simdf.format(calendar.getTime()));
            }
            calendar.add(Calendar.DATE, 1);
            if (calendar.getTimeInMillis() >= endCalendar.getTimeInMillis()) {
                break;
            }
        }
        return dateList;
    }

    public static Map<String,OtherData> getHolidayByMonth(String month,Date date){
        if (monthToHolidayDate == null) return new HashMap<>();
        if (StringUtils.isNotBlank(month)){
            month = CalendarUtils.getMonthByDate(date) + "";
            Map<String, OtherData> dateToOtherData = monthToHolidayDate.get(month);
            if (dateToOtherData == null) dateToOtherData = new HashMap<>();
            return dateToOtherData;
        }
        return new HashMap<>();
    }

    public static OtherData getHolidayByDate(Date date){
        String month = CalendarUtils.getMonthByDate(date) + "";
        Map<String, OtherData> dateToOtherData = monthToHolidayDate.get(month);
        if (dateToOtherData == null || dateToOtherData.size() == 0) return null;
        String dateStr = CalendarUtils.toString(date, "yyyy-MM-dd");
        OtherData otherData = dateToOtherData.get(dateStr);
        if (otherData != null && otherData.obtainVal("wage",Integer.class) != null
                && 1 == otherData.obtainVal("wage",Integer.class)){
            return null;
        }
        return otherData;
    }

    public static String isHoliday(Date date){
        String month = CalendarUtils.getMonthByDate(date) + "";
        Map<String, OtherData> dateToOtherData = monthToHolidayDate.get(month);
        if (dateToOtherData == null || dateToOtherData.size() == 0) return null;
        String dateStr = CalendarUtils.toString(date, "yyyy-MM-dd");
        OtherData otherData = dateToOtherData.get(dateStr);
        if (otherData == null) return null;
        if (otherData != null && otherData.obtainVal("wage",Integer.class) != null
                && 1 == otherData.obtainVal("wage",Integer.class)){
            return DateRec.DATE_TYPE_WORK;
        }
        return DateRec.DATE_TYPE_HOLIDAY;
    }

}

返回的JSON数据格式

{
	"code": 0,
	"holiday": {
		"01-01": {
			"holiday": true,
			"name": "元旦",
			"wage": 3,
			"date": "2024-01-01",
			"rest": 1
		},
		"02-04": {
			"holiday": false,
			"name": "春节前补班",
			"wage": 1,
			"after": false,
			"target": "春节",
			"date": "2024-02-04",
			"rest": 9
		},
		"02-10": {
			"holiday": true,
			"name": "初一",
			"wage": 3,
			"date": "2024-02-10",
			"rest": 15
		},
		"02-11": {
			"holiday": true,
			"name": "初二",
			"wage": 3,
			"date": "2024-02-11",
			"rest": 1
		},
		"02-12": {
			"holiday": true,
			"name": "初三",
			"wage": 3,
			"date": "2024-02-12"
		},
		"02-13": {
			"holiday": true,
			"name": "初四",
			"wage": 2,
			"date": "2024-02-13"
		},
		"02-14": {
			"holiday": true,
			"name": "初五",
			"wage": 2,
			"date": "2024-02-14"
		},
		"02-15": {
			"holiday": true,
			"name": "初六",
			"wage": 2,
			"date": "2024-02-15"
		},
		"02-16": {
			"holiday": true,
			"name": "初七",
			"wage": 2,
			"date": "2024-02-16"
		},
		"02-17": {
			"holiday": true,
			"name": "初八",
			"wage": 2,
			"date": "2024-02-17"
		},
		"02-18": {
			"holiday": false,
			"name": "春节后补班",
			"wage": 1,
			"after": true,
			"target": "春节",
			"date": "2024-02-18"
		},
		"04-04": {
			"holiday": true,
			"name": "清明节",
			"wage": 3,
			"date": "2024-04-04",
			"rest": 46
		},
		"04-05": {
			"holiday": true,
			"name": "清明节",
			"wage": 2,
			"date": "2024-04-05"
		},
		"04-06": {
			"holiday": true,
			"name": "清明节",
			"wage": 2,
			"date": "2024-04-06"
		},
		"04-07": {
			"holiday": false,
			"name": "清明节后补班",
			"wage": 1,
			"target": "清明节",
			"after": true,
			"date": "2024-04-07"
		},
		"04-28": {
			"holiday": false,
			"name": "劳动节前补班",
			"wage": 1,
			"target": "劳动节",
			"after": false,
			"date": "2024-04-28"
		},
		"05-01": {
			"holiday": true,
			"name": "劳动节",
			"wage": 3,
			"date": "2024-05-01"
		},
		"05-02": {
			"holiday": true,
			"name": "劳动节",
			"wage": 2,
			"date": "2024-05-02",
			"rest": 1
		},
		"05-03": {
			"holiday": true,
			"name": "劳动节",
			"wage": 3,
			"date": "2024-05-03"
		},
		"05-04": {
			"holiday": true,
			"name": "劳动节",
			"wage": 3,
			"date": "2024-05-04"
		},
		"05-05": {
			"holiday": true,
			"name": "劳动节",
			"wage": 3,
			"date": "2024-05-05"
		},
		"05-11": {
			"holiday": false,
			"name": "劳动节后补班",
			"after": true,
			"wage": 1,
			"target": "劳动节",
			"date": "2024-05-11"
		},
		"06-08": {
			"holiday": true,
			"name": "端午节",
			"wage": 2,
			"date": "2024-06-08"
		},
		"06-09": {
			"holiday": true,
			"name": "端午节",
			"wage": 2,
			"date": "2024-06-09"
		},
		"06-10": {
			"holiday": true,
			"name": "端午节",
			"wage": 3,
			"date": "2024-06-10"
		},
		"09-14": {
			"holiday": false,
			"name": "中秋节前补班",
			"after": false,
			"wage": 1,
			"target": "中秋节",
			"date": "2024-09-14",
			"rest": 96
		},
		"09-15": {
			"holiday": true,
			"name": "中秋节",
			"wage": 2,
			"date": "2024-09-15",
			"rest": 97
		},
		"09-16": {
			"holiday": true,
			"name": "中秋节",
			"wage": 2,
			"date": "2024-09-16"
		},
		"09-17": {
			"holiday": true,
			"name": "中秋节",
			"wage": 3,
			"date": "2024-09-17"
		},
		"09-29": {
			"holiday": false,
			"name": "国庆节前补班",
			"after": false,
			"wage": 1,
			"target": "国庆节",
			"date": "2024-09-29"
		},
		"10-01": {
			"holiday": true,
			"name": "国庆节",
			"wage": 3,
			"date": "2024-10-01"
		},
		"10-02": {
			"holiday": true,
			"name": "国庆节",
			"wage": 3,
			"date": "2024-10-02",
			"rest": 1
		},
		"10-03": {
			"holiday": true,
			"name": "国庆节",
			"wage": 3,
			"date": "2024-10-03"
		},
		"10-04": {
			"holiday": true,
			"name": "国庆节",
			"wage": 2,
			"date": "2024-10-04"
		},
		"10-05": {
			"holiday": true,
			"name": "国庆节",
			"wage": 2,
			"date": "2024-10-05"
		},
		"10-06": {
			"holiday": true,
			"name": "国庆节",
			"wage": 2,
			"date": "2024-10-06",
			"rest": 1
		},
		"10-07": {
			"holiday": true,
			"name": "国庆节",
			"wage": 2,
			"date": "2024-10-07",
			"rest": 1
		},
		"10-12": {
			"holiday": false,
			"after": true,
			"wage": 1,
			"name": "国庆节后补班",
			"target": "国庆节",
			"date": "2024-10-12"
		}
	}
}

实体模型

@Entity
@Table(
    name = "t_daterec",
    indexes={
        @Index(name="idx_t_daterec1",columnList="dateType"),
        @Index(name="idx_t_daterec2",columnList="dateTime")
    }
)
public class DateRec extends ExBizEntity {

    public static final String DATE_TYPE_WORK = "work";
    public static final String DATE_TYPE_WEEKEND = "weekend";
    public static final String DATE_TYPE_HOLIDAY = "holiday";

    @Column(length=20,nullable=false)
    private String dateType;//日历类型
    private Date dateTime;//日期

    public String getDateType() {
        return dateType;
    }

    public Date getDateTime() {
        return dateTime;
    }

    public DateRec() {
    }

    public DateRec(String id,String dateType, Date dateRTime) {
    	this.id = id;
        this.dateType = dateType;
        this.dateTime = dateTime;
    }
}
@Entity
@Table(
        name = "t_holiday",
        indexes={
                @Index(name="idx_t_holiday1",columnList="holidayDate")
        }
)
public class Holiday extends ExBizEntity{

    private Date holidayDate;

    public Holiday() {
    }

    public Holiday(Date holidayDate) {
        this.holidayDate = holidayDate;
    }

    public Date getHolidayDate() {
        return holidayDate;
    }
}

超类

@MappedSuperclass
public abstract class ExBizEntity extends ValueObjectEntity {
    
    @Type(type="com.xysd.common.utils.hibernateType.MyCustomJsonType")
    private OtherData exAttr = new OtherData();//额外属性map
    
    public OtherData getExAttr() {
        return exAttr;
    }
    
    
    protected ExBizEntity(){
        super();
    }
    protected ExBizEntity(Map<String, Object> exAttr) {
        super();
        this.getNotNullExAttrWithUpdate().putAll(exAttr);
    }
    
    
    //获取非空扩展属性
    private OtherData getNotNullExAttrWithUpdate() {
        if(this.exAttr == null) this.exAttr = new OtherData();
        return this.exAttr;
    }
    public void clearExAttr(){
        this.exAttr = null;
    }
    //更新扩展属性
    public void updateExAttr(Map<String, Object> exAttr){
        this.getNotNullExAttrWithUpdate().clear();
        if(exAttr==null) {
            this.exAttr = null;
            return;
        }
        this.addAttrs(exAttr);
    }
    //添加扩展属性
    public void addAttr(String key, Object value){
        if(StringUtils.isBlank(key)) return;
        if(value==null) {
            this.getNotNullExAttrWithUpdate().remove(key);
        }else {
            this.getNotNullExAttrWithUpdate().put(key, value);
        }
    }
    //添加扩展属性
    public void addAttrs(Map<String, Object> exAttr){
        if(exAttr==null) return;
        for (Map.Entry<String,Object> e : exAttr.entrySet()) {
            this.addAttr(e.getKey(), e.getValue());
        }
    }
    
    //获取指定类型的对象
    @Transient
    public <T> T getAttr(String key) {
        if(this.exAttr==null) return null;
        return this.exAttr.obtainVal(key);
    }
    //获取指定类型的对象
    @Transient
    public <T> T getAttr(String key, Class<T> valClass) {
        if(this.exAttr==null) return null;
      return this.exAttr.obtainVal(key, valClass);
    }
    //获取指定转换类型的对象
    @Transient
    public <T> T getAttr(String key, TypeReference<T> valTypeRef) {
        if(this.exAttr==null) return null;
        return this.exAttr.obtainVal(key, valTypeRef);
    }
    
}
@MappedSuperclass
public abstract class ValueObjectEntity extends IEntity{
    public static String SYSCODE_CAD="cad";//系统编码-cad:cad接口

    protected Date createTime = new Date();//创建时间
    @Type(type = "org.hibernate.type.NumericBooleanType")
    protected boolean history=false;
    @Column(length=40)
    protected String createIp;//创建时的ip
    protected int valid=1;//有效性
    protected Date lastUpdateDate = new Date();//最后更新时间
    
    @Column(length=10)
    protected String syscode=SYSCODE_HDXF; //数据系统编码
    
    
    public Date getCreateTime() {
        return createTime;
    }
    public boolean isHistory() {
        return history;
    }
    public String getCreateIp() {
        return createIp;
    }
    public int getValid() {
        return valid;
    }
    public Date getLastUpdateDate() {
        return lastUpdateDate;
    }
    public String getSyscode() {
        return syscode;
    }
    
    
    protected ValueObjectEntity() {
        super();
    }
    

    @Transient
    public boolean isValidEntity(){
        return this.getValid()==1;
    }
    public void updateValid(int valid){
        this.valid = valid;
    }

}
@MappedSuperclass
public abstract class IEntity {

    @Id
    @Column(length=100)
    @GeneratedValue(generator="uuidkey")
    @GenericGenerator(name="uuidkey", strategy = "com.xysd.common.utils.BaseIDGenerator")
    protected String id;

	public String getId() {
		return this.id;
	}
	
    /**
     * 对比俩个实体是否是同一个
     */
	public boolean compareObject(IEntity other) {
        return other != null && new EqualsBuilder().
            append(this.id, other.getId()).
            isEquals();
	}
	
}

public class BaseIDGenerator implements IdentifierGenerator {

    private static AutoIncrementIdUtil autoIncrementIdUtil;

    public static void registAutoIncrementIdUtil(AutoIncrementIdUtil autoIncrementIdUtil){
        BaseIDGenerator.autoIncrementIdUtil = autoIncrementIdUtil;
    }

	@Override
    public Serializable generate(SharedSessionContractImplementor arg0,
            Object o) throws HibernateException {
        if(o instanceof NeedAutoIncrementId){
            NeedAutoIncrementId entity = (NeedAutoIncrementId) o;
            String id = entity.obtainId();
            if(!StringUtils.isEmpty(id)){
                entity.initId(id);
            }else {
                id = autoIncrementIdUtil.getId(entity.getClass().getSimpleName(), entity.obtainParentId(),
                        entity.obtainLength(), entity.obtainSeparator());
                entity.initId(id);
            }
            return id;
        }
        if(o instanceof IEntity){
            //允许自己指定ID
        	IEntity be = (IEntity)o;
            if(StringUtils.isNotBlank(be.getId())){
                return be.getId();
            }
        }
        return Utils.getUUID("");
    }
}

接口

@ApiOperation(value="日历管理查看",httpMethod="GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name="year",value="年份",required=true),
            @ApiImplicitParam(name="month",value="月份",required=true)
    })
    @RequestMapping(value = "/dates/list", method = RequestMethod.GET)
    public String getDates(@RequestParam int year, @RequestParam int month, HttpServletRequest hreq) {
        String weeks = myService.getDates(year,month);
        return weeks;
    }

}

Service服务及封装数据

@Service
public class MyService {

    @Autowired
    private DateRecRepositoryHibernate dateRecRepositoryHibernate;

	@PostConstruct
    public void init(){
        //加载国家法定节假日
        HolidayUtils.getAllHoliday(CalendarUtils.getCurrentYear());
        Map<String, OtherData> dateToOtherData = HolidayUtils.dateToOtherData;
        List<Holiday> holidays = this.dateRecRepositoryHibernate.getHolidays();
        if (CollectionUtils.isNotEmpty(holidays)) {
            for (Holiday holiday : holidays) {
                HolidayUtils.dateToOtherData.put(CalendarUtils.toString(holiday.getHolidayDate(), "yyyy-MM-dd"), holiday.getExAttr());
            }
        } else {
            for (Map.Entry<String, OtherData> entry : dateToOtherData.entrySet()) {
                Holiday h = new Holiday(CalendarUtils.parseDateStrToDate(entry.getKey(), "yyyy-MM-dd"));
                h.addAttrs(entry.getValue());
                this.dateRecRepositoryHibernate.createOrUpdateHoliday(h);
            }
        }
    }

    public String getDates(int year, int month) {
        //要返回前端展示使用
        List<WeekDTO> weeks = new ArrayList<WeekDTO>();
        //获取year年month月的第一天
        Date monthBegin = CalendarUtils.getMonthBeginByYearAndMonth(year, month);
        //获取year年month月的最后一天
        Date monthEnd = CalendarUtils.getMonthEndByYearAndMonth(year, month);
        WeekValObj wo = CalendarUtils.getWeekValObjByDateOfYear(monthBegin);
        //获取year年month月的第一天是这一年中第几周
        int weekNumOfMonthBegin = wo.getWeek();
        //selectYear就是year
        int selectedYear = wo.getYear();
        Map<String, DateDTO> allDates = new HashMap<String, DateDTO>();
        List<String> dates = new ArrayList<String>();
        int weekNum = 7;
        for (int k = 0; k < weekNum; k++) {
            //获取selectyear年总共有几周
            int maxWeekOfYear = CalendarUtils.getMaxWeekCountByYear(selectedYear);
            //获取selectedYear年第weekNumOfMonthBegin周的第一天日期
            Date weekBegin = CalendarUtils.getWeekBeginByYearAndWeek(selectedYear, weekNumOfMonthBegin);
            List<DateDTO> weekDates = new ArrayList<DateDTO>();
            if (weekBegin == null) {//如果没有获取到 则默认为year+1年的第一周的第一天日期
                weekBegin = CalendarUtils.getWeekBeginByYearAndWeek(year + 1, 1);
            }
            if (weekBegin != null && weekBegin.getTime() < monthEnd.getTime()) {
                for (int i = 0; i < 7; i++) {
                    //开始取第weekNumOfMonthBegin周的第i天
                    Date d = DateUtils.addDays(weekBegin, i);
                    String type = null;
                    if (StringUtils.isNotBlank(HolidayUtils.isHoliday(d))) {
                        type = HolidayUtils.isHoliday(d);
                    } else {
                        type = DateRec.DATE_TYPE_WORK;
                        if (i >= 5) {
                            type = DateRec.DATE_TYPE_WEEKEND;
                        }
                    }
                    //是否要展示
                    boolean display = d.getTime() >= monthBegin.getTime() && d.getTime() <= monthEnd.getTime();
                    String dateStr = CalendarUtils.toString(d, "yyyy-MM-dd");
                    DateDTO dateDTO = new DateDTO(dateStr, type, display);
                    weekDates.add(dateDTO);
                    allDates.put(dateDTO.getDate(), dateDTO);
                }
                weeks.add(new WeekDTO(year, weekNumOfMonthBegin, weekDates));
            }
            if (weekNumOfMonthBegin >= maxWeekOfYear) {
                selectedYear++;
                weekNumOfMonthBegin = 1;
            } else {
                weekNumOfMonthBegin++;
            }
        }
        dates.addAll(allDates.keySet());
        Map<String, Object> params = new HashMap<>();
        params.put("dates", dates);
        List<DateRec> existedDateRecs = this.dateRecRepositoryHibernate.getDateRecBy(params);
        for (DateRec drec : existedDateRecs) {
            //已存在的
            DateDTO dto = allDates.remove(drec.getId());
            if (dto != null) {
                dto.setDateType(drec.getDateType());
            }
        }
        for (DateDTO dto : allDates.values()) {
            //需要创建的
            DateRec drec = new DateRec(dto.getDate(),dto.getDateType(), CalendarUtils.parseDateStrToDate(dto.getDate(), "yyyy-MM-dd"));
            this.dateRecRepositoryHibernate.createOrUpdateDateRec(drec);
        }
        return JsonConverter.toJsonStr(weeks);
    }

}

数据基础层

@Repository
public class DateRecRepositoryHibernate extends JpaHibernateRepository {

    public void createOrUpdateDateRec(DateRec dateRec){
        this.getSession().saveOrUpdate(dateRec);
    }

    public List<DateRec> getDateRecBy(Map<String,Object> params){
        StringBuffer sql = new StringBuffer();
        sql.append(" select id from t_daterec where valid = 1 ");
        if (params.get("ids") != null){
            sql.append(" and id in (:ids) ");
        }
        if (params.get("dates") != null){
            sql.append(" and date in (:dates) ");
        }
        if (params.get("dateTypes") != null){
            sql.append(" and date_type in (:dateTypes) ");
        }
        List<String> ids = this.createSQLQueryByMapParams(sql.toString(), params).list();
        if (CollectionUtils.isEmpty(ids)) return new ArrayList<>();
        List<DateRec> recs = this.findByOrderedIds(DateRec.class, ids);
        if (recs == null) return new ArrayList<>();
        return recs;
    }

    public void createOrUpdateHoliday(Holiday holiday){
        this.getSession().saveOrUpdate(holiday);
    }

    public List<Holiday> getHolidays(){
        String sql = "select d from " + Holiday.class.getName() + " d where d.holidayDate >= : begin and d.holidayDate <= :end ";
        List<Holiday> list = this.createHQLQueryByMapParams(Holiday.class, sql, Utils.buildMap("begin", CalendarUtils.getCurrentYearBeginDate(), "end", CalendarUtils.getCurrentYearEndDate())).list();
        if (list == null) list = new ArrayList<>();
        return list;
    }
}

请求返回值

[
	{
		"year": 2024,
		"weekNum": 5,
		"dates": [
			{
				"date": "2024-01-29",
				"dateType": "work",
				"display": false
			},
			{
				"date": "2024-01-30",
				"dateType": "work",
				"display": false
			},
			{
				"date": "2024-01-31",
				"dateType": "work",
				"display": false
			},
			{
				"date": "2024-02-01",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-02",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-03",
				"dateType": "weekend",
				"display": true
			},
			{
				"date": "2024-02-04",
				"dateType": "weekend",
				"display": true
			}
		]
	},
	{
		"year": 2024,
		"weekNum": 6,
		"dates": [
			{
				"date": "2024-02-05",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-06",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-07",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-08",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-09",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-10",
				"dateType": "weekend",
				"display": true
			},
			{
				"date": "2024-02-11",
				"dateType": "weekend",
				"display": true
			}
		]
	},
	{
		"year": 2024,
		"weekNum": 7,
		"dates": [
			{
				"date": "2024-02-12",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-13",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-14",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-15",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-16",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-17",
				"dateType": "weekend",
				"display": true
			},
			{
				"date": "2024-02-18",
				"dateType": "weekend",
				"display": true
			}
		]
	},
	{
		"year": 2024,
		"weekNum": 8,
		"dates": [
			{
				"date": "2024-02-19",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-20",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-21",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-22",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-23",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-24",
				"dateType": "weekend",
				"display": true
			},
			{
				"date": "2024-02-25",
				"dateType": "weekend",
				"display": true
			}
		]
	},
	{
		"year": 2024,
		"weekNum": 9,
		"dates": [
			{
				"date": "2024-02-26",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-27",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-28",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-02-29",
				"dateType": "work",
				"display": true
			},
			{
				"date": "2024-03-01",
				"dateType": "work",
				"display": false
			},
			{
				"date": "2024-03-02",
				"dateType": "weekend",
				"display": false
			},
			{
				"date": "2024-03-03",
				"dateType": "weekend",
				"display": false
			}
		]
	}
]

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1413943.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

2024年,我与CSDN的邂逅之旅:一段燃烧激情、成就梦想的博客专家之路

文章目录 初入CSDN知识分享的本质什么有用学什么 成为博客专家的经历成为博客专家有什么好处实际好处隐形好处 今天获得了CSDN认证的博客专家&#xff0c;感觉很开心~分享一下这个始末。分享一下我和CSDN的5年邂逅。 初入CSDN 进入CSDN已经五年了&#xff0c;大一开始写博客&a…

Prometheus 架构全面解析

在本指南中&#xff0c;我们将详细介绍 Prometheus 架构。 Prometheus 是一个用 Golang 编写的开源监控和告警系统&#xff0c;能够收集和处理来自各种目标的指标。您还可以查询、查看、分析指标&#xff0c;并根据阈值收到警报。 此外&#xff0c;在当今世界&#xff0c;可观…

21.云原生之GitLab pipline语法实战(CI基础)

云原生专栏大纲 文章目录 gitlab-ci.yml 介绍GitLab中语法检测gitlab-ci.yml 语法job定义作业before_script和after_scriptstages定义阶段tages指定runnerallow_failure运行失败when控制作业运行retry重试timeout超时parallel并行作业only & exceptrulescache 缓存cache:p…

Windows10系统任务栏变小怎么处理

首先&#xff0c;邮件任务栏&#xff0c;点击任务栏设置&#xff1b; 然后&#xff0c;将小任务栏 使能关闭&#xff08;图中为打开状态&#xff09;&#xff1b; 或者&#xff0c;你也可以取消锁定任务栏&#xff0c;然后在任务栏的边缘&#xff0c;进行上下拉拖动&#xff…

记签名机制

签名过程&#xff1a; 首先将数据源通过摘要算法获取到数字摘要 对数字摘要用私钥进行加密得到签名 将原始消息 以及签名发送给消息接收方 接收方用公钥解密得到数字摘要 用同样的摘要算法将原始消息进行计算 比较得到的数字摘要与解密后的是否一致 Android学习笔记——Androi…

Android源码设计模式解析与实战第2版笔记(二)

第二章 应用最广的模式 — 单例模式 单例模式的定义 确保某一个类只有一个实例&#xff0c;而且自行实例化并向整个系统提供这个实例。 单例模式的使用场景 确保某个类有且只有一个对象的场景&#xff0c;避免产生多个对象消耗过多的资源&#xff0c;或者某种类型的对象只应…

水文模型SWMM与LisFlood耦合(pdf文档、软件见资源)

总技术路线图 INP生成图解 文献&#xff1a;面向服务的Web-SWMM构建研究 regardingINP为ArcGIS Pro项目 1.SWMM模型数据准备与参数设置 1.子汇水区 文件位于&#xff1a;beforeGenerateINP/generateSub.py&#xff08;一级划分&#xff09; 问题&#xff1a; 水文分析阈值划…

85 总结一下最近遇到的一些 jar发布 相关的知识

前言 呵呵 最近有一些构建服务, 发布服务的一些需求 我们这里的服务 一般来说是 java application, spring boot application 针对发布, 当然最好是 增量发布, 尽量的减少需要传递给 发布服务器 的资源的大小 比如 我的这个 java application, 可能会存在很多依赖, 常规…

Arduino开发实例-HTU21D温度和湿度传感器使用

HTU21D温度和湿度传感器使用 文章目录 HTU21D温度和湿度传感器使用1、HTU21D介绍2、硬件接线3、代码实现本文将详细介绍如何使用搭载来自瑞士 MEAS 的低成本、易于使用、高精度的HTU21D数字温度和湿度传感器模块。 1、HTU21D介绍 HTU21D传感器模块尺寸小,几乎可以安装在任何东…

MySQL连表操作之一对多

MySQL连表操作之一对多 目录 引入外键 Navicat创建外键使用外键SQL命令创建外键代码删除外键代码增加外键通过外键进行数据操作 正文 回到顶部 引入 当我们在数据库中创建表的时候&#xff0c;有可能某些列中值内容量很大&#xff0c;而且重复。 例子&#xff1a;创建一个…

磁盘挂载过程

硬盘 - 机械 HDD----便宜---这个&#xff0c;企业中更多- 固态 SSD----快SSD采用电子存储介质进行数据存储和读取的一种技术&#xff0c;突破了传统机械硬盘的性能瓶颈&#xff0c; 拥有极高的存储性能&#xff0c;被认为是存储技术发展的新星。 与传统硬盘相比&#xff0c;SSD…

系统架构演变

1.1系统架构的演变 2008年以后&#xff0c;国内互联网行业飞速发展&#xff0c;我们对软件系统的需求已经不再是过去”能用就行”这种很low的档次了&#xff0c;像抢红包、双十一这样的活动不断逼迫我们去突破软件系统的性能上限&#xff0c;传统的IT企业”能用就行”的开发思…

单片机设计_智能蓝牙电子秤(51单片机、HX711AD)

想要更多项目私wo!!! 一、电路设计 智能蓝牙电子称由51单片机、HX711AD称重模块、HC-05蓝牙模块、LCD1602等电路组成硬件部分,然后上传至APP。 二、运行结果 三、部分代码 #include "main.h" #include "HX711.h" #include "uart.h" #include …

【蓝桥杯冲冲冲】[NOIP2000 提高组] 方格取数

蓝桥杯备赛 | 洛谷做题打卡day19 文章目录 蓝桥杯备赛 | 洛谷做题打卡day19[NOIP2000 提高组] 方格取数题目背景题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1 提示题解代码我的一些话 [NOIP2000 提高组] 方格取数 题目背景 NOIP 2000 提高组 T4 题目描述 设有 N N…

已解决:安卓,怎么优雅接入科大讯飞语音评测功能?

写在前面&#xff1a; 网上关于讯飞接入的博客都很少&#xff0c;按说讯飞都是业界翘楚&#xff0c;不知为何&#xff0c;很少搜索到精品&#xff0c;一搜就是一个要求开会员的博客&#xff0c;我也是醉了。讯飞提供的文档也是不清晰&#xff0c;我是摸着石头过河&#xff0c;…

MySQL JSON数据类型全解析(JSON datatype and functions)

JSON&#xff08;JavaScript Object Notation&#xff09;是一种常见的信息交换格式&#xff0c;其简单易读且非常适合程序处理。MySQL从5.7版本开始支持JSON数据类型&#xff0c;本文对MySQL中JSON数据类型的使用进行一个总结。 目录 一、MySQL中的JSON 1.1 JSON数据格式 1.2 …

最长公共子串的问题(正常方法和矩阵法,动态规划)

题目&#xff1a; 给定两个字符串 text1 和 text2&#xff0c;返回这两个字符串的最长 公共子序列 的长度。如果不存在 公共子序列 &#xff0c;返回 0 。 一个字符串的 子序列 是指这样一个新的字符串&#xff1a;它是由原字符串在不改变字符的相对顺序的情况下删除某些字符…

Windows Qt C++ VTK 绘制三维曲线

Qt 自带数据可视化从文档上看&#xff0c;只能实现三维曲面。 QwtPlot3D在Qt6.6.0上没编译通过。 QCustomPlot 只能搞二维。 VTK~搞起。抄官网demo。 后续需求&#xff1a; 1、对数轴 2、Y轴逆序 3、Z轴值给色带&#xff0c;类似等高线图的色带 期待各位大佬多多指导。…

如何快速搭建实用的爬虫管理平台

目录 一、前言 二、选择合适的爬虫框架 三、搭建数据库 步骤1 步骤2 步骤3 四、搭建Web服务器 步骤1 步骤2 步骤3 步骤4 五、管理爬虫 六、总结 一、前言 爬虫是互联网数据采集的关键工具&#xff0c;但是随着数据量的增加和需求的多样化&#xff0c;手动运行和管…

超越传统,想修哪里就修哪里,SUPIR如何通过文本提示实现智能图像修复

项目简介 通过参数增加使得模型不仅能够修复图像中的错误或损坏&#xff0c;还能根据文本提示进行智能修复。例如根据描述来改变图像中的特定细节。这样的处理方式提升了图像修复的质量和智能度&#xff0c;使得模型能够更准确、更灵活地恢复和改进图像。 SUPIR的主要功能图像…