diff --git a/ant-design-vue-jeecg/src/views/shopping/pages/clothType.vue b/ant-design-vue-jeecg/src/views/shopping/pages/clothType.vue index b31414e4..5316ae87 100644 --- a/ant-design-vue-jeecg/src/views/shopping/pages/clothType.vue +++ b/ant-design-vue-jeecg/src/views/shopping/pages/clothType.vue @@ -75,6 +75,7 @@ diff --git a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java index 7200e326..292b4531 100644 --- a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java +++ b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java @@ -158,6 +158,8 @@ public class ShiroConfig { filterChainDefinitionMap.put("/zygoods/zyGoods/zxdz","anon"); filterChainDefinitionMap.put("/zygoods/zyGoods/tjsp","anon"); filterChainDefinitionMap.put("/zygoods/zyGoods/fzlx","anon"); + filterChainDefinitionMap.put("/zygoods/zyGoods/cd","anon"); + filterChainDefinitionMap.put("/zygoods/zyGoods/lxlist","anon"); //filterChainDefinitionMap.put("/actTask/**", "anon"); //filterChainDefinitionMap.put("/actProcessIns/**", "anon"); diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java index a0f454bb..21ebb64f 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java @@ -23,10 +23,7 @@ import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService; import org.jeecg.modules.demo.zyaccessories.entity.ZyStyleAccessories; import org.jeecg.modules.demo.zyaccessories.service.IZyStyleAccessoriesService; -import org.jeecg.modules.demo.zygoods.entity.Fzlx; -import org.jeecg.modules.demo.zygoods.entity.Tcsp; -import org.jeecg.modules.demo.zygoods.entity.Zxdz; -import org.jeecg.modules.demo.zygoods.entity.ZyGoods; +import org.jeecg.modules.demo.zygoods.entity.*; import org.jeecg.modules.demo.zygoods.service.IZyGoodsService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -526,26 +523,26 @@ public class ZyGoodsController extends JeecgController Page page = new Page(pageNo, pageSize); IPage pageList = zyGoodsService.page(page, queryWrapper); List nfzlxList = new ArrayList(); - for(int i = 0 ; i < pageList.getRecords().size();i++){ + for(int j = 0 ; j < pageList.getRecords().size();j++){ Fzlx fzlx = new Fzlx(); - fzlx.setId(pageList.getRecords().get(i).getId()); - fzlx.setImgUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+pageList.getRecords().get(i).getGoodsPicture()); - fzlx.setTitle1(zyClothsTypeService.getById(pageList.getRecords().get(i).getClothsTypeId()).getTypeName()); - fzlx.setTitle2(pageList.getRecords().get(i).getGoodsName()); - String tag1 = zyClothsStyleService.getById(pageList.getRecords().get(i).getStyleId()).getCharacteristic(); + fzlx.setId(pageList.getRecords().get(j).getId()); + fzlx.setImgUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+pageList.getRecords().get(j).getGoodsPicture()); + fzlx.setTitle1(zyClothsTypeService.getById(pageList.getRecords().get(j).getClothsTypeId()).getTypeName()); + fzlx.setTitle2(pageList.getRecords().get(j).getGoodsName()); + String tag1 = zyClothsStyleService.getById(pageList.getRecords().get(j).getStyleId()).getCharacteristic(); if(tag1.length()>7){ fzlx.setTag1(tag1.substring(0,7)+"..."); }else{ fzlx.setTag1(tag1); } - String tag2 = zyClothsStyleService.getById(pageList.getRecords().get(i).getStyleId()).getStructure(); + String tag2 = zyClothsStyleService.getById(pageList.getRecords().get(j).getStyleId()).getStructure(); if(tag2.length()>7){ fzlx.setTag2(tag2.substring(0,7)+"..."); }else{ fzlx.setTag2(tag2); } - fzlx.setPrice(pageList.getRecords().get(i).getUnitPrice()); - fzlx.setSold(pageList.getRecords().get(i).getNum()); + fzlx.setPrice(pageList.getRecords().get(j).getUnitPrice()); + fzlx.setSold(pageList.getRecords().get(j).getNum()); nfzlxList.add(fzlx); } map.put("nz",nfzlxList); @@ -558,8 +555,8 @@ public class ZyGoodsController extends JeecgController queryWrapperzlt2n.eq("type_id",zyClothsType2n.getId()); List listzctn = zyClothsTypeService.list(queryWrapperzlt2n); String idsn = ""; - for (int i = 0 ; i < listzctn.size() ; i++){ - idsn = idsn + listzctn.get(i).getId()+","; + for (int k = 0 ; k < listzctn.size() ; k++){ + idsn = idsn + listzctn.get(k).getId()+","; } String [] strn = idsn.substring(0,idsn.length()-1).split(","); QueryWrapper queryWrappern = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap()); @@ -567,26 +564,26 @@ public class ZyGoodsController extends JeecgController Page pagen = new Page(pageNo, pageSize); IPage pageListn = zyGoodsService.page(pagen, queryWrappern); List nfzlxListn = new ArrayList(); - for(int i = 0 ; i < pageListn.getRecords().size();i++){ + for(int l = 0 ; l < pageListn.getRecords().size();l++){ Fzlx fzlx = new Fzlx(); - fzlx.setId(pageListn.getRecords().get(i).getId()); - fzlx.setImgUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+pageListn.getRecords().get(i).getGoodsPicture()); - fzlx.setTitle1(zyClothsTypeService.getById(pageListn.getRecords().get(i).getClothsTypeId()).getTypeName()); - fzlx.setTitle2(pageListn.getRecords().get(i).getGoodsName()); - String tag1 = zyClothsStyleService.getById(pageListn.getRecords().get(i).getStyleId()).getCharacteristic(); + fzlx.setId(pageListn.getRecords().get(l).getId()); + fzlx.setImgUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+pageListn.getRecords().get(l).getGoodsPicture()); + fzlx.setTitle1(zyClothsTypeService.getById(pageListn.getRecords().get(l).getClothsTypeId()).getTypeName()); + fzlx.setTitle2(pageListn.getRecords().get(l).getGoodsName()); + String tag1 = zyClothsStyleService.getById(pageListn.getRecords().get(l).getStyleId()).getCharacteristic(); if(tag1.length()>7){ fzlx.setTag1(tag1.substring(0,7)+"..."); }else{ fzlx.setTag1(tag1); } - String tag2 = zyClothsStyleService.getById(pageListn.getRecords().get(i).getStyleId()).getStructure(); + String tag2 = zyClothsStyleService.getById(pageListn.getRecords().get(l).getStyleId()).getStructure(); if(tag2.length()>7){ fzlx.setTag2(tag2.substring(0,7)+"..."); }else{ fzlx.setTag2(tag2); } - fzlx.setPrice(pageListn.getRecords().get(i).getUnitPrice()); - fzlx.setSold(pageListn.getRecords().get(i).getNum()); + fzlx.setPrice(pageListn.getRecords().get(l).getUnitPrice()); + fzlx.setSold(pageListn.getRecords().get(l).getNum()); nfzlxListn.add(fzlx); } map.put("nvz",nfzlxListn); @@ -599,8 +596,8 @@ public class ZyGoodsController extends JeecgController queryWrapperzlt2t.eq("type_id",zyClothsType2t.getId()); List listzctt = zyClothsTypeService.list(queryWrapperzlt2t); String idst = ""; - for (int i = 0 ; i < listzctt.size() ; i++){ - idst = idst + listzctt.get(i).getId()+","; + for (int m = 0 ; m < listzctt.size() ; m++){ + idst = idst + listzctt.get(m).getId()+","; } String [] strt = idst.substring(0,idst.length()-1).split(","); QueryWrapper queryWrappert = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap()); @@ -608,30 +605,133 @@ public class ZyGoodsController extends JeecgController Page paget = new Page(pageNo, pageSize); IPage pageListt = zyGoodsService.page(paget, queryWrappert); List nfzlxListt = new ArrayList(); - for(int i = 0 ; i < pageListt.getRecords().size();i++){ + for(int n = 0 ; n < pageListt.getRecords().size();n++){ Fzlx fzlx = new Fzlx(); - fzlx.setId(pageListt.getRecords().get(i).getId()); - fzlx.setImgUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+pageListt.getRecords().get(i).getGoodsPicture()); - fzlx.setTitle1(zyClothsTypeService.getById(pageListt.getRecords().get(i).getClothsTypeId()).getTypeName()); - fzlx.setTitle2(pageListt.getRecords().get(i).getGoodsName()); - String tag1 = zyClothsStyleService.getById(pageListt.getRecords().get(i).getStyleId()).getCharacteristic(); + fzlx.setId(pageListt.getRecords().get(n).getId()); + fzlx.setImgUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+pageListt.getRecords().get(n).getGoodsPicture()); + fzlx.setTitle1(zyClothsTypeService.getById(pageListt.getRecords().get(n).getClothsTypeId()).getTypeName()); + fzlx.setTitle2(pageListt.getRecords().get(n).getGoodsName()); + String tag1 = zyClothsStyleService.getById(pageListt.getRecords().get(n).getStyleId()).getCharacteristic(); if(tag1.length()>7){ fzlx.setTag1(tag1.substring(0,7)+"..."); }else{ fzlx.setTag1(tag1); } - String tag2 = zyClothsStyleService.getById(pageListt.getRecords().get(i).getStyleId()).getStructure(); + String tag2 = zyClothsStyleService.getById(pageListt.getRecords().get(n).getStyleId()).getStructure(); if(tag2.length()>7){ fzlx.setTag2(tag2.substring(0,7)+"..."); }else{ fzlx.setTag2(tag2); } - fzlx.setPrice(pageListt.getRecords().get(i).getUnitPrice()); - fzlx.setSold(pageListt.getRecords().get(i).getNum()); + fzlx.setPrice(pageListt.getRecords().get(n).getUnitPrice()); + fzlx.setSold(pageListt.getRecords().get(n).getNum()); nfzlxListt.add(fzlx); } map.put("tz",nfzlxListt); return Result.OK(map); } + /** + * 商城接口服装类型菜单 + * + * @param req + * @return + */ + @AutoLog(value = "类型菜单") + @ApiOperation(value="类型菜单", notes="类型菜单") + @GetMapping(value = "/cd") + public Result cd(HttpServletRequest req) { + List> maplist = new ArrayList<>(); + //男装 + ZyClothsType zyClothsType = new ZyClothsType(); + QueryWrapper queryWrapperzlt1 = QueryGenerator.initQueryWrapper(zyClothsType, req.getParameterMap()); + queryWrapperzlt1.eq("type_name","男装"); + ZyClothsType zyClothsType2 = zyClothsTypeService.getOne(queryWrapperzlt1); + Map map1 = new HashMap<>(); + map1.put("id",zyClothsType2.getId()); + map1.put("name",zyClothsType2.getTypeName()); + //男装子类 + QueryWrapper queryWrapperzlt2 = QueryGenerator.initQueryWrapper(zyClothsType, req.getParameterMap()); + queryWrapperzlt2.eq("type_id",zyClothsType2.getId()); + List listzct = zyClothsTypeService.list(queryWrapperzlt2); + List> tcspList1 = new ArrayList<>(); + for (int i = 0 ; i < listzct.size() ; i++){ + Map map2 = new HashMap<>(); + map2.put("id",listzct.get(i).getId()); + map2.put("name",listzct.get(i).getTypeName()); + tcspList1.add(map2); + } + map1.put("childrens",tcspList1); + maplist.add(map1); + //女装 + ZyClothsType zyClothsTypen = new ZyClothsType(); + QueryWrapper queryWrapperzlt1n = QueryGenerator.initQueryWrapper(zyClothsTypen, req.getParameterMap()); + queryWrapperzlt1n.eq("type_name","女装"); + ZyClothsType zyClothsType2n = zyClothsTypeService.getOne(queryWrapperzlt1n); + Map mapnz = new HashMap<>(); + mapnz.put("id",zyClothsType2n.getId()); + mapnz.put("name",zyClothsType2n.getTypeName()); + //女装子类 + QueryWrapper queryWrapperzlt2n = QueryGenerator.initQueryWrapper(zyClothsTypen, req.getParameterMap()); + queryWrapperzlt2n.eq("type_id",zyClothsType2n.getId()); + List listzctn = zyClothsTypeService.list(queryWrapperzlt2n); + List> tcspList2 = new ArrayList<>(); + for (int j = 0 ; j < listzctn.size() ; j++){ + Map map3 = new HashMap<>(); + map3.put("id",listzctn.get(j).getId()); + map3.put("name",listzctn.get(j).getTypeName()); + tcspList2.add(map3); + } + mapnz.put("childrens",tcspList2); + maplist.add(mapnz); + //童装 + ZyClothsType zyClothsTypet = new ZyClothsType(); + QueryWrapper queryWrapperzlt1t = QueryGenerator.initQueryWrapper(zyClothsTypet, req.getParameterMap()); + queryWrapperzlt1t.eq("type_name","童装"); + ZyClothsType zyClothsType2t = zyClothsTypeService.getOne(queryWrapperzlt1t); + Map maptz = new HashMap<>(); + maptz.put("id",zyClothsType2t.getId()); + maptz.put("name",zyClothsType2t.getTypeName()); + //童装子类 + QueryWrapper queryWrapperzlt2t = QueryGenerator.initQueryWrapper(zyClothsTypet, req.getParameterMap()); + queryWrapperzlt2t.eq("type_id",zyClothsType2t.getId()); + List listzctt = zyClothsTypeService.list(queryWrapperzlt2t); + List> tcspList3 = new ArrayList<>(); + for (int m = 0 ; m < listzctt.size() ; m++){ + Map map4= new HashMap<>(); + map4.put("id",listzctt.get(m).getId()); + map4.put("name",listzctt.get(m).getTypeName()); + tcspList3.add(map4); + } + maptz.put("childrens",tcspList3); + maplist.add(maptz); + return Result.OK(maplist); + } + /** + * 商城接口服装类型查询 + * + * @param zyGoods + * @param req + * @return + */ + @AutoLog(value = "服装类型查询") + @ApiOperation(value="服装类型查询", notes="服装类型查询") + @GetMapping(value = "/lxlist") + public Result lxlist(ZyGoods zyGoods,HttpServletRequest req,@RequestParam(name="typeid",required=true) String typeid) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap()); + queryWrapper.eq("cloths_type_id",typeid); + List pageList = zyGoodsService.list(queryWrapper); + List listsp = new ArrayList<>(); + for (int i = 0 ; i < pageList.size() ; i++){ + FzlxSp fzlxSp = new FzlxSp(); + fzlxSp.setId(pageList.get(i).getId()); + fzlxSp.setImgUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+pageList.get(i).getGoodsPicture()); + fzlxSp.setCurrentPrice(pageList.get(i).getPromotionPrice()); + fzlxSp.setHistoricalPrice(pageList.get(i).getUnitPrice()); + fzlxSp.setTitle(pageList.get(i).getGoodsName()); + fzlxSp.setHeat(pageList.get(i).getClick()); + listsp.add(fzlxSp); + } + return Result.OK(listsp); + } } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/FzlxSp.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/FzlxSp.java new file mode 100644 index 00000000..e4001bc4 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/FzlxSp.java @@ -0,0 +1,55 @@ +package org.jeecg.modules.demo.zygoods.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 商品表 + * @Author: jeecg-boot + * @Date: 2022-12-07 + * @Version: V1.0 + */ +@Data + +public class FzlxSp implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**商品图片*/ + @Excel(name = "商品图片", width = 15) + @ApiModelProperty(value = "商品图片") + private java.lang.String imgUrl; + /**折扣价*/ + @Excel(name = "折扣价", width = 15) + @ApiModelProperty(value = "折扣价") + private java.lang.Double currentPrice; + /**单价*/ + @Excel(name = "单价", width = 15) + @ApiModelProperty(value = "单价") + private java.lang.Double historicalPrice; + /**商品名称*/ + @Excel(name = "商品名称", width = 15) + @ApiModelProperty(value = "商品名称") + private java.lang.String title; + /**热度*/ + @Excel(name = "热度", width = 15) + @ApiModelProperty(value = "热度") + private java.lang.String heat; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/ZyGoods.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/ZyGoods.java index b8ab8794..d8b1e1a5 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/ZyGoods.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/ZyGoods.java @@ -141,4 +141,9 @@ public class ZyGoods implements Serializable { @Excel(name = "销售数量", width = 15) @ApiModelProperty(value = "销售数量") private java.lang.Integer num; + /**点击量*/ + @Excel(name = "点击量", width = 15) + @ApiModelProperty(value = "点击量") + private java.lang.String click; + }