Merge remote-tracking branch 'origin/master'

zhc4dev
wangjiadong 2 years ago
commit 2f66054689
  1. 115
      ant-design-vue-jeecg/src/views/shopping/pages/clothType.vue
  2. 2
      jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  3. 170
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java
  4. 55
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/FzlxSp.java
  5. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/ZyGoods.java

@ -75,6 +75,7 @@
</template>
<script>
import Header from '../components/Header/HeaderView'
import { httpAction, getAction } from '@/api/manage'
let compareDown = function (prop) {
return function (obj1, obj2) {
var val1 = obj1[prop];
@ -106,89 +107,12 @@
components: {Header},
data() {
return {
//
clothsList: [
{
id: 1,
imgUrl: require("../assets/cloth.png"),
currentPrice: 199,
historicalPrice: 799,
title: "HOODIE 运动长袖连帽卫衣套头衫",
heat: 3100,
},
{
id: 2,
imgUrl: require("../assets/cloth.png"),
currentPrice: 299,
historicalPrice: 799,
title: "HOODIE 运动长袖连帽卫衣套头衫",
heat: 3200,
},
{
id: 3,
imgUrl: require("../assets/cloth.png"),
currentPrice: 399,
historicalPrice: 799,
title: "HOODIE 运动长袖连帽卫衣套头衫",
heat: 3300,
},
{
id: 4,
imgUrl: require("../assets/cloth.png"),
currentPrice: 499,
historicalPrice: 799,
title: "HOODIE 运动长袖连帽卫衣套头衫",
heat: 3400,
},
{
id: 5,
imgUrl: require("../assets/cloth.png"),
currentPrice: 599,
historicalPrice: 799,
title: "HOODIE 运动长袖连帽卫衣套头衫",
heat: 3500,
},
{
id: 6,
imgUrl: require("../assets/cloth.png"),
currentPrice: 699,
historicalPrice: 799,
title: "HOODIE 运动长袖连帽卫衣套头衫",
heat: 3600,
},
{
id: 7,
imgUrl: require("../assets/cloth.png"),
currentPrice: 599,
historicalPrice: 799,
title: "HOODIE 运动长袖连帽卫衣套头衫",
heat: 3700,
url: {
cd: "/zygoods/zyGoods/cd",
lxlist: "/zygoods/zyGoods/lxlist",
},
{
id: 8,
imgUrl: require("../assets/cloth.png"),
currentPrice: 599,
historicalPrice: 799,
title: "HOODIE 运动长袖连帽卫衣套头衫",
heat: 3800,
},
{
id: 9,
imgUrl: require("../assets/cloth.png"),
currentPrice: 599,
historicalPrice: 799,
title: "HOODIE 运动长袖连帽卫衣套头衫",
heat: 3900,
},
{
id: 10,
imgUrl: require("../assets/cloth.png"),
currentPrice: 599,
historicalPrice: 799,
title: "HOODIE 运动长袖连帽卫衣套头衫",
heat:4000,
},
],
//
clothsList: [],
//
typeData: [
{
@ -419,6 +343,13 @@
this.findIndex(indexPath)
//,this.current.id
// this.clothsList
getAction(this.url.lxlist,{typeid:indexPath[1]}).then((res1) => {
if (res1.success) {
this.clothsList = res1.result;
}else{
this.$message.error(res1.message);
}
});
},
clothDetails(item) {
this.$router.push({
@ -443,9 +374,23 @@
}
},
mounted() {
this.current.name = this.typeData[0].childrens[0].name
this.current.id = this.typeData[0].childrens[0].id
this.current.parrentName = this.typeData[0].name
getAction(this.url.cd).then((res) => {
if (res.success) {
this.typeData = res.result;
this.current.name = res.result[0].childrens[0].name
this.current.id = res.result[0].childrens[0].id
this.current.parrentName = res.result[0].name
getAction(this.url.lxlist,{typeid:res.result[0].childrens[0].id}).then((res1) => {
if (res1.success) {
this.clothsList = res1.result;
}else{
this.$message.error(res1.message);
}
});
}else{
this.$message.error(res.message);
}
});
}
}
</script>

@ -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");

@ -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<ZyGoods, IZyGoodsService>
Page<ZyGoods> page = new Page<ZyGoods>(pageNo, pageSize);
IPage<ZyGoods> pageList = zyGoodsService.page(page, queryWrapper);
List<Fzlx> nfzlxList = new ArrayList<Fzlx>();
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<ZyGoods, IZyGoodsService>
queryWrapperzlt2n.eq("type_id",zyClothsType2n.getId());
List<ZyClothsType> 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<ZyGoods> queryWrappern = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap());
@ -567,26 +564,26 @@ public class ZyGoodsController extends JeecgController<ZyGoods, IZyGoodsService>
Page<ZyGoods> pagen = new Page<ZyGoods>(pageNo, pageSize);
IPage<ZyGoods> pageListn = zyGoodsService.page(pagen, queryWrappern);
List<Fzlx> nfzlxListn = new ArrayList<Fzlx>();
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<ZyGoods, IZyGoodsService>
queryWrapperzlt2t.eq("type_id",zyClothsType2t.getId());
List<ZyClothsType> 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<ZyGoods> queryWrappert = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap());
@ -608,30 +605,133 @@ public class ZyGoodsController extends JeecgController<ZyGoods, IZyGoodsService>
Page<ZyGoods> paget = new Page<ZyGoods>(pageNo, pageSize);
IPage<ZyGoods> pageListt = zyGoodsService.page(paget, queryWrappert);
List<Fzlx> nfzlxListt = new ArrayList<Fzlx>();
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<Map<String,Object>> maplist = new ArrayList<>();
//男装
ZyClothsType zyClothsType = new ZyClothsType();
QueryWrapper<ZyClothsType> queryWrapperzlt1 = QueryGenerator.initQueryWrapper(zyClothsType, req.getParameterMap());
queryWrapperzlt1.eq("type_name","男装");
ZyClothsType zyClothsType2 = zyClothsTypeService.getOne(queryWrapperzlt1);
Map<String,Object> map1 = new HashMap<>();
map1.put("id",zyClothsType2.getId());
map1.put("name",zyClothsType2.getTypeName());
//男装子类
QueryWrapper<ZyClothsType> queryWrapperzlt2 = QueryGenerator.initQueryWrapper(zyClothsType, req.getParameterMap());
queryWrapperzlt2.eq("type_id",zyClothsType2.getId());
List<ZyClothsType> listzct = zyClothsTypeService.list(queryWrapperzlt2);
List<Map<String,Object>> tcspList1 = new ArrayList<>();
for (int i = 0 ; i < listzct.size() ; i++){
Map<String,Object> 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<ZyClothsType> queryWrapperzlt1n = QueryGenerator.initQueryWrapper(zyClothsTypen, req.getParameterMap());
queryWrapperzlt1n.eq("type_name","女装");
ZyClothsType zyClothsType2n = zyClothsTypeService.getOne(queryWrapperzlt1n);
Map<String,Object> mapnz = new HashMap<>();
mapnz.put("id",zyClothsType2n.getId());
mapnz.put("name",zyClothsType2n.getTypeName());
//女装子类
QueryWrapper<ZyClothsType> queryWrapperzlt2n = QueryGenerator.initQueryWrapper(zyClothsTypen, req.getParameterMap());
queryWrapperzlt2n.eq("type_id",zyClothsType2n.getId());
List<ZyClothsType> listzctn = zyClothsTypeService.list(queryWrapperzlt2n);
List<Map<String,Object>> tcspList2 = new ArrayList<>();
for (int j = 0 ; j < listzctn.size() ; j++){
Map<String,Object> 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<ZyClothsType> queryWrapperzlt1t = QueryGenerator.initQueryWrapper(zyClothsTypet, req.getParameterMap());
queryWrapperzlt1t.eq("type_name","童装");
ZyClothsType zyClothsType2t = zyClothsTypeService.getOne(queryWrapperzlt1t);
Map<String,Object> maptz = new HashMap<>();
maptz.put("id",zyClothsType2t.getId());
maptz.put("name",zyClothsType2t.getTypeName());
//童装子类
QueryWrapper<ZyClothsType> queryWrapperzlt2t = QueryGenerator.initQueryWrapper(zyClothsTypet, req.getParameterMap());
queryWrapperzlt2t.eq("type_id",zyClothsType2t.getId());
List<ZyClothsType> listzctt = zyClothsTypeService.list(queryWrapperzlt2t);
List<Map<String,Object>> tcspList3 = new ArrayList<>();
for (int m = 0 ; m < listzctt.size() ; m++){
Map<String,Object> 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<ZyGoods> queryWrapper = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap());
queryWrapper.eq("cloths_type_id",typeid);
List<ZyGoods> pageList = zyGoodsService.list(queryWrapper);
List<FzlxSp> 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);
}
}

@ -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;
}

@ -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;
}

Loading…
Cancel
Save