Commit 6a519c87 by qwmqiuwenmin

fix

parent 22164f6f
...@@ -28,6 +28,8 @@ public class MaterialDTO implements Serializable{ ...@@ -28,6 +28,8 @@ public class MaterialDTO implements Serializable{
private String staffName; private String staffName;
private String imgUrl; private String imgUrl;
private String wxImgUrl;
private String materialDesc; private String materialDesc;
...@@ -176,6 +178,14 @@ public class MaterialDTO implements Serializable{ ...@@ -176,6 +178,14 @@ public class MaterialDTO implements Serializable{
public void setMediaid(String mediaid) { public void setMediaid(String mediaid) {
this.mediaid = mediaid; this.mediaid = mediaid;
} }
public String getWxImgUrl() {
return wxImgUrl;
}
public void setWxImgUrl(String wxImgUrl) {
this.wxImgUrl = wxImgUrl;
}
......
...@@ -23,6 +23,8 @@ public class TabHaobanMaterial implements Serializable { ...@@ -23,6 +23,8 @@ public class TabHaobanMaterial implements Serializable {
private String staffId; private String staffId;
private String staffName; private String staffName;
private String wxImgUrl;
private String imgUrl; private String imgUrl;
...@@ -166,4 +168,14 @@ public class TabHaobanMaterial implements Serializable { ...@@ -166,4 +168,14 @@ public class TabHaobanMaterial implements Serializable {
public void setUpdateTime(Date updateTime) { public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime; this.updateTime = updateTime;
} }
public String getWxImgUrl() {
return wxImgUrl;
}
public void setWxImgUrl(String wxImgUrl) {
this.wxImgUrl = wxImgUrl;
}
} }
\ No newline at end of file
...@@ -120,6 +120,10 @@ public class MaterialApiServiceImpl implements MaterialApiService { ...@@ -120,6 +120,10 @@ public class MaterialApiServiceImpl implements MaterialApiService {
if(type == 5){ if(type == 5){
fileType = QywxMediaTypeEnum.FILE; fileType = QywxMediaTypeEnum.FILE;
url = materialDTO.getLink(); url = materialDTO.getLink();
String imgUrl = materialDTO.getImgUrl();
JSONResponse response = qywxSuiteApiService.uploadImage(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(imgUrl));
String wxImgUrl = response.getResult() == null ? "" : response.getResult().toString();
materialDTO.setWxImgUrl(wxImgUrl);
} }
if(fileType != null){ if(fileType != null){
String[] arr = url.split("/"); String[] arr = url.split("/");
...@@ -170,6 +174,13 @@ public class MaterialApiServiceImpl implements MaterialApiService { ...@@ -170,6 +174,13 @@ public class MaterialApiServiceImpl implements MaterialApiService {
fileType = QywxMediaTypeEnum.FILE; fileType = QywxMediaTypeEnum.FILE;
url = materialDTO.getLink(); url = materialDTO.getLink();
oldUrl = old.getLink(); oldUrl = old.getLink();
String imgUrl = materialDTO.getImgUrl();
String oldImgUrl = materialDTO.getImgUrl();
if(!imgUrl.equals(oldImgUrl)){
JSONResponse response = qywxSuiteApiService.uploadImage(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(imgUrl));
String wxImgUrl = response.getResult() == null ? "" : response.getResult().toString();
materialDTO.setWxImgUrl(wxImgUrl);
}
} }
if(fileType != null && !url.equals(oldUrl)){ if(fileType != null && !url.equals(oldUrl)){
String[] arr = url.split("/"); String[] arr = url.split("/");
......
...@@ -721,7 +721,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -721,7 +721,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
dto.setExternalUserid(extendUserList); dto.setExternalUserid(extendUserList);
dto.setSenderUserId(userId); dto.setSenderUserId(userId);
dto.setDesc(material.getMaterialDesc()); dto.setDesc(material.getMaterialDesc());
dto.setPicurl(material.getImgUrl()); dto.setPicurl(material.getWxImgUrl());
dto.setTitle(material.getMaterialTitle()); dto.setTitle(material.getMaterialTitle());
dto.setUrl(material.getLink()); dto.setUrl(material.getLink());
log.info("【发送消息】dto = {}",JSON.toJSONString(dto)); log.info("【发送消息】dto = {}",JSON.toJSONString(dto));
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<result column="staff_id" property="staffId" jdbcType="VARCHAR" /> <result column="staff_id" property="staffId" jdbcType="VARCHAR" />
<result column="staff_name" property="staffName" jdbcType="VARCHAR" /> <result column="staff_name" property="staffName" jdbcType="VARCHAR" />
<result column="img_url" property="imgUrl" jdbcType="VARCHAR" /> <result column="img_url" property="imgUrl" jdbcType="VARCHAR" />
<result column="wx_img_url" property="wxImgUrl" jdbcType="VARCHAR" />
<result column="material_desc" property="materialDesc" jdbcType="VARCHAR" /> <result column="material_desc" property="materialDesc" jdbcType="VARCHAR" />
<result column="status_flag" property="statusFlag" jdbcType="INTEGER" /> <result column="status_flag" property="statusFlag" jdbcType="INTEGER" />
<result column="link" property="link" jdbcType="VARCHAR" /> <result column="link" property="link" jdbcType="VARCHAR" />
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
material_id, material_title, material_type, category_id, material_content, wx_last_upload_time, material_id, material_title, material_type, category_id, material_content, wx_last_upload_time,
media_id, wx_enterprise_id, staff_id, staff_name, img_url, material_desc, status_flag, media_id, wx_enterprise_id, staff_id, staff_name, img_url, material_desc, status_flag,
link, create_time, update_time link, create_time, update_time,wx_img_url
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select select
...@@ -38,13 +39,13 @@ ...@@ -38,13 +39,13 @@
insert into tab_haoban_material (material_id, material_title, material_type, insert into tab_haoban_material (material_id, material_title, material_type,
category_id, material_content, wx_last_upload_time, category_id, material_content, wx_last_upload_time,
media_id, wx_enterprise_id, staff_id, media_id, wx_enterprise_id, staff_id,
staff_name, img_url, material_desc, staff_name, img_url,wx_img_url, material_desc,
status_flag, link, create_time, status_flag, link, create_time,
update_time) update_time)
values (#{materialId,jdbcType=VARCHAR}, #{materialTitle,jdbcType=VARCHAR}, #{materialType,jdbcType=INTEGER}, values (#{materialId,jdbcType=VARCHAR}, #{materialTitle,jdbcType=VARCHAR}, #{materialType,jdbcType=INTEGER},
#{categoryId,jdbcType=VARCHAR}, #{materialContent,jdbcType=VARCHAR}, #{wxLastUploadTime,jdbcType=TIMESTAMP}, #{categoryId,jdbcType=VARCHAR}, #{materialContent,jdbcType=VARCHAR}, #{wxLastUploadTime,jdbcType=TIMESTAMP},
#{mediaId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{staffId,jdbcType=VARCHAR}, #{mediaId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{staffId,jdbcType=VARCHAR},
#{staffName,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR}, #{materialDesc,jdbcType=VARCHAR}, #{staffName,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR},#{wxImgUrl,jdbcType=VARCHAR}, #{materialDesc,jdbcType=VARCHAR},
#{statusFlag,jdbcType=INTEGER}, #{link,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{statusFlag,jdbcType=INTEGER}, #{link,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}) #{updateTime,jdbcType=TIMESTAMP})
</insert> </insert>
...@@ -84,6 +85,9 @@ ...@@ -84,6 +85,9 @@
<if test="imgUrl != null" > <if test="imgUrl != null" >
img_url, img_url,
</if> </if>
<if test="wxImgUrl != null" >
wx_img_url,
</if>
<if test="materialDesc != null" > <if test="materialDesc != null" >
material_desc, material_desc,
</if> </if>
...@@ -134,6 +138,9 @@ ...@@ -134,6 +138,9 @@
<if test="imgUrl != null" > <if test="imgUrl != null" >
#{imgUrl,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR},
</if> </if>
<if test="wxImgUrl != null" >
#{wxImgUrl,jdbcType=VARCHAR},
</if>
<if test="materialDesc != null" > <if test="materialDesc != null" >
#{materialDesc,jdbcType=VARCHAR}, #{materialDesc,jdbcType=VARCHAR},
</if> </if>
...@@ -184,6 +191,9 @@ ...@@ -184,6 +191,9 @@
<if test="imgUrl != null" > <if test="imgUrl != null" >
img_url = #{imgUrl,jdbcType=VARCHAR}, img_url = #{imgUrl,jdbcType=VARCHAR},
</if> </if>
<if test="wxImgUrl != null" >
wx_img_url = #{wxImgUrl,jdbcType=VARCHAR},
</if>
<if test="materialDesc != null" > <if test="materialDesc != null" >
material_desc = #{materialDesc,jdbcType=VARCHAR}, material_desc = #{materialDesc,jdbcType=VARCHAR},
</if> </if>
...@@ -214,6 +224,7 @@ ...@@ -214,6 +224,7 @@
staff_id = #{staffId,jdbcType=VARCHAR}, staff_id = #{staffId,jdbcType=VARCHAR},
staff_name = #{staffName,jdbcType=VARCHAR}, staff_name = #{staffName,jdbcType=VARCHAR},
img_url = #{imgUrl,jdbcType=VARCHAR}, img_url = #{imgUrl,jdbcType=VARCHAR},
wx_img_url = #{wxImgUrl,jdbcType=VARCHAR},
material_desc = #{materialDesc,jdbcType=VARCHAR}, material_desc = #{materialDesc,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER}, status_flag = #{statusFlag,jdbcType=INTEGER},
link = #{link,jdbcType=VARCHAR}, link = #{link,jdbcType=VARCHAR},
......
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