YunaiV 2023-08-27 11:19:27 +08:00
parent bb34cdea2c
commit f82a323508
17 changed files with 62 additions and 47 deletions

View File

@ -23,6 +23,8 @@ public class DateUtils {
*/
public static final long SECOND_MILLIS = 1000;
public static final String FORMAT_YEAR_MONTH_DAY = "yyyy-MM-dd";
public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND = "yyyy-MM-dd HH:mm:ss";
public static final String FORMAT_HOUR_MINUTE_SECOND = "HH:mm:ss";
@ -34,6 +36,9 @@ public class DateUtils {
* @return LocalDateTime
*/
public static Date of(LocalDateTime date) {
if (date == null) {
return null;
}
// 将此日期时间与时区相结合以创建 ZonedDateTime
ZonedDateTime zonedDateTime = date.atZone(ZoneId.systemDefault());
// 本地时间线 LocalDateTime 到即时时间线 Instant 时间戳
@ -49,6 +54,9 @@ public class DateUtils {
* @return LocalDateTime
*/
public static LocalDateTime of(Date date) {
if (date == null) {
return null;
}
// 转为时间戳
Instant instant = date.toInstant();
// UTC时间(世界协调时间,UTC + 00:00)转北京(北京,UTC + 8:00)时间

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.bpm.convert.task;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.activity.BpmActivityRespVO;
import org.flowable.engine.history.HistoricActivityInstance;
import org.mapstruct.Mapper;
@ -14,7 +15,7 @@ import java.util.List;
*
* @author 芋道源码
*/
@Mapper
@Mapper(uses = DateUtils.class)
public interface BpmActivityConvert {
BpmActivityConvert INSTANCE = Mappers.getMapper(BpmActivityConvert.class);

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.bpm.convert.task;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstancePageItemRespVO;
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceRespVO;
@ -28,7 +29,7 @@ import java.util.Map;
*
* @author 芋道源码
*/
@Mapper
@Mapper(uses = DateUtils.class)
public interface BpmProcessInstanceConvert {
BpmProcessInstanceConvert INSTANCE = Mappers.getMapper(BpmProcessInstanceConvert.class);

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.bpm.convert.task;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskDonePageItemRespVO;
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskRespVO;
@ -26,7 +27,7 @@ import java.util.Map;
*
* @author 芋道源码
*/
@Mapper
@Mapper(uses = DateUtils.class)
public interface BpmTaskConvert {
BpmTaskConvert INSTANCE = Mappers.getMapper(BpmTaskConvert.class);
@ -46,8 +47,8 @@ public interface BpmTaskConvert {
}
@Mapping(source = "suspended", target = "suspensionState", qualifiedByName = "convertSuspendedToSuspensionState")
@Mapping(target = "claimTime", expression = "java(bean.getClaimTime()==null?null: LocalDateTime.ofInstant(bean.getClaimTime().toInstant(),ZoneId.systemDefault()))")
@Mapping(target = "createTime", expression = "java(bean.getCreateTime()==null?null:LocalDateTime.ofInstant(bean.getCreateTime().toInstant(),ZoneId.systemDefault()))")
// @Mapping(target = "claimTime", expression = "java(bean.getClaimTime()==null?null: LocalDateTime.ofInstant(bean.getClaimTime().toInstant(),ZoneId.systemDefault()))")
// @Mapping(target = "createTime", expression = "java(bean.getCreateTime()==null?null:LocalDateTime.ofInstant(bean.getCreateTime().toInstant(),ZoneId.systemDefault()))")
BpmTaskTodoPageItemRespVO convert1(Task bean);
@Named("convertSuspendedToSuspensionState")
@ -106,8 +107,8 @@ public interface BpmTaskConvert {
}
@Mapping(source = "taskDefinitionKey", target = "definitionKey")
@Mapping(target = "createTime", expression = "java(bean.getCreateTime() == null ? null : LocalDateTime.ofInstant(bean.getCreateTime().toInstant(), ZoneId.systemDefault()))")
@Mapping(target = "endTime", expression = "java(bean.getEndTime() == null ? null : LocalDateTime.ofInstant(bean.getEndTime().toInstant(), ZoneId.systemDefault()))")
// @Mapping(target = "createTime", expression = "java(bean.getCreateTime() == null ? null : LocalDateTime.ofInstant(bean.getCreateTime().toInstant(), ZoneId.systemDefault()))")
// @Mapping(target = "endTime", expression = "java(bean.getEndTime() == null ? null : LocalDateTime.ofInstant(bean.getEndTime().toInstant(), ZoneId.systemDefault()))")
BpmTaskRespVO convert3(HistoricTaskInstance bean);
BpmTaskRespVO.User convert3(AdminUserRespDTO bean);

View File

@ -5,7 +5,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.Date;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 公众号账号 Response VO")
@Data
@ -20,6 +20,6 @@ public class MpAccountRespVO extends MpAccountBaseVO {
private String qrCodeUrl;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private Date createTime;
private LocalDateTime createTime;
}

View File

@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.mp.controller.admin.material.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 公众号素材 Response VO")
@Data
@ -42,6 +42,6 @@ public class MpMaterialRespVO {
private String introduction;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private Date createTime;
private LocalDateTime createTime;
}

View File

@ -5,6 +5,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.time.LocalDateTime;
import java.util.Date;
@Schema(description = "管理后台 - 公众号菜单 Response VO")
@ -23,6 +24,6 @@ public class MpMenuRespVO extends MpMenuBaseVO {
private String appId;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private Date createTime;
private LocalDateTime createTime;
}

View File

@ -5,6 +5,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.time.LocalDateTime;
import java.util.Date;
@Schema(description = "管理后台 - 公众号自动回复 Response VO")
@ -22,6 +23,6 @@ public class MpAutoReplyRespVO extends MpAutoReplyBaseVO {
private String appId;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private Date createTime;
private LocalDateTime createTime;
}

View File

@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import me.chanjar.weixin.common.api.WxConsts;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
@ -96,6 +97,6 @@ public class MpMessageRespVO {
private String eventKey;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private Date createTime;
private LocalDateTime createTime;
}

View File

@ -3,14 +3,14 @@ package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 某一天的接口分析数据 Response VO")
@Data
public class MpStatisticsInterfaceSummaryRespVO {
@Schema(description = "日期", requiredMode = Schema.RequiredMode.REQUIRED)
private Date refDate;
private LocalDateTime refDate;
@Schema(description = "通过服务器配置地址获得消息后,被动回复粉丝消息的次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer callbackCount;

View File

@ -3,14 +3,14 @@ package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 某一天的粉丝增减数据 Response VO")
@Data
public class MpStatisticsUpstreamMessageRespVO {
@Schema(description = "日期", requiredMode = Schema.RequiredMode.REQUIRED)
private Date refDate;
private LocalDateTime refDate;
@Schema(description = "上行发送了(向公众号发送了)消息的粉丝数", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer messageUser;

View File

@ -3,14 +3,14 @@ package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 某一天的消息发送概况数据 Response VO")
@Data
public class MpStatisticsUserCumulateRespVO {
@Schema(description = "日期", requiredMode = Schema.RequiredMode.REQUIRED)
private Date refDate;
private LocalDateTime refDate;
@Schema(description = "累计粉丝量", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer cumulateUser;

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Date;
@Schema(description = "管理后台 - 某一天的粉丝增减数据 Response VO")
@ -10,7 +11,7 @@ import java.util.Date;
public class MpStatisticsUserSummaryRespVO {
@Schema(description = "日期", requiredMode = Schema.RequiredMode.REQUIRED)
private Date refDate;
private LocalDateTime refDate;
@Schema(description = "粉丝来源", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
private Integer userSource;

View File

@ -5,7 +5,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.Date;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 公众号标签 Response VO")
@Data
@ -20,6 +20,6 @@ public class MpTagRespVO extends MpTagBaseVO {
private Integer count;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private Date createTime;
private LocalDateTime createTime;
}

View File

@ -48,6 +48,6 @@ public class MpUserRespVO {
private String appId;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private Date createTime;
private LocalDateTime createTime;
}

View File

@ -5,7 +5,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.Date;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 站内信 Response VO")
@Data
@ -17,6 +17,6 @@ public class NotifyMessageRespVO extends NotifyMessageBaseVO {
private Long id;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private Date createTime;
private LocalDateTime createTime;
}

View File

@ -5,7 +5,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.Date;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 站内信模版 Response VO")
@ -21,6 +21,6 @@ public class NotifyTemplateRespVO extends NotifyTemplateBaseVO {
private List<String> params;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private Date createTime;
private LocalDateTime createTime;
}