|
|
@@ -26,7 +26,9 @@ import com.tuoheng.common.config.CommonConfig; |
|
|
|
import com.tuoheng.common.exception.ServiceException; |
|
|
|
import com.tuoheng.common.utils.*; |
|
|
|
import com.tuoheng.system.entity.User; |
|
|
|
import com.tuoheng.system.mapper.UserMapper; |
|
|
|
import com.tuoheng.system.utils.ShiroUtils; |
|
|
|
import io.swagger.models.auth.In; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@@ -58,6 +60,9 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi |
|
|
|
@Autowired |
|
|
|
private IDspService dspService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private UserMapper userMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Value("${tuoheng.dsp-callback-url:}") |
|
|
|
private String dspCallbackUrl; |
|
|
@@ -207,11 +212,14 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi |
|
|
|
queryInspection.eq(ThMission::getMark,MarkTypeEnum.VALID.getCode()).orderByDesc(ThMission::getCreateTime); |
|
|
|
|
|
|
|
IPage<ThMission> thMissionIPage = thMissionMapper.selectPage(page, queryInspection); |
|
|
|
List<ThMission> records = thMissionIPage.getRecords(); |
|
|
|
|
|
|
|
Map<Integer, String> userName = getUserNameMap(records); |
|
|
|
List<MissionVO> result=new ArrayList<>(); |
|
|
|
thMissionIPage.getRecords().forEach(mission->{ |
|
|
|
records.forEach(mission->{ |
|
|
|
MissionVO missionVO=new MissionVO(); |
|
|
|
BeanUtils.copyProperties(mission,missionVO); |
|
|
|
missionVO.setCreateUser(userName.get(mission.getCreateUser())); |
|
|
|
result.add(missionVO); |
|
|
|
}); |
|
|
|
|
|
|
@@ -224,6 +232,20 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi |
|
|
|
return resultPage; |
|
|
|
} |
|
|
|
|
|
|
|
private Map<Integer, String> getUserNameMap(List<ThMission> records) { |
|
|
|
Map<Integer,String> userName=new HashMap<>(); |
|
|
|
Set<Integer> userId=new HashSet<>(); |
|
|
|
records.forEach(thMission -> { |
|
|
|
userId.add(thMission.getCreateUser()); |
|
|
|
}); |
|
|
|
|
|
|
|
List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().in(User::getId, userId)); |
|
|
|
for (User user : users) { |
|
|
|
userName.put(user.getId(),user.getUsername()); |
|
|
|
} |
|
|
|
return userName; |
|
|
|
} |
|
|
|
|
|
|
|
private void queryParam(MissionQuery queryInspectionRequest, LambdaQueryWrapper<ThMission> queryInspection) { |
|
|
|
//编号 |
|
|
|
queryInspection.like(!StringUtils.isEmpty(queryInspectionRequest.getCode()),ThMission::getCode, queryInspectionRequest.getCode()); |