wuxw
2019-10-30 c14492af9efe929e40eb9d32d6648eddca32b703
WebService/src/main/java/com/java110/web/smo/file/impl/GetFileSMOImpl.java
@@ -9,8 +9,7 @@
import com.java110.utils.util.Assert;
import com.java110.utils.util.Base64Convert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.web.core.AbstractComponentSMO;
import com.java110.web.core.BaseComponentSMO;
import com.java110.core.component.BaseComponentSMO;
import com.java110.web.smo.file.IGetFileSMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
@@ -37,8 +36,6 @@
    public ResponseEntity<Object> getFile(IPageData pd) throws SMOException,IOException {
        JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
        super.validatePageInfo(pd);
        Assert.hasKeyAndValue(paramIn, "communityId", "请求报文中未包含小区ID");
        Assert.hasKeyAndValue(paramIn, "fileId", "请求报文中未包含文件ID");
@@ -49,7 +46,7 @@
        Map paramMap = BeanConvertUtil.beanCovertMap(result);
        paramIn.putAll(paramMap);
        String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/file.getFile";
        String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/file.getFile"+mapToUrlParam(paramIn);
        ResponseEntity<String> responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(),
@@ -68,7 +65,8 @@
        } else {
            headers.add("content-type", "application/octet-stream");
        }
        headers.add("Content-Disposition", "attachment; filename=" + outParam.getString("fileName"));
        //headers.add("Content-Disposition", "attachment; filename=" + outParam.getString("fileName"));
        headers.add("Accept-Ranges", "bytes");
        byte[] context = Base64Convert.base64ToByte(outParam.getString("context"));