BUGFIX:修改pantone返回的rgb值

This commit is contained in:
xupei
2023-10-18 11:46:50 +08:00
parent 89d3349b49
commit fe2ffcd6a6

View File

@@ -110,6 +110,14 @@ public class PanToneServiceImpl extends ServiceImpl<PanToneMapper, PanTone> impl
} }
}); });
// 覆盖pantone中的rgb值,使用前端传过来的rgb值
for (Map.Entry<String, PantoneVO> pantoneVOEntry : colorPantoneVO.entrySet()) {
int[] rgb = Arrays.stream(pantoneVOEntry.getKey().split("\\s+")).mapToInt(Integer::parseInt).toArray();
pantoneVOEntry.getValue().setR(rgb[0]);
pantoneVOEntry.getValue().setG(rgb[1]);
pantoneVOEntry.getValue().setB(rgb[2]);
}
return colorPantoneVO; return colorPantoneVO;
} }
@@ -164,9 +172,9 @@ public class PanToneServiceImpl extends ServiceImpl<PanToneMapper, PanTone> impl
return null; return null;
} }
PantoneVO pantoneVO = CopyUtil.copyObject(panTone,PantoneVO.class); PantoneVO pantoneVO = CopyUtil.copyObject(panTone,PantoneVO.class);
pantoneVO.setR(panTone.getR()); // pantoneVO.setR(panTone.getR());
pantoneVO.setG(panTone.getG()); // pantoneVO.setG(panTone.getG());
pantoneVO.setB(panTone.getB()); // pantoneVO.setB(panTone.getB());
pantoneVO.setId(panTone.getPantoneIndex()); pantoneVO.setId(panTone.getPantoneIndex());
return pantoneVO; return pantoneVO;
} }