Commit 182cb903 by qwmqiuwenmin

fix

parent ee85b7db
package com.gic.haoban.manage.web.controller;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -13,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.DateUtil;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.PageResult2;
import com.gic.haoban.common.utils.EntityUtil;
......@@ -79,8 +82,22 @@ public class MaterialController extends WebBaseController{
*/
@RequestMapping("/reupdalod-material")
public HaobanResponse reUpdalodMetail(String materialId) {
String mediaId = materialApiService.reUpdalodMetail(materialId);
return resultResponse(HaoBanErrCode.ERR_1,mediaId);
if(StringUtils.isBlank(materialId)){
return resultResponse(HaoBanErrCode.ERR_10015);
}
MaterialDTO material = materialApiService.selectMaterialById(materialId);
if(material == null){
}
String medialId = "";
if(material.getMaterialType() == 2 || material.getMaterialType() == 4 || material.getMaterialType() == 5){
Date wxLastTime = material.getWxLastUploadTime();
medialId = material.getMediaId();
if(DateUtil.addDay(wxLastTime, 3).getTime() < System.currentTimeMillis()){
medialId = materialApiService.reUpdalodMetail(materialId);
}
}
return resultResponse(HaoBanErrCode.ERR_1,medialId);
}
......
......@@ -198,6 +198,8 @@ public enum HaoBanErrCode {
ERR_10013(10013,"code已经存在"),
ERR_10014(10014,"请输入手机号"),
ERR_10015(10015,"素材不存在"),
ERR_999(999, "操作失败"),
ERR_DEFINE(-888, "自定义错误"),
......
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