Commit 82003a8d by yao.xiao

修改-取消图片比例校验/海报排序

parent 585fa458
...@@ -954,20 +954,21 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -954,20 +954,21 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
BufferedImage img = ImageIO.read(inputStream); BufferedImage img = ImageIO.read(inputStream);
if (img == null || img.getWidth(null) <= 0 || img.getHeight(null) <= 0) { if (img == null || img.getWidth(null) <= 0 || img.getHeight(null) <= 0) {
return ZHBErrorConfig.getErrorInfo("830003"); return ZHBErrorConfig.getErrorInfo("830003");
}else {
double width = img.getWidth(null);
double height = img.getHeight(null);
double value =height/width;
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(img, "jpg", os);
inputStream = new ByteArrayInputStream(os.toByteArray());
if (value !=1&&(targetUseFor == 1 || targetUseFor == 9)){
//上传头像尺寸比例为1:1
return ZHBErrorConfig.getErrorInfo("830005");
}else if(value !=0.75 && targetUseFor == 2){
return ZHBErrorConfig.getErrorInfo("830004");
}
} }
// else {
// double width = img.getWidth(null);
// double height = img.getHeight(null);
// double value =height/width;
// ByteArrayOutputStream os = new ByteArrayOutputStream();
// ImageIO.write(img, "jpg", os);
// inputStream = new ByteArrayInputStream(os.toByteArray());
// if (value !=1&&(targetUseFor == 1 || targetUseFor == 9)){
// //上传头像尺寸比例为1:1
// return ZHBErrorConfig.getErrorInfo("830005");
// }else if(value !=0.75 && targetUseFor == 2){
// return ZHBErrorConfig.getErrorInfo("830004");
// }
// }
//上传图片至阿里云 //上传图片至阿里云
String prefix = "broker/"+practitionerId+"/"; String prefix = "broker/"+practitionerId+"/";
String originalFilename = generateKey(targetUseFor); String originalFilename = generateKey(targetUseFor);
......
...@@ -28,5 +28,6 @@ ...@@ -28,5 +28,6 @@
<if test="mdDropOptionId != null"> <if test="mdDropOptionId != null">
and t.md_drop_option_id = #{mdDropOptionId,jdbcType=BIGINT} and t.md_drop_option_id = #{mdDropOptionId,jdbcType=BIGINT}
</if> </if>
ORDER BY t.created_at DESC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -210,9 +210,9 @@ ...@@ -210,9 +210,9 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from yd_mkt_announcement from yd_mkt_announcement
WHERE WHERE
t.is_active = #{isActive} is_active = #{isActive}
and and
t.announcement_at &lt;= #{date} announcement_at &lt;= #{date}
order by t.seq asc , t.announcement_at desc order by seq asc , announcement_at desc
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment