diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java b/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java index 0ce4d102..df5076df 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java @@ -169,7 +169,7 @@ public class HistoryController { detailDTO.setActivityType(""); detailDTO.setStartTime(task.getCreateTime()); detailDTO.setEndTime(null); - detailDTO.setDurationInSeconds(null); + detailDTO.setDuration(""); detailDTO.setExecutionId(task.getExecutionId()); detailDTO.setProcessDefinitionId(task.getProcessDefinitionId()); detailDTO.setComment("待审核"); diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/dto/HistoryDetailDTO.java b/renren-admin/src/main/java/io/renren/modules/activiti/dto/HistoryDetailDTO.java index 615fdea8..465c68b5 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/dto/HistoryDetailDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/dto/HistoryDetailDTO.java @@ -45,8 +45,8 @@ public class HistoryDetailDTO { @ApiModelProperty(value = "结束时间") private Date endTime; - @ApiModelProperty(value = "时长(秒)") - private Long durationInSeconds; + @ApiModelProperty(value = "时长") + private String duration; @ApiModelProperty(value = "审批意见") private String comment; diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/entity/HistoryDetailEntity.java b/renren-admin/src/main/java/io/renren/modules/activiti/entity/HistoryDetailEntity.java index 4716e91e..4f2cef35 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/entity/HistoryDetailEntity.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/entity/HistoryDetailEntity.java @@ -33,7 +33,7 @@ public class HistoryDetailEntity { private Date endTime; - private Long durationInSeconds; + private String duration; private String comment; diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActivitiService.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActivitiService.java index 4a1ffe93..87339659 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActivitiService.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActivitiService.java @@ -22,4 +22,6 @@ public interface ActivitiService extends BaseService { Page getDeptProcessInstancePage(Map params); List getTaskHandleDetailInfo(String processInstanceId); + + String getDurationInSecond(Long second); } diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/impl/ActivitiServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/impl/ActivitiServiceImpl.java index c74cca65..4d282bbc 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/impl/ActivitiServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/impl/ActivitiServiceImpl.java @@ -18,6 +18,7 @@ import io.renren.modules.sys.service.SysUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.time.Duration; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -81,9 +82,28 @@ public class ActivitiServiceImpl extends BaseServiceImpl0){ + builder.append(duration.toDays()+"d "); + builder.append(duration.minus(Duration.ofDays(duration.toDays())).toHours()+"h"); + }else if(duration.toHours()>0){ + builder.append(duration.toHours()+"h "); + builder.append(duration.minus(Duration.ofHours(duration.toHours())).toMinutes()+"m"); + }else if(duration.toMinutes()>0){ + builder.append(duration.toMinutes()+"m "); + builder.append(duration.minus(Duration.ofMinutes(duration.toMinutes())).getSeconds()+"s"); + }else { + builder.append(second+"s"); + } + return builder.toString(); + } } diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java index 58e1f9b8..e73d3b5a 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java @@ -290,7 +290,7 @@ public class TAbilityApplicationController { detailDTO.setActivityType(""); detailDTO.setStartTime(task.getCreateTime()); detailDTO.setEndTime(null); - detailDTO.setDurationInSeconds(null); + detailDTO.setDuration(""); detailDTO.setExecutionId(task.getExecutionId()); detailDTO.setProcessDefinitionId(task.getProcessDefinitionId()); detailDTO.setComment("待审核"); diff --git a/renren-admin/src/main/resources/mapper/device/TbDeviceApplyDao.xml b/renren-admin/src/main/resources/mapper/device/TbDeviceApplyDao.xml index cf4f2ef8..bb378276 100644 --- a/renren-admin/src/main/resources/mapper/device/TbDeviceApplyDao.xml +++ b/renren-admin/src/main/resources/mapper/device/TbDeviceApplyDao.xml @@ -15,6 +15,7 @@ #{item} + order by create_date desc \ No newline at end of file