Commit fc291823 by 墨竹

feat:删除无效代码

parent ffee5f9d
......@@ -53,13 +53,6 @@ public class MaterialServiceImpl implements MaterialService {
public void edit(MaterialDTO materialDTO) {
materialDTO.setUpdateTime(new Date());
mapper.updateByPrimaryKeySelective(EntityUtil.changeEntityByJSON(TabHaobanMaterial.class, materialDTO));
//
// List<TabHaobanMaterial> materials = mapper.listByfromMaterialId(materialDTO.getMaterialId());
// if (CollectionUtils.isEmpty(materials)) {
//
// return;
// }
}
@Override
......
......@@ -247,6 +247,10 @@ public class MaterialApiServiceImpl implements MaterialApiService {
fileType = QywxMediaTypeEnum.IMAGE;
url = old.getImgUrl();
}
if (fileType == null) {
logger.error("materialId无类型,materialId:{}", materialId);
return "";
}
String[] arr = url.split("/");
int count = arr.length;
JSONResponse jp = qywxSuiteApiService.uploadMedia(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(url), arr[count - 1], fileType.getCode());
......@@ -298,12 +302,6 @@ public class MaterialApiServiceImpl implements MaterialApiService {
return PageUtil.changePageHelperToCurrentPage(page, MaterialDTO.class);
}
public static void main(String[] args) {
String str = "https://other-1251519181.cos.ap-shanghai.myqcloud.com/haoban/20200518101933/【④好办-数据】(1)(1).xlsx";
int count = str.split("/").length;
System.err.println(str.split("/")[count - 1]);
}
private static byte[] getFileByte(String url) {
try {
......@@ -441,5 +439,4 @@ public class MaterialApiServiceImpl implements MaterialApiService {
}
return null;
}
}
......@@ -1229,7 +1229,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
if (materialType == 2) {
QywxImageMaterialDTO imageMaterialDTO = new QywxImageMaterialDTO();
imageMaterialDTO.setMediaId(maerialId);
dto.setMsgType("image");
dto.setMsgType(QywxMediaTypeEnum.IMAGE.getName());
dto.setImage(imageMaterialDTO);
} else if (materialType == 3) {
QywxLinkMaterialDTO linkMaterialDTO = new QywxLinkMaterialDTO();
......@@ -1237,12 +1237,12 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
linkMaterialDTO.setPicUrl(material.getWxImgUrl());
linkMaterialDTO.setDesc(material.getMaterialDesc());
linkMaterialDTO.setUrl(material.getLink());
dto.setMsgType("link");
dto.setMsgType(QywxMediaTypeEnum.LINK.getName());
dto.setLink(linkMaterialDTO);
} else if (materialType == 4) {
QywxVideoMaterialDTO videoMaterialDTO = new QywxVideoMaterialDTO();
videoMaterialDTO.setMediaId(maerialId);
dto.setMsgType("video");
dto.setMsgType(QywxMediaTypeEnum.VIDEO.getName());
dto.setVideo(videoMaterialDTO);
} else if (materialType == 6) {
QywxMiniprogramMaterialDTO miniprogramMaterialDTO = new QywxMiniprogramMaterialDTO();
......@@ -1250,7 +1250,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
miniprogramMaterialDTO.setPicMediaId(maerialId);
miniprogramMaterialDTO.setAppid(material.getAppId());
miniprogramMaterialDTO.setPage(material.getLink());
dto.setMsgType("miniprogram");
dto.setMsgType(QywxMediaTypeEnum.MINIPROGRAM.getName());
dto.setMiniprogram(miniprogramMaterialDTO);
}
return dto;
......
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