申请历史修改时长单位
This commit is contained in:
parent
0c1a606dd4
commit
6e22e9929f
|
@ -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("待审核");
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -33,7 +33,7 @@ public class HistoryDetailEntity {
|
|||
|
||||
private Date endTime;
|
||||
|
||||
private Long durationInSeconds;
|
||||
private String duration;
|
||||
|
||||
private String comment;
|
||||
|
||||
|
|
|
@ -22,4 +22,6 @@ public interface ActivitiService extends BaseService<ProcessActivityEntity> {
|
|||
Page<ProcessActivityDTO> getDeptProcessInstancePage(Map<String, Object> params);
|
||||
|
||||
List<HistoryDetailDTO> getTaskHandleDetailInfo(String processInstanceId);
|
||||
|
||||
String getDurationInSecond(Long second);
|
||||
}
|
||||
|
|
|
@ -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 BaseServiceImpl<ProcessActivityDao, Pro
|
|||
for (HistoryDetailEntity entity : listEntity) {
|
||||
if (entity.getEndTime() != null && entity.getStartTime() != null) {
|
||||
long diff = entity.getEndTime().getTime() - entity.getStartTime().getTime();
|
||||
entity.setDurationInSeconds(diff / 1000);
|
||||
entity.setDuration(getDurationInSecond(diff / 1000));
|
||||
}
|
||||
}
|
||||
return ConvertUtils.sourceToTarget(listEntity, HistoryDetailDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDurationInSecond(Long second) {
|
||||
StringBuilder builder=new StringBuilder();
|
||||
Duration duration=Duration.ofSeconds(second);
|
||||
if(duration.toDays()>0){
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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("待审核");
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
order by create_date desc
|
||||
</select>
|
||||
|
||||
<select id="queryList" resultType="io.renren.modules.device.dto.TbDeviceApplyDTO">
|
||||
|
@ -29,6 +30,7 @@
|
|||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
order by create_date desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue