| @@ -8,9 +8,7 @@ import com.iformall.douyin.web.bean.GoodsTemplateGet; | |||
| import com.iformall.enums.EnumCouponValidType; | |||
| import com.iformall.mapper.TtGoodsCategoryMapper; | |||
| import com.iformall.service.TtGoodsCategoryService; | |||
| import com.iformall.utils.DataUtil; | |||
| import com.iformall.utils.DateUtils; | |||
| import me.chanjar.weixin.common.util.DataUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| @@ -65,7 +63,7 @@ public class TtGoodsCategoryServiceImpl implements TtGoodsCategoryService { | |||
| // keyList.add("detail_image_list");//长图 非必填 | |||
| // keyList.add("dishes_image_list");//菜品图 非必填 | |||
| keyList.add("EntryType");//入口类型 默认 2:小程序 | |||
| // keyList.add("environment_image_list");//环境图 非必填 | |||
| keyList.add("environment_image_list");//环境图 对应详情图 | |||
| // keyList.add("free_pack");//是否可以打包 默认否 | |||
| // keyList.add("FrontCategoryTag");//前台品类标签 非必填 | |||
| keyList.add("image_list");//封面图 对应系统商品图----------------------- | |||
| @@ -235,17 +233,24 @@ public class TtGoodsCategoryServiceImpl implements TtGoodsCategoryService { | |||
| } | |||
| } | |||
| /** | |||
| * 环境图 默认无------页面填写 | |||
| * 环境图 默认无------对应详情图 | |||
| * "struct ImageStruct { | |||
| * 1: optional string name | |||
| * 3: optional string url | |||
| * }" | |||
| */ | |||
| // else if("environment_image_list".equals(attr.getKey())){ | |||
| // JSONArray jsonArray = new JSONArray(); | |||
| // | |||
| // attr.setValue(jsonArray.toJSONString()); | |||
| // } | |||
| else if("environment_image_list".equals(attr.getKey())){ | |||
| JSONArray jsonArray = new JSONArray(); | |||
| List<String> strings = JSONArray.parseArray(coupon.getDetailPicture(), String.class); | |||
| if(strings != null && strings.size() > 0){ | |||
| for (String url: strings) { | |||
| JSONObject jsonObject = new JSONObject(); | |||
| jsonObject.put("url",url); | |||
| jsonArray.add(jsonObject); | |||
| } | |||
| } | |||
| attr.setData(jsonArray.toJSONString()); | |||
| } | |||
| //是否可以打包 默认不开启-------页面填写 | |||
| else if("free_pack".equals(attr.getKey())){ | |||
| if(StringUtils.isBlank(attr.getData())){ | |||
| @@ -290,10 +295,12 @@ public class TtGoodsCategoryServiceImpl implements TtGoodsCategoryService { | |||
| else if("image_list".equals(attr.getKey())){ | |||
| JSONArray jsonArray = new JSONArray(); | |||
| List<String> strings = JSONArray.parseArray(coupon.getCoverPicture(), String.class); | |||
| for (String url: strings) { | |||
| JSONObject jsonObject = new JSONObject(); | |||
| jsonObject.put("url",url); | |||
| jsonArray.add(jsonObject); | |||
| if(strings != null && strings.size() > 0){ | |||
| for (String url: strings) { | |||
| JSONObject jsonObject = new JSONObject(); | |||
| jsonObject.put("url",url); | |||
| jsonArray.add(jsonObject); | |||
| } | |||
| } | |||
| attr.setData(jsonArray.toJSONString()); | |||
| } | |||