Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
c9510909
Commit
c9510909
authored
Mar 16, 2023
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 库存计算调整
parent
a8c7e5ef
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
138 additions
and
31 deletions
+138
-31
DrawImageUtils.java
...va/com/gic/haoban/manage/service/util/DrawImageUtils.java
+56
-0
base_pic.png
...-manage3-service/src/main/resources/template/base_pic.png
+0
-0
NotityTest.java
haoban-manage3-service/src/test/java/NotityTest.java
+37
-2
ContentMaterialController.java
...age/web/controller/content/ContentMaterialController.java
+36
-28
MaterialIndexDataVO.java
...gic/haoban/manage/web/vo/content/MaterialIndexDataVO.java
+9
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/DrawImageUtils.java
0 → 100644
View file @
c9510909
package
com
.
gic
.
haoban
.
manage
.
service
.
util
;
import
javax.imageio.ImageIO
;
import
java.awt.*
;
import
java.awt.image.BufferedImage
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
/**
* @Author MUSI
* @Date 2023/3/15 9:48 PM
* @Description
* @Version
**/
public
class
DrawImageUtils
{
public
static
void
drawImage
()
throws
IOException
{
// ImageIcon imageIcon = new ImageIcon("");
//
// URL url = new URL("http://res.mail.qq.com/node/ww/wwopenmng/images/independent/doc/test_pic_msg1.png");
long
startTime
=
System
.
currentTimeMillis
();
InputStream
inputStream
=
DrawImageUtils
.
class
.
getClassLoader
().
getResourceAsStream
(
"template/base_pic.png"
);
if
(
inputStream
==
null
){
return
;
}
BufferedImage
image
=
ImageIO
.
read
(
inputStream
);;
System
.
out
.
println
(
"图片宽度:"
+
image
.
getWidth
()
+
" px"
);
System
.
out
.
println
(
"图片高度:"
+
image
.
getHeight
()
+
" px"
);
Graphics2D
pen
=
image
.
createGraphics
();
pen
.
setColor
(
Color
.
BLACK
);
//pen.setColor(new Color(179, 250, 233, 100));
//Font.PLAIN(正常),Font.BOLD(粗体),Font.ITALIC(斜体)
pen
.
setFont
(
new
Font
(
"微软雅黑"
,
Font
.
ITALIC
,
20
));
pen
.
drawString
(
"我是图片水印"
,
image
.
getWidth
()/
2
,
image
.
getHeight
()/
2
);
pen
.
dispose
();
File
file
=
new
File
(
"test2.png"
);
FileOutputStream
fos
=
new
FileOutputStream
(
file
);
ImageIO
.
write
(
image
,
"png"
,
fos
);
long
endTime
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
endTime
-
startTime
);
}
public
static
void
main
(
String
[]
args
)
throws
IOException
{
DrawImageUtils
.
drawImage
();
}
}
haoban-manage3-service/src/main/resources/template/base_pic.png
0 → 100644
View file @
c9510909
88.5 KB
haoban-manage3-service/src/test/java/NotityTest.java
View file @
c9510909
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.haoban.manage.api.dto.AlertMessageDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.dto.notify.qdto.NoticeMessageQDTO
;
import
com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO
;
import
com.gic.haoban.manage.api.enums.AlertTypeEnum
;
...
...
@@ -7,6 +8,12 @@ import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import
com.gic.haoban.manage.api.service.CheckQywxSettingApiService
;
import
com.gic.haoban.manage.api.service.QywxTagApiService
;
import
com.gic.haoban.manage.api.service.notify.NoticeMessageApiService
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.wechat.api.dto.qywx.QywxNewsArticleMessageDTO
;
import
com.gic.wechat.api.dto.qywx.QywxNewsSendMessageDTO
;
import
com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
com.google.common.collect.Lists
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
...
...
@@ -16,6 +23,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -30,7 +39,14 @@ public class NotityTest {
@Autowired
private
NoticeMessageApiService
noticeMessageApiService
;
@Autowired
private
QywxSuiteApiService
qywxSuiteApiService
;
@Autowired
private
Config
config
;
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
@Test
public
void
test
()
{
...
...
@@ -48,8 +64,7 @@ public class NotityTest {
noticeMessageQDTO
.
setOptTargetId
(
"testtatget"
);
noticeMessageQDTO
.
setExtendContent
(
extMap
);
String
str
=
"{\"clerkId\":\"28974631cc7a47398ec592d9f61ca210\",\"enterpriseId\":\"ff8080815dacd3a2015dacd3ef5c0000\",\"extendContent\":{\"taskName\":\"上传12-26日报\",\"storeId\":\"ff8080817a578567017a75b014d900be\",\"taskId\":\"01bafd19b050421ba72e4d130508a24f\"},\"messageType\":3031}"
;
String
str
=
"{\"clerkId\":\"fbc508e395f846ef9005852c420e1c4f\",\"enterpriseId\":\"ff8080815dacd3a2015dacd3ef5c0000\",\"contentMap\":{\"activityName\":\"活动名称测试\",\"rank\":\"1\"},\"messageType\":1007}"
;
noticeMessageApiService
.
noticeMessageMq
(
str
);
}
...
...
@@ -83,4 +98,24 @@ public class NotityTest {
noticeMessageApiService
.
batchSendMessage
(
batchQDTO
);
}
@Test
public
void
sendNewsMessageTest
(){
String
wxEnterpriseId
=
"ca66a01b79474c40b3e7c7f93daf1a3b"
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
String
corpid
=
qwDTO
.
getThirdCorpid
()
;
QywxNewsSendMessageDTO
messageDTO
=
new
QywxNewsSendMessageDTO
();
messageDTO
.
setAgentId
(
Integer
.
parseInt
(
qwDTO
.
getAgentId
()));
messageDTO
.
setUserIds
(
Collections
.
singletonList
(
"wo59NLDQAA2fEL1xL51lJIy9y2N2aulA"
));
QywxNewsArticleMessageDTO
articleInfo
=
new
QywxNewsArticleMessageDTO
();
articleInfo
.
setAppid
(
config
.
getAppid
());
articleInfo
.
setTitle
(
"测试图文标题"
);
articleInfo
.
setDescription
(
"这是一个图文描述"
);
articleInfo
.
setPagepath
(
"/monthList"
);
articleInfo
.
setPicurl
(
"https://platform-1251519181.cos.ap-shanghai.myqcloud.com/image/jhdm/enterprise_common-9292fc686bbf4da2a168d4428363e630.jpeg"
);
messageDTO
.
setArticleMessages
(
Collections
.
singletonList
(
articleInfo
));
boolean
b
=
qywxSuiteApiService
.
sendMessage
(
corpid
,
config
.
getWxSuiteid
(),
messageDTO
);
System
.
out
.
println
(
b
);
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/ContentMaterialController.java
View file @
c9510909
This diff is collapsed.
Click to expand it.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/vo/content/MaterialIndexDataVO.java
View file @
c9510909
...
...
@@ -28,7 +28,7 @@ public class MaterialIndexDataVO implements Serializable {
private
String
conversionAmount
;
/**
*
*
当天素材发布数量
*/
private
Integer
newMaterialNum
;
...
...
@@ -55,4 +55,12 @@ public class MaterialIndexDataVO implements Serializable {
public
void
setConversionAmount
(
String
conversionAmount
)
{
this
.
conversionAmount
=
conversionAmount
;
}
public
Integer
getNewMaterialNum
()
{
return
newMaterialNum
;
}
public
void
setNewMaterialNum
(
Integer
newMaterialNum
)
{
this
.
newMaterialNum
=
newMaterialNum
;
}
}
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