| | |
| | | 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; |
| | |
| | | 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"); |
| | | |
| | |
| | | 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(), |
| | |
| | | } 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")); |
| | | |