| | |
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.IPUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
|
| | | import com.yeshi.fanli.exception.ExtractException;
|
| | | import com.yeshi.fanli.exception.NotExistObjectException;
|
| | | import com.yeshi.fanli.exception.ObjectStateException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.IPUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/extract")
|
| | |
| | | */
|
| | | @RequestMapping(value = "checkExtract", method = RequestMethod.POST)
|
| | | public void checkExtract(String uid, PrintWriter out) {
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
|
| | | // 已到账的红包
|
| | | int count = hongBaoService.getCount(HongBao.STATE_YILINGQU);
|
| | | if (count == 0) {
|
| | | data.put("code", "1");
|
| | | out.print(data);
|
| | | return;
|
| | | }
|
| | |
|
| | | List<Integer> checked = extractService.checkExtract(uid);
|
| | | if (checked != null && checked.size() > 0) {
|
| | | Integer diversity = checked.get(0);
|
| | | if (diversity == 0) {
|
| | | data.put("code", "0");
|
| | | } else {
|
| | | data.put("code", "1");
|
| | | }
|
| | | } else {
|
| | | data.put("code", "1");
|
| | | try {
|
| | | extractService.checkExtract(uid);
|
| | | data.put("code", "1"); // 正常
|
| | | } catch (ExtractException e) {
|
| | | data.put("code", "0");// 异常
|
| | | }
|
| | | out.print(data);
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | List<Integer> listChecked = extractService.checkExtract(uid);
|
| | |
|
| | | if (listChecked == null || listChecked.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("资金异常"));
|
| | | return;
|
| | | }
|
| | |
|
| | | Integer diversity = listChecked.get(0);
|
| | | if (diversity == 0) {
|
| | | try {
|
| | | extractService.checkExtract(uid);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("资金正常"));
|
| | | } else {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("资金异常"));
|
| | | } catch (ExtractException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | }
|
| | | }
|
| | |
|