LogisticsHandler.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package com.iamberry.wechat.handles.logistics;
  2. import com.iamberry.wechat.core.entity.ResultMsg;
  3. import com.iamberry.wechat.tools.NameUtils;
  4. import com.iamberry.wechat.tools.ResultInfo;
  5. import com.iamberry.wechat.utils.KuaiDi100;
  6. import net.sf.json.JSONObject;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RequestParam;
  10. import org.springframework.web.bind.annotation.ResponseBody;
  11. import javax.servlet.http.HttpServletResponse;
  12. /**
  13. * Created by Administrator on 2017/12/26.
  14. */
  15. @RequestMapping("/logistics")
  16. public class LogisticsHandler {
  17. @Autowired
  18. private KuaiDi100 kuaidi100;
  19. /**
  20. * 查询快递信息
  21. * @param com 快递公司代码
  22. * @param nu 快递单号
  23. * @return
  24. */
  25. @RequestMapping("/getExpressInfo")
  26. @ResponseBody
  27. public ResultMsg getExpressInfo(@RequestParam("com") String com, @RequestParam("nu") String nu, HttpServletResponse response){
  28. ResultMsg msg = new ResultMsg();
  29. JSONObject rst = null;
  30. if (com == null || com.equals("") || nu == null || nu.equals("")){
  31. msg.setResultCode(ResultInfo.ERRORCODE);
  32. msg.setMessage(NameUtils.getConfig("ERROR"));
  33. msg.setData(rst);
  34. msg.setStatus(false);
  35. return msg;
  36. }
  37. rst = kuaidi100.getExpressInfo(com,nu);
  38. msg.setResultCode(ResultInfo.SUCCESSCODE);
  39. msg.setMessage(NameUtils.getConfig("SUCCESSINFO"));
  40. msg.setData(rst);
  41. msg.setStatus(true);
  42. return msg;
  43. }
  44. /**
  45. * 手动向特定手机发送短信
  46. * @param response
  47. * @param iphone
  48. * @return
  49. */
  50. /*@RequestMapping("/informShipping")
  51. @ResponseBody
  52. public String informShipping(HttpServletResponse response,@RequestParam("iphone") String iphone){
  53. String msg = codeService.informShipping(iphone,INFORM_SHIPPING);
  54. return msg;
  55. }*/
  56. }