|
@@ -45,6 +45,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.BufferedReader;
|
|
@@ -64,55 +65,52 @@ import static com.github.zuihou.exception.code.ExceptionCode.SYSTEM_BUSY;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("externalApi")
|
|
|
-public class AndroidApi {
|
|
|
- @Autowired
|
|
|
+public class AndroidApi
|
|
|
+{
|
|
|
+ @Resource
|
|
|
private GoodsService goodsService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private OrderService orderService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private WxPayCfg wxPayCfg;
|
|
|
-
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SpeService speService;
|
|
|
|
|
|
@Value("${weixinconfig.accessTokenUrl}")
|
|
|
private String accessTokenUrl;
|
|
|
-
|
|
|
@Value("${weixinconfig.appid}")
|
|
|
private String appId;
|
|
|
-
|
|
|
@Value("${weixinconfig.appSecret}")
|
|
|
private String secret;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private RedisTemplate<String, Object> redisTemplate;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private EquBarrelService barrelService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MiniAppService miniAppService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ProductionTenantResourceService productionTenantResourceService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private WxPayService wxPayService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private FormulaService formulaService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MemberService memberService;
|
|
|
|
|
|
-
|
|
|
@ApiOperation("获取商品列表")
|
|
|
@GetMapping({"/goodsList"})
|
|
|
- public R<List<EquGoodsDto>> goodsList(@RequestParam(name = "equId", required = true) Long equId) {
|
|
|
+ public R<List<EquGoodsDto>> goodsList(@RequestParam(name = "equId") Long equId)
|
|
|
+ {
|
|
|
BaseContextHandler.setTenant("0000");
|
|
|
List<EquGoodsDto> equGoods = productionTenantResourceService.getEquGoods(equId);
|
|
|
equGoods.forEach((item) ->
|
|
|
- {
|
|
|
- QueryWrap<Spe> speQueryWrap = new QueryWrap<>();
|
|
|
- speQueryWrap.eq("goods_id", item.getGoodsId());
|
|
|
- List<Spe> list = speService.list(speQueryWrap);
|
|
|
- item.setSpeList(list);
|
|
|
- }
|
|
|
- );
|
|
|
+ {
|
|
|
+ QueryWrap<Spe> speQueryWrap = new QueryWrap<>();
|
|
|
+ speQueryWrap.eq("goods_id", item.getGoodsId());
|
|
|
+ List<Spe> list = speService.list(speQueryWrap);
|
|
|
+ item.setSpeList(list);
|
|
|
+ });
|
|
|
+
|
|
|
return R.success(equGoods);
|
|
|
}
|
|
|
|
|
@@ -128,7 +126,6 @@ public class AndroidApi {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@ApiOperation("下单接口")
|
|
|
@PostMapping({"/getQrCode"})
|
|
|
public R<Map<String, Object>> getQrCode(HttpServletResponse response, @RequestBody Map<String, Long> param) {
|
|
@@ -181,7 +178,6 @@ public class AndroidApi {
|
|
|
return R.success(resultMap);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@ApiOperation("订单状态查询接口")
|
|
|
@GetMapping({"/getOrder"})
|
|
|
public R<Map<String, Object>> getOrder(@RequestParam(name = "orderId", required = true) Long orderId) {
|
|
@@ -267,7 +263,6 @@ public class AndroidApi {
|
|
|
return R.success(resultMap);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//料筒查询接口
|
|
|
@ApiOperation("料筒查询接口")
|
|
|
@GetMapping({"/getBarrelList"})
|
|
@@ -283,7 +278,6 @@ public class AndroidApi {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 小程序登录接口
|
|
|
@ApiOperation("小程序登录接口")
|
|
|
@PostMapping({"/miniAppLogin"})
|
|
@@ -295,7 +289,6 @@ public class AndroidApi {
|
|
|
return memberR;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 广告视频接口
|
|
|
@ApiOperation("广告视频")
|
|
|
@GetMapping({"/advVideo"})
|
|
@@ -310,7 +303,6 @@ public class AndroidApi {
|
|
|
return R.success(resultMap);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 微信支付通知
|
|
|
* (通知频率为15s/15s/30s/3m/10m/20m/30m/30m/30m/60m/3h/3h/3h/6h/6h - 总计 24h4m)
|
|
@@ -414,7 +406,6 @@ public class AndroidApi {
|
|
|
return returnMap;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//修改订单状态接口
|
|
|
|
|
|
/**
|
|
@@ -467,7 +458,6 @@ public class AndroidApi {
|
|
|
return R.success(update);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 获取未绑定的设备列表
|
|
|
*
|
|
@@ -486,7 +476,6 @@ public class AndroidApi {
|
|
|
return R.success(list);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 绑定,解绑,设备
|
|
|
*
|
|
@@ -541,6 +530,4 @@ public class AndroidApi {
|
|
|
redisTemplate.expire("wangyuanbo" + 123456789, 4, TimeUnit.SECONDS);
|
|
|
return R.success(true, "成功");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-}
|
|
|
+}
|