Commit c9510909 by songyinghui

feat: 库存计算调整

parent a8c7e5ef
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();
}
}
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);
}
}
......@@ -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;
}
}
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