|
|
|
@ -1,8 +1,10 @@ |
|
|
|
package com.biutag.supervision.controller.sensitiveperception; |
|
|
|
package com.biutag.supervision.controller.sensitiveperception; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.date.DateUnit; |
|
|
|
import cn.hutool.core.date.DateUnit; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
@ -77,10 +79,12 @@ public class ProfileDepartController { |
|
|
|
ProfileDepart profileDepart = new ProfileDepart(); |
|
|
|
ProfileDepart profileDepart = new ProfileDepart(); |
|
|
|
profileDepart.setDays(DateUtil.between(beginTime, endTime, DateUnit.DAY)); |
|
|
|
profileDepart.setDays(DateUtil.between(beginTime, endTime, DateUnit.DAY)); |
|
|
|
SupDepart depart = departService.getById(departId); |
|
|
|
SupDepart depart = departService.getById(departId); |
|
|
|
profileDepart.getDepartInfo() |
|
|
|
if(ObjectUtil.isNotEmpty(depart)){ |
|
|
|
.setName(depart.getShortName()) |
|
|
|
profileDepart.getDepartInfo() |
|
|
|
.setShortName(depart.getShortName()) |
|
|
|
.setName(depart.getShortName()) |
|
|
|
.setDepartImg(depart.getImg()); |
|
|
|
.setShortName(depart.getShortName()) |
|
|
|
|
|
|
|
.setDepartImg(depart.getImg()); |
|
|
|
|
|
|
|
} |
|
|
|
List<SupPolice> polices = policeService.listAllByDepartId(departId); |
|
|
|
List<SupPolice> polices = policeService.listAllByDepartId(departId); |
|
|
|
profileDepart.getDepartInfo().setMainRole(polices.stream().filter(item -> "正职".equals(item.getPosition())).findFirst().map(SupPolice::getName).orElse(null)); |
|
|
|
profileDepart.getDepartInfo().setMainRole(polices.stream().filter(item -> "正职".equals(item.getPosition())).findFirst().map(SupPolice::getName).orElse(null)); |
|
|
|
profileDepart.getDepartInfo().setDeputyRole(polices.stream().filter(item -> "副职".equals(item.getPosition())).map(SupPolice::getName).toList()); |
|
|
|
profileDepart.getDepartInfo().setDeputyRole(polices.stream().filter(item -> "副职".equals(item.getPosition())).map(SupPolice::getName).toList()); |
|
|
|
@ -91,9 +95,11 @@ public class ProfileDepartController { |
|
|
|
|
|
|
|
|
|
|
|
List<String> negativeIds = list.stream().map(NegativeScoreDepart::getNegativeId).toList(); |
|
|
|
List<String> negativeIds = list.stream().map(NegativeScoreDepart::getNegativeId).toList(); |
|
|
|
SupDepartPoliceSize policeSize = departPoliceSizeService.getById(departId); |
|
|
|
SupDepartPoliceSize policeSize = departPoliceSizeService.getById(departId); |
|
|
|
profileDepart.getDepartInfo().setPoliceSize(policeSize.getPoliceSize()); |
|
|
|
if(ObjectUtil.isNotEmpty(policeSize)){ |
|
|
|
profileDepart.getDepartInfo().setAuxSize(policeSize.getAuxSize()); |
|
|
|
profileDepart.getDepartInfo().setPoliceSize(policeSize.getPoliceSize() == null?policeSize.getPoliceSize():0L); |
|
|
|
|
|
|
|
profileDepart.getDepartInfo().setAuxSize(policeSize.getAuxSize() == null?policeSize.getAuxSize():0L); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
if (negativeIds.isEmpty()) { |
|
|
|
if (negativeIds.isEmpty()) { |
|
|
|
return Result.success(profileDepart); |
|
|
|
return Result.success(profileDepart); |
|
|
|
} |
|
|
|
} |
|
|
|
|