|
@@ -16,6 +16,7 @@ import com.diagbot.service.impl.VersionDetailServiceImpl;
|
|
|
import com.diagbot.service.impl.VersionInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
import com.diagbot.vo.VersionDetailIdVO;
|
|
@@ -116,45 +117,45 @@ public class VersionDetailFacade extends VersionDetailServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<VersionDetailDTO> getByIds(List<Long> ids) {
|
|
|
- QueryWrapper<VersionDetail> versionDetailQuery = new QueryWrapper<>();
|
|
|
-
|
|
|
- versionDetailQuery
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("STATUS", StatusEnum.Enable.getKey())
|
|
|
- .in("version_id", ids)
|
|
|
- .orderByAsc("order_no");
|
|
|
-
|
|
|
- List<VersionDetail> datas = list(versionDetailQuery);
|
|
|
List<VersionDetailDTO> dataNew = new ArrayList<VersionDetailDTO>();
|
|
|
- List<String> modifierid = new ArrayList<>();
|
|
|
- modifierid = datas.stream().map(ac -> ac.getModifier()).collect(Collectors.toList());
|
|
|
- Map<String, String> userNames = new HashMap<>();
|
|
|
- if (modifierid.size() > 0) {
|
|
|
- RespDTO<Map<String, String>> userNamesDTO = userServiceClient.getUserInfoByIds(modifierid);
|
|
|
- if (userNamesDTO == null || !CommonErrorCode.OK.getCode().equals(userNamesDTO.code)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
- "获取所有用户信息失败");
|
|
|
+ if (ListUtil.isNotEmpty(ids)){
|
|
|
+ QueryWrapper<VersionDetail> versionDetailQuery = new QueryWrapper<>();
|
|
|
+ versionDetailQuery
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("STATUS", StatusEnum.Enable.getKey())
|
|
|
+ .in("version_id", ids)
|
|
|
+ .orderByAsc("order_no");
|
|
|
+
|
|
|
+ List<VersionDetail> datas = list(versionDetailQuery);
|
|
|
+ List<String> modifierid = new ArrayList<>();
|
|
|
+ modifierid = datas.stream().map(ac -> ac.getModifier()).collect(Collectors.toList());
|
|
|
+ Map<String, String> userNames = new HashMap<>();
|
|
|
+ if (modifierid.size() > 0) {
|
|
|
+ RespDTO<Map<String, String>> userNamesDTO = userServiceClient.getUserInfoByIds(modifierid);
|
|
|
+ if (userNamesDTO == null || !CommonErrorCode.OK.getCode().equals(userNamesDTO.code)) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ "获取所有用户信息失败");
|
|
|
+ }
|
|
|
+ userNames = userNamesDTO.data;
|
|
|
}
|
|
|
- userNames = userNamesDTO.data;
|
|
|
- }
|
|
|
|
|
|
- // 过滤字段
|
|
|
- for (VersionDetail versionData : datas) {
|
|
|
- VersionDetailDTO versionDTO = new VersionDetailDTO();
|
|
|
- versionDTO.setId(versionData.getId());
|
|
|
- //versionDTO.setCreator(versionData.getCreator());
|
|
|
- versionDTO.setModifierid(userNames.get(versionData.getModifier()));
|
|
|
- versionDTO.setDescription(versionData.getDescription());
|
|
|
- versionDTO.setGmtCreate(versionData.getGmtCreate());
|
|
|
- versionDTO.setOrderNo(versionData.getOrderNo());
|
|
|
- versionDTO.setRemark(versionData.getRemark());
|
|
|
- versionDTO.setStatus(versionData.getStatus());
|
|
|
- versionDTO.setTitle(versionData.getTitle());
|
|
|
- versionDTO.setVersionId(versionData.getVersionId());
|
|
|
- dataNew.add(versionDTO);
|
|
|
+ // 过滤字段
|
|
|
+ for (VersionDetail versionData : datas) {
|
|
|
+ VersionDetailDTO versionDTO = new VersionDetailDTO();
|
|
|
+ versionDTO.setId(versionData.getId());
|
|
|
+ //versionDTO.setCreator(versionData.getCreator());
|
|
|
+ versionDTO.setModifierid(userNames.get(versionData.getModifier()));
|
|
|
+ versionDTO.setDescription(versionData.getDescription());
|
|
|
+ versionDTO.setGmtCreate(versionData.getGmtCreate());
|
|
|
+ versionDTO.setOrderNo(versionData.getOrderNo());
|
|
|
+ versionDTO.setRemark(versionData.getRemark());
|
|
|
+ versionDTO.setStatus(versionData.getStatus());
|
|
|
+ versionDTO.setTitle(versionData.getTitle());
|
|
|
+ versionDTO.setVersionId(versionData.getVersionId());
|
|
|
+ dataNew.add(versionDTO);
|
|
|
+ }
|
|
|
}
|
|
|
return dataNew;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|