Commit 57116d00 by wukaiqiang

修改数据下载请求方式为表单

parent 046eed59
...@@ -9,9 +9,12 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -9,9 +9,12 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.beecode.inz.basis.team.pojo.ResponseObj; import com.beecode.inz.basis.team.pojo.ResponseObj;
import com.beecode.xlib.json.JSONException;
import com.beecode.xlib.json.JSONObject;
import com.xyst.dinas.statistics.service.DownLoadStatisticsService; import com.xyst.dinas.statistics.service.DownLoadStatisticsService;
import com.xyst.dinas.statistics.web.Info.ConditionsDetailsInfo; import com.xyst.dinas.statistics.web.Info.ConditionsDetailsInfo;
...@@ -20,10 +23,24 @@ public class DownLoadStatisticsController { ...@@ -20,10 +23,24 @@ public class DownLoadStatisticsController {
@Autowired @Autowired
DownLoadStatisticsService downLoadStatisticsService; DownLoadStatisticsService downLoadStatisticsService;
@PostMapping(value ="/DownLoadStatistics/downLoadStatisticsService", consumes = "application/json") @PostMapping(value = "/DownLoadStatistics/downLoadStatisticsService")
public void downLoadStatisticsService(HttpServletResponse response, HttpServletRequest request, public void downLoadStatisticsService(HttpServletResponse response, HttpServletRequest request) throws JSONException {
@RequestBody ConditionsDetailsInfo conditionsDetailsInfo) { String exportParamStr = request.getParameter("exportParamStr");
response.reset();
response.setCharacterEncoding("UTF-8");
response.setContentType("application/x-www-form-urlencoded");
JSONObject obj = new JSONObject(exportParamStr);
try { try {
ConditionsDetailsInfo conditionsDetailsInfo = new ConditionsDetailsInfo();
conditionsDetailsInfo.setStartDate(obj.getString("startDate"));
conditionsDetailsInfo.setEndDate(obj.getString("endDate"));
conditionsDetailsInfo.setPurchaseSandUnit(obj.getString("purchaseSandUnit"));
conditionsDetailsInfo.setProject(obj.getString("project"));
conditionsDetailsInfo.setFundType(obj.getString("fundType"));
conditionsDetailsInfo.setDealYear(obj.getString("dealYear"));
conditionsDetailsInfo.setRegionalCompany(obj.getString("regionalCompany"));
conditionsDetailsInfo.setFileType(obj.getString("fileType"));
conditionsDetailsInfo.setStationList(obj.getString("stationList"));
downLoadStatisticsService.downLoadStatisticsServiceTable(response, request, conditionsDetailsInfo); downLoadStatisticsService.downLoadStatisticsServiceTable(response, request, conditionsDetailsInfo);
} catch (RuntimeException e) { } catch (RuntimeException e) {
// TODO: handle exception // TODO: handle exception
......
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