Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AutogeneralShanghai
yd-backend
Commits
82003a8d
Commit
82003a8d
authored
May 09, 2020
by
yao.xiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改-取消图片比例校验/海报排序
parent
585fa458
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
16 deletions
+20
-16
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
+14
-13
yd-api/src/main/resources/mapper/marketing/MarketMapper.xml
+2
-0
yd-api/src/main/resources/mapper/marketing/MktAnnouncementMapper.xml
+4
-3
No files found.
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
View file @
82003a8d
...
@@ -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
);
...
...
yd-api/src/main/resources/mapper/marketing/MarketMapper.xml
View file @
82003a8d
...
@@ -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
yd-api/src/main/resources/mapper/marketing/MktAnnouncementMapper.xml
View file @
82003a8d
...
@@ -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
<
= #{date}
announcement_at
<
= #{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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment