|
|
|
|
@ -12,6 +12,7 @@ import com.biutag.supervision.constants.enums.ProcessingStatusEnum;
|
|
|
|
|
import com.biutag.supervision.constants.enums.RoleCodeEnum; |
|
|
|
|
import com.biutag.supervision.pojo.entity.Negative; |
|
|
|
|
import com.biutag.supervision.pojo.entity.NegativeBlame; |
|
|
|
|
import com.biutag.supervision.pojo.entity.SupDepart; |
|
|
|
|
import com.biutag.supervision.pojo.model.UserAuth; |
|
|
|
|
import com.biutag.supervision.pojo.param.NegativeQueryParam; |
|
|
|
|
import com.biutag.supervision.pojo.vo.DepartTree; |
|
|
|
|
@ -23,6 +24,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
@ -238,6 +240,10 @@ public class NegativeQueryService {
|
|
|
|
|
// 最后更新时间
|
|
|
|
|
queryWrapper.orderByDesc(Negative::getUpdTime); |
|
|
|
|
Page<Negative> page = negativeService.page(Page.of(param.getCurrent(), param.getSize()), queryWrapper); |
|
|
|
|
Map<String, SupDepart> allDepartsMap = departService.list( |
|
|
|
|
new LambdaQueryWrapper<SupDepart>() |
|
|
|
|
.in(SupDepart::getLevel, List.of(DepartLevelEnum.SECOND.getValue(), DepartLevelEnum.THREE.getValue())) |
|
|
|
|
).stream().collect(Collectors.toMap(SupDepart::getId, d -> d, (a, b) -> a)); |
|
|
|
|
long l = System.currentTimeMillis(); |
|
|
|
|
List<NegativeQueryVo> list = page.getRecords().stream().map(item -> { |
|
|
|
|
NegativeQueryVo vo = new NegativeQueryVo(); |
|
|
|
|
@ -245,6 +251,7 @@ public class NegativeQueryService {
|
|
|
|
|
if (Objects.nonNull(item.getFirstDistributeTime()) && !ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())) { |
|
|
|
|
vo.setRemainingDuration(TimeUtil.getRemainingDuration(item.getFirstDistributeTime(), item.getMaxSignDuration(), item.getMaxHandleDuration(), item.getExtensionDays(), item.getFlowKey())); |
|
|
|
|
} |
|
|
|
|
vo.setIssuingDepartName(buildIssuingDepartName(item.getIssuingDepartId(), item.getIssuingDepartName(), allDepartsMap)); |
|
|
|
|
return vo; |
|
|
|
|
}).toList(); |
|
|
|
|
System.out.printf("耗时:%sms", System.currentTimeMillis() - l); |
|
|
|
|
@ -268,4 +275,28 @@ public class NegativeQueryService {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 构建下发单位名称 |
|
|
|
|
* 3级单位拼接上级2级单位名称,2级单位保持原名 |
|
|
|
|
* @param issuingDepartId 下发单位ID |
|
|
|
|
* @param originalName 原名称 |
|
|
|
|
* @param allDepartsMap 所有单位Map |
|
|
|
|
* @return 拼接后的名称 |
|
|
|
|
*/ |
|
|
|
|
private String buildIssuingDepartName(String issuingDepartId, String originalName, Map<String, SupDepart> allDepartsMap) { |
|
|
|
|
if (StrUtil.isBlank(issuingDepartId) || StrUtil.isBlank(originalName)) { |
|
|
|
|
return originalName; |
|
|
|
|
} |
|
|
|
|
SupDepart depart = allDepartsMap.get(issuingDepartId); |
|
|
|
|
if (depart == null || !DepartLevelEnum.THREE.getValue().equals(depart.getLevel())) { |
|
|
|
|
// 非3级单位,返回原名
|
|
|
|
|
return originalName; |
|
|
|
|
} |
|
|
|
|
SupDepart parent = allDepartsMap.get(depart.getPid()); |
|
|
|
|
if (parent != null) { |
|
|
|
|
return parent.getShortName() + "/" + originalName; |
|
|
|
|
} |
|
|
|
|
return originalName; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|