| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.aspose.cad.internal.I.S; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | public Map<String,Object> defaultDateProduct(Integer pageNum, Integer pageSize, List<String> glassType,Map<String,Object> config) { |
| | | Integer offset = (pageNum-1)*pageSize; |
| | | String glassTypeId = null; |
| | | if(glassType.size()>1){ |
| | | glassTypeId = glassType.get(1); |
| | | if(glassType.size()==2){ |
| | | if(!Objects.equals(glassType.get(0), "")&&!Objects.equals(glassType.get(1), "")){ |
| | | glassTypeId = glassType.get(1); |
| | | } |
| | | }else if(glassType.size()==1){ |
| | | if(!Objects.equals(glassType.get(0), "")&& !Objects.equals(glassType.get(0), "undefined")){ |
| | | glassTypeId = glassType.get(0); |
| | | } |
| | | |
| | | } |
| | | JSONObject orderJson = new JSONObject(config); |
| | | Product product = JSONObject.parseObject(JSONObject.toJSONString(orderJson.get("filter")), Product.class); |
| | |
| | | Map<String,Object> getProductJson = updateProduct(productDetails,product); |
| | | Product getProduct = JSONObject.parseObject(JSONObject.toJSONString(getProductJson.get("title")), Product.class); |
| | | List<ProductDetail> getProductDetails = JSONArray.parseArray(JSONObject.toJSONString(getProductJson.get("detail")), ProductDetail.class); |
| | | if(getProduct.getId()!=null){ |
| | | map.put("data",productMapper.selectProductId(productName,getProduct.getProductAbbreviation(), getProduct.getId())); |
| | | }else{ |
| | | map.put("data",productMapper.selectProduct(productName,getProduct.getProductAbbreviation())); |
| | | String productNameVal = null; |
| | | |
| | | //判断使用哪种产品名称 |
| | | switch (productName){ |
| | | case "product_name": |
| | | productNameVal = getProduct.getProductName(); |
| | | break; |
| | | case "product_abbreviation": |
| | | productNameVal = getProduct.getProductAbbreviation(); |
| | | break; |
| | | } |
| | | |
| | | |
| | | if(!Objects.equals(productNameVal, "") && productNameVal!=null){ |
| | | if(getProduct.getId()!=null ){ |
| | | map.put("data",productMapper.selectProductId(productName,productNameVal, getProduct.getId())); |
| | | }else{ |
| | | map.put("data",productMapper.selectProduct(productName,productNameVal)); |
| | | } |
| | | } |
| | | |
| | | |
| | | return map; |
| | | |
| | | } |