Commit 182cb903 by qwmqiuwenmin

fix

parent ee85b7db
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -13,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -13,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page; 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.BasePageInfo;
import com.gic.haoban.base.api.common.PageResult2; import com.gic.haoban.base.api.common.PageResult2;
import com.gic.haoban.common.utils.EntityUtil; import com.gic.haoban.common.utils.EntityUtil;
...@@ -79,8 +82,22 @@ public class MaterialController extends WebBaseController{ ...@@ -79,8 +82,22 @@ public class MaterialController extends WebBaseController{
*/ */
@RequestMapping("/reupdalod-material") @RequestMapping("/reupdalod-material")
public HaobanResponse reUpdalodMetail(String materialId) { public HaobanResponse reUpdalodMetail(String materialId) {
String mediaId = materialApiService.reUpdalodMetail(materialId); if(StringUtils.isBlank(materialId)){
return resultResponse(HaoBanErrCode.ERR_1,mediaId); 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);
} }
......
...@@ -197,6 +197,8 @@ public enum HaoBanErrCode { ...@@ -197,6 +197,8 @@ public enum HaoBanErrCode {
ERR_10012(10012,"手机号格式不正确"), ERR_10012(10012,"手机号格式不正确"),
ERR_10013(10013,"code已经存在"), ERR_10013(10013,"code已经存在"),
ERR_10014(10014,"请输入手机号"), ERR_10014(10014,"请输入手机号"),
ERR_10015(10015,"素材不存在"),
ERR_999(999, "操作失败"), ERR_999(999, "操作失败"),
......
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