| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package com.diymall.schedule.controller;
- import com.diymall.schedule.model.DiymallOrder;
- import com.diymall.schedule.service.LoanDownService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.RestController;
- import java.io.UnsupportedEncodingException;
- import java.net.URLDecoder;
- import java.util.List;
- /**
- * erp下载定制商城订单数据接口
- * Created by huangct on 2017-12-25.
- */
- @RequestMapping(value = "/erp/loan")
- @RestController
- public class LoanDownController {
- @Autowired
- private LoanDownService loanDownService;
- /**
- * 获取未下载的数据
- *
- * @return
- */
- @RequestMapping(method = RequestMethod.GET)
- public List<DiymallOrder> getLoan() {
- return loanDownService.findByStatus(0);
- }
- /**
- * 下载完成后返回ids更新下载状态
- *
- * @param data
- */
- @RequestMapping(value = "/back", method = RequestMethod.POST)
- public void updateAfterCheck(@RequestParam("data") String data) throws UnsupportedEncodingException {
- String idStr = URLDecoder.decode(data, "UTF-8");
- loanDownService.updateStatus(idStr);
- }
- }
|