Merge branch 'dev'

This commit is contained in:
wangliwen 2022-10-12 16:20:42 +08:00
commit 997edea1cd
14 changed files with 72 additions and 46 deletions

View File

@ -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("待审核");

View File

@ -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;

View File

@ -33,7 +33,7 @@ public class HistoryDetailEntity {
private Date endTime;
private Long durationInSeconds;
private String duration;
private String comment;

View File

@ -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);
}

View File

@ -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();
}
}

View File

@ -111,12 +111,12 @@ public class BookMeetingRoomController {
sysNoticeDTO.setApplyState(0);
// 根据roleId查询userId
List<Long> useIds = sysRoleUserService.getUserIdListByRoleId(Long.parseLong(defaultAssigneeRoleId));
if (useIds != null && useIds.size() > 0){
if (useIds != null && useIds.size() > 0) {
String userId = "";
for (Long use : useIds){
userId += use.toString()+",";
for (Long use : useIds) {
userId += use.toString() + ",";
}
sysNoticeDTO.setReceiverTypeIds(userId.substring(0,userId.length() -1));
sysNoticeDTO.setReceiverTypeIds(userId.substring(0, userId.length() - 1));
}
sysNoticeDTO.setStatus(NoticeStatusEnum.SEND.value());
sysNoticeDTO.setSenderName("流程系统");
@ -127,7 +127,7 @@ public class BookMeetingRoomController {
sysNoticeService.save(sysNoticeDTO);
// 还要发送自己能看到的的谁给我审核的消息
String ownedContent = "【通知】您发起的" + dto.getRoomName() +
"会议室申请,当前审核部门为:" + bigDateDeptName + ",审核负责人:会议室管理员" ;
"会议室申请,当前审核部门为:" + bigDateDeptName + ",审核负责人:会议室管理员";
SysNoticeDTO ownedSysNoticeDTO = new SysNoticeDTO();
ownedSysNoticeDTO.setType(10);
ownedSysNoticeDTO.setApplyState(0);

View File

@ -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("待审核");

View File

@ -45,8 +45,8 @@ public interface ResourceCarDao extends BaseDao<ResourceCarEntity> {
@Param("name") String name);
List<Map> selectInfrastructureListByDeptName(@Param("name") String name,
@Param("userId") Long userId,
@Param("deptName") String deptName,
@Param("pageNum") Integer pageNum,
@Param("pageSize") Integer pageSize);
@Param("userId") Long userId,
@Param("deptName") String deptName,
@Param("pageNum") Integer pageNum,
@Param("pageSize") Integer pageSize);
}

View File

@ -119,7 +119,7 @@ public class ResourceCarServiceImpl extends CrudServiceImpl<ResourceCarDao, Reso
case TSINGTAO_XHA: {
List<Map> maps = resourceCarDao.selectInfrastructureCarGroupByDept(userId, (pageNum - 1) * pageSize, pageSize, name);
resultMap.put("list", maps);
resultMap.put("deptCount", maps.stream().collect(Collectors.groupingBy(it->it.get("deptName"))).size());
resultMap.put("deptCount", maps.stream().collect(Collectors.groupingBy(it -> it.get("deptName"))).size());
}
break;
}

View File

@ -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>

View File

@ -120,21 +120,21 @@
AND su.dept_id IS NOT NULL
GROUP BY tda.attr_value
UNION
SELECT
COUNT( taa.apply_flag ) AS 'count',
'jcss' AS 'type'
FROM
t_ability_application taa,
sys_dept sd,
sys_user su
WHERE
1 = 1
AND taa.user_id = su.id
AND su.dept_id = sd.id
AND taa.camera_list != ''
AND taa.camera_list IS NOT NULL
GROUP BY
sd.id
SELECT
COUNT( taa.apply_flag ) AS 'count',
'jcss' AS 'type'
FROM
t_ability_application taa,
sys_dept sd,
sys_user su
WHERE
1 = 1
AND taa.user_id = su.id
AND su.dept_id = sd.id
AND taa.camera_list != ''
AND taa.camera_list IS NOT NULL
GROUP BY
sd.id
) temp2
</select>

View File

@ -1016,22 +1016,22 @@
UNION
SELECT
COUNT( taa.apply_flag ) AS 'count',
COUNT( taa.apply_flag ) AS 'count',
sd.NAME AS "deptName",
'jcss' AS 'type'
sd.NAME AS "deptName",
'jcss' AS 'type'
FROM
t_ability_application taa,
sys_dept sd,
sys_user su
t_ability_application taa,
sys_dept sd,
sys_user su
WHERE
1 = 1
AND taa.user_id = su.id
AND su.dept_id = sd.id
AND taa.camera_list != ''
AND taa.camera_list IS NOT NULL
1 = 1
AND taa.user_id = su.id
AND su.dept_id = sd.id
AND taa.camera_list != ''
AND taa.camera_list IS NOT NULL
GROUP BY
sd.id
sd.id
</select>
<!--
<select id="selectMaxType" resultType="java.lang.String">

View File

@ -88,7 +88,8 @@
car.dept_name AS "deptName",
COUNT(car.id) AS "count"
FROM
(select del_flag, user_id, json_extract(note1, '$[0].idtCameraChannel') as id, TRIM(BOTH '"' FROM json_extract(note1, '$[0].managementUnitName')) as dept_name, json_extract(note1, '$[0].channelName') as name
(select del_flag, user_id, json_extract(note1, '$[0].idtCameraChannel') as id, TRIM(BOTH '"' FROM
json_extract(note1, '$[0].managementUnitName')) as dept_name, json_extract(note1, '$[0].channelName') as name
from tb_resource_car where note1 IS NOT NULL) car
left join sys_dept dept on car.dept_name=dept.name
WHERE car.user_id = #{userId}
@ -163,7 +164,8 @@
car.del_flag AS delFlag,
car.idtCameraChannel
FROM
(select del_flag, id, user_id, note1, create_date, resource_id, json_extract(note1, '$[0].idtCameraChannel') as idtCameraChannel,
(select del_flag, id, user_id, note1, create_date, resource_id, json_extract(note1, '$[0].idtCameraChannel') as
idtCameraChannel,
TRIM(BOTH '"' FROM json_extract(note1, '$[0].managementUnitName')) as dept_name, json_extract(note1,
'$[0].channelName') as name
from tb_resource_car where note1 IS NOT NULL) car

View File

@ -22,7 +22,7 @@
</select>
<select id="getUserIdsByRoleId" resultType="java.lang.Long">
select user_id from sys_role_user where role_id = #{roleId}
select user_id from sys_role_user where role_id = #{roleId}
</select>
</mapper>