Commit eb593ce4 by fudahua

Merge branch 'master' into developer

# Conflicts:
#	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
parents a87a0542 8c375a49
package com.gic.haoban.manage.api.service; package com.gic.haoban.manage.api.service;
import java.util.Date;
import java.util.List; import java.util.List;
import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO; import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO;
...@@ -19,4 +20,10 @@ public interface WxEnterpriseRelatedApiService { ...@@ -19,4 +20,10 @@ public interface WxEnterpriseRelatedApiService {
List<EnterpriseDetailDTO> listEnterpriseByEnterpriseIds(List<String> enterpriseIds); List<EnterpriseDetailDTO> listEnterpriseByEnterpriseIds(List<String> enterpriseIds);
/**
* 返回在一定时期内的信息
* @return
*/
List<EnterpriseDetailDTO> queryBindGicEnterpriseByTime(String seqTime);
} }
package com.gic.haoban.manage.service.dao.mapper; package com.gic.haoban.manage.service.dao.mapper;
import java.util.Date;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -27,4 +28,5 @@ public interface WxEnterpriseRelatedMapper { ...@@ -27,4 +28,5 @@ public interface WxEnterpriseRelatedMapper {
List<TabHaobanWxEnterpriseRelated> listEnterpriseByEnterpriseIds(@Param("enterpriseIds")List<String> enterpriseIds); List<TabHaobanWxEnterpriseRelated> listEnterpriseByEnterpriseIds(@Param("enterpriseIds")List<String> enterpriseIds);
List<TabHaobanWxEnterpriseRelated> listEnterpriseByTime(@Param("time")String time);
} }
\ No newline at end of file
...@@ -151,4 +151,10 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi ...@@ -151,4 +151,10 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
return details; return details;
} }
@Override
public List<EnterpriseDetailDTO> queryBindGicEnterpriseByTime(String seqTime) {
List<TabHaobanWxEnterpriseRelated> list= wxEnterpriseRelatedMapper.listEnterpriseByTime(seqTime);
List<EnterpriseDetailDTO> details = EntityUtil.changeEntityListByJSON(EnterpriseDetailDTO.class, list);
return details;
}
} }
...@@ -148,5 +148,13 @@ ...@@ -148,5 +148,13 @@
</foreach> </foreach>
</if> </if>
</select> </select>
<select id="listEnterpriseByTime" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from tab_haoban_wx_enterprise_related
where status_flag = 1
update_time > #{time}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -7,8 +7,10 @@ import com.gic.haoban.manage.api.service.StaffApiService; ...@@ -7,8 +7,10 @@ import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService; import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.redis.data.util.RedisUtil; import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.dto.qywx.DepartmentDTO; import com.gic.wechat.api.dto.qywx.DepartmentDTO;
import com.gic.wechat.api.dto.qywx.QywxTextExternalMessageDTO;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO; import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
import com.gic.wechat.api.dto.qywx.UserDTO; import com.gic.wechat.api.dto.qywx.UserDTO;
import com.gic.wechat.api.enums.QywxMediaTypeEnum;
import com.gic.wechat.api.service.qywx.QywxDepartmentApiService; import com.gic.wechat.api.service.qywx.QywxDepartmentApiService;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService; import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
...@@ -18,6 +20,11 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -18,6 +20,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
...@@ -179,4 +186,71 @@ public void sendMessage() { ...@@ -179,4 +186,71 @@ public void sendMessage() {
System.out.println(JSONObject.toJSONString(selfWorkWxUser)); System.out.println(JSONObject.toJSONString(selfWorkWxUser));
} }
@Test
public void extensionList2() {
String img="https://pic01-10001430.image.myqcloud.com/53205d69-01f1-4706-a258-014d59d8d106";
byte[] aByte = getByte(img);
JSONResponse response = qywxSuiteApiService.uploadMedia("ww9ede832a84b7ae5f", "ww2c34dc56739bb105", aByte, QywxMediaTypeEnum.IMAGE.getCode());
System.out.println(JSONObject.toJSONString(response));
}
@Test
public void extensionList3() {
// msg59NLDQAAKvRi-fguFcKRVOjeoJKRJw
// String img="https://pic01-10001430.image.myqcloud.com/53205d69-01f1-4706-a258-014d59d8d106";
// byte[] aByte = getByte(img);
// JSONResponse response = qywxSuiteApiService.uploadMedia("ww9ede832a84b7ae5f", "ww2c34dc56739bb105", aByte, QywxMediaTypeEnum.IMAGE.getCode());
// System.out.println(JSONObject.toJSONString(response));
QywxTextExternalMessageDTO messageDTO=new QywxTextExternalMessageDTO();
messageDTO.setText("test");
messageDTO.setSenderUserId("9ae4c4f1277340a186b16a17d937c72c");
List<String> list=new ArrayList<>();
list.add("wm59NLDQAAL0fHb-QEbx-U9pdtRFA1bg");
messageDTO.setExternalUserid(list);
JSONResponse response1 = qywxSuiteApiService.sendExternalMessage("ww9ede832a84b7ae5f", "ww2c34dc56739bb105", messageDTO);
System.out.println(JSONObject.toJSONString(response1));
}
@Test
public void extensionList4() {
// msg59NLDQAAKvRi-fguFcKRVOjeoJKRJw
// String img="https://pic01-10001430.image.myqcloud.com/53205d69-01f1-4706-a258-014d59d8d106";
// byte[] aByte = getByte(img);
// JSONResponse response = qywxSuiteApiService.uploadMedia("ww9ede832a84b7ae5f", "ww2c34dc56739bb105", aByte, QywxMediaTypeEnum.IMAGE.getCode());
// System.out.println(JSONObject.toJSONString(response));
JSONResponse response1 = qywxSuiteApiService.resultExternalMessage("ww9ede832a84b7ae5f", "ww2c34dc56739bb105", "msg59NLDQAAKvRi-fguFcKRVOjeoJKRJw");
System.out.println(JSONObject.toJSONString(response1));
}
private byte[] getByte(String strUrl){
ByteArrayOutputStream baos = null;
try
{
URL u = new URL(strUrl);
BufferedImage image = ImageIO.read(u);
//convert BufferedImage to byte array
baos = new ByteArrayOutputStream();
ImageIO.write( image, "jpg", baos);
baos.flush();
return baos.toByteArray();
}
catch (Exception e)
{
}
finally
{
if(baos != null)
{
try {
baos.close();
} catch (IOException e) {
}
return baos.toByteArray();
}
return null;
}
}
} }
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