|
@@ -71,6 +71,57 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
private PayOrderMapper payOrderMapper;
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 验证是否有购买资格
|
|
|
+ *
|
|
|
+ * @param submitDto
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseJson<Map<String, Object>> verify(SubmitDto submitDto) {
|
|
|
+
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ boolean bol = false;
|
|
|
+ // 机构一级分类
|
|
|
+ String firstClubType = baseMapper.firstClubTypeById(submitDto.getClubId());
|
|
|
+ if (!StringUtils.isNotBlank(firstClubType)) {
|
|
|
+ firstClubType = "0";
|
|
|
+ }
|
|
|
+ log.info("firstClubType======>"+firstClubType);
|
|
|
+ try {
|
|
|
+ ArrayList<Integer> list = new ArrayList<>();
|
|
|
+ JSONArray orderInfo = parseArray(submitDto.getOrderInfo());
|
|
|
+ /*Object productInfo = orderInfo.get("productInfo");
|
|
|
+ JSONArray jsonArray = parseArray(productInfo.toString());*/
|
|
|
+ for (Object infoObject : orderInfo) {
|
|
|
+ JSONObject productTemp = (JSONObject) infoObject;
|
|
|
+ JSONArray productArr = (JSONArray) productTemp.get("productInfo");
|
|
|
+ for (Object productObject : productArr) {
|
|
|
+ JSONObject product = (JSONObject) productObject;
|
|
|
+ list.add((Integer) product.get("skuId"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ log.info("list==========>"+list);
|
|
|
+ // 获取订单商品械字号类型
|
|
|
+ List<String> machineType = baseMapper.machineTypeByID(list);
|
|
|
+ log.info("machineType=====>"+machineType);
|
|
|
+ for (String str : machineType) {
|
|
|
+ if ("3".equals(str)) {
|
|
|
+ bol = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!"1".equals(firstClubType) && bol) {
|
|
|
+ map.put("code", -1);
|
|
|
+ } else {
|
|
|
+ map.put("code", 1);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return ResponseJson.error("商品验证失败",null);
|
|
|
+ }
|
|
|
+ return ResponseJson.success("验证成功", map);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 生成订单
|
|
|
*
|