商城首页

zhc4dev
Gitea 2 years ago
parent 0159a0cd06
commit 05c9fff089
  1. 30
      ant-design-vue-jeecg/src/views/shopping/shopHome.vue
  2. 4
      jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  3. 214
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java
  4. 63
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/Fzlx.java
  5. 47
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/Tcsp.java
  6. 51
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/Zxdz.java
  7. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/entity/ZyGoods.java

@ -88,8 +88,8 @@
</div>
<div class="box" v-for="(item, index) in clothList2" :key="index">
<img :src="item.imgUrl" alt="" />
<p class="box1">CLOTHING NAM</p>
<p class="box2">15分钟前定制</p>
<p class="box1">{{item.title}}</p>
<p class="box2">{{item.time}}</p>
</div>
</a-carousel>
<div class="more d-flex" style="padding-top: 20px">
@ -124,7 +124,7 @@
>
<img :src="item.imgUrl" alt="" />
<p class="title_6">
{{ item.title1 }}<span class="line">|</span>{{ item.title1 }}
{{ item.title1 }}<span class="line">|</span>{{ item.title2 }}
</p>
<div>
<el-tag type="warning" size="small">{{ item.tag1 }}</el-tag
@ -151,7 +151,7 @@
>
<img :src="item.imgUrl" alt="" />
<p>
{{ item.title1 }}<span class="line">|</span>{{ item.title1 }}
{{ item.title1 }}<span class="line">|</span>{{ item.title2 }}
</p>
<div>
<el-tag type="warning" size="small">{{ item.tag1 }}</el-tag
@ -178,7 +178,7 @@
>
<img :src="item.imgUrl" alt="" />
<p>
{{ item.title1 }}<span class="line">|</span>{{ item.title1 }}
{{ item.title1 }}<span class="line">|</span>{{ item.title2 }}
</p>
<div>
<el-tag type="warning" size="small">{{ item.tag1 }}</el-tag
@ -215,6 +215,8 @@
activeName: "first",
url: {
zxdz: "/zygoods/zyGoods/zxdz",
tjsp: "/zygoods/zyGoods/tjsp",
fzlx: "/zygoods/zyGoods/fzlx",
},
//
imgList: [
@ -630,11 +632,27 @@
this.vh = window.screen.availHeight - 100;
getAction(this.url.zxdz).then((res) => {
if (res.success) {
console.log(res.result);
this.clothList = res.result;
}else{
this.$message.error(res.message);
}
});
getAction(this.url.tjsp).then((res) => {
if (res.success) {
this.clothList2 = res.result;
}else{
this.$message.error(res.message);
}
});
getAction(this.url.fzlx).then((res) => {
if (res.success) {
console.log(res.result)
this.nanzhuang = res.result.nz;
this.nvzhuang = res.result.nvz;
this.tongzhuang = res.result.tz;
}else{
this.$message.error(res.message);
}
})
},
}

@ -154,6 +154,10 @@ public class ShiroConfig {
//商城
filterChainDefinitionMap.put("/mall/**","anon");
filterChainDefinitionMap.put("/shopping/**","anon");
filterChainDefinitionMap.put("/zygoods/zyGoods/zxdz","anon");
filterChainDefinitionMap.put("/zygoods/zyGoods/tjsp","anon");
filterChainDefinitionMap.put("/zygoods/zyGoods/fzlx","anon");
//filterChainDefinitionMap.put("/actTask/**", "anon");
//filterChainDefinitionMap.put("/actProcessIns/**", "anon");

@ -1,8 +1,6 @@
package org.jeecg.modules.demo.zygoods.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
@ -21,8 +19,13 @@ import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric;
import org.jeecg.modules.demo.goodsfabric.service.IGoodsFabricService;
import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule;
import org.jeecg.modules.demo.goodsmodule.service.IGoodsModuleService;
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.service.IZyGoodsService;
@ -88,6 +91,8 @@ public class ZyGoodsController extends JeecgController<ZyGoods, IZyGoodsService>
private IGoodsAccessoriesService goodsAccessoriesService;
@Autowired
private IGoodsFabricService goodsFabricService;
@Autowired
private IOrderGoodsService orderGoodsService;
/**
* 分页列表查询
@ -425,5 +430,208 @@ public class ZyGoodsController extends JeecgController<ZyGoods, IZyGoodsService>
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ZyGoods.class);
}
/**
* 商城接口最新定制
*
* @param orderGoods
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "最新定制")
@ApiOperation(value="最新定制", notes="最新定制")
@GetMapping(value = "/zxdz")
public Result<?> zxdz(OrderGoods orderGoods,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="3") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<OrderGoods> queryWrapper = QueryGenerator.initQueryWrapper(orderGoods, req.getParameterMap());
queryWrapper.eq("customized",1);
Page<OrderGoods> page = new Page<OrderGoods>(pageNo, pageSize);
IPage<OrderGoods> pageList = orderGoodsService.page(page, queryWrapper);
List<Zxdz> zxdzList = new ArrayList<Zxdz>();
for(int i = 0 ; i < pageList.getRecords().size();i++){
Zxdz zxdz = new Zxdz();
zxdz.setId(pageList.getRecords().get(i).getId());
zxdz.setImgUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+pageList.getRecords().get(i).getGoodsPicture());
zxdz.setPrice(pageList.getRecords().get(i).getUnitPrice());
zxdz.setTitle1(zyClothsTypeService.getById(pageList.getRecords().get(i).getClothsTypeId()).getTypeName());
zxdz.setTitle2(pageList.getRecords().get(i).getGoodsName());
zxdzList.add(zxdz);
}
return Result.OK(zxdzList);
}
/**
* 商城接口推荐商品
*
* @param zyGoods
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "推荐商品")
@ApiOperation(value="推荐商品", notes="推荐商品")
@GetMapping(value = "/tjsp")
public Result<?> tjsp(ZyGoods zyGoods,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="3") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyGoods> queryWrapper = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap());
queryWrapper.eq("recommend",1);
Page<ZyGoods> page = new Page<ZyGoods>(pageNo, pageSize);
IPage<ZyGoods> pageList = zyGoodsService.page(page, queryWrapper);
List<Tcsp> tcspList = new ArrayList<Tcsp>();
for(int i = 0 ; i < pageList.getRecords().size();i++){
Tcsp tcsp = new Tcsp();
tcsp.setId(pageList.getRecords().get(i).getId());
tcsp.setImgUrl("http://localhost:10085/jeecg-boot/sys/common/static/"+pageList.getRecords().get(i).getGoodsPicture());
tcsp.setTime(pageList.getRecords().get(i).getUnitPrice());
tcsp.setTitle(pageList.getRecords().get(i).getGoodsName());
tcspList.add(tcsp);
}
return Result.OK(tcspList);
}
/**
* 商城接口服装类型
*
* @param zyGoods
* @param req
* @return
*/
@AutoLog(value = "服装类型")
@ApiOperation(value="服装类型", notes="服装类型")
@GetMapping(value = "/fzlx")
public Result<?> fzlx(ZyGoods zyGoods,HttpServletRequest req,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
Map<String,List<Fzlx>> map = new HashMap<>();
//男装
ZyClothsType zyClothsType = new ZyClothsType();
QueryWrapper<ZyClothsType> queryWrapperzlt1 = QueryGenerator.initQueryWrapper(zyClothsType, req.getParameterMap());
queryWrapperzlt1.eq("type_name","男装");
ZyClothsType zyClothsType2 = zyClothsTypeService.getOne(queryWrapperzlt1);
QueryWrapper<ZyClothsType> queryWrapperzlt2 = QueryGenerator.initQueryWrapper(zyClothsType, req.getParameterMap());
queryWrapperzlt2.eq("type_id",zyClothsType2.getId());
List<ZyClothsType> listzct = zyClothsTypeService.list(queryWrapperzlt2);
String ids = "";
for (int i = 0 ; i < listzct.size() ; i++){
ids = ids + listzct.get(i).getId()+",";
}
String [] str = ids.substring(0,ids.length()-1).split(",");
QueryWrapper<ZyGoods> queryWrapper = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap());
queryWrapper.in("cloths_type_id",str);
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++){
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();
if(tag1.length()>7){
fzlx.setTag1(tag1.substring(0,7)+"...");
}else{
fzlx.setTag1(tag1);
}
String tag2 = zyClothsStyleService.getById(pageList.getRecords().get(i).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());
nfzlxList.add(fzlx);
}
map.put("nz",nfzlxList);
//女装
ZyClothsType zyClothsTypen = new ZyClothsType();
QueryWrapper<ZyClothsType> queryWrapperzlt1n = QueryGenerator.initQueryWrapper(zyClothsTypen, req.getParameterMap());
queryWrapperzlt1n.eq("type_name","女装");
ZyClothsType zyClothsType2n = zyClothsTypeService.getOne(queryWrapperzlt1n);
QueryWrapper<ZyClothsType> queryWrapperzlt2n = QueryGenerator.initQueryWrapper(zyClothsTypen, req.getParameterMap());
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()+",";
}
String [] strn = idsn.substring(0,idsn.length()-1).split(",");
QueryWrapper<ZyGoods> queryWrappern = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap());
queryWrappern.in("cloths_type_id",strn);
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++){
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();
if(tag1.length()>7){
fzlx.setTag1(tag1.substring(0,7)+"...");
}else{
fzlx.setTag1(tag1);
}
String tag2 = zyClothsStyleService.getById(pageListn.getRecords().get(i).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());
nfzlxListn.add(fzlx);
}
map.put("nvz",nfzlxListn);
//童装
ZyClothsType zyClothsTypet = new ZyClothsType();
QueryWrapper<ZyClothsType> queryWrapperzlt1t = QueryGenerator.initQueryWrapper(zyClothsTypet, req.getParameterMap());
queryWrapperzlt1t.eq("type_name","童装");
ZyClothsType zyClothsType2t = zyClothsTypeService.getOne(queryWrapperzlt1t);
QueryWrapper<ZyClothsType> queryWrapperzlt2t = QueryGenerator.initQueryWrapper(zyClothsTypet, req.getParameterMap());
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()+",";
}
String [] strt = idst.substring(0,idst.length()-1).split(",");
QueryWrapper<ZyGoods> queryWrappert = QueryGenerator.initQueryWrapper(zyGoods, req.getParameterMap());
queryWrappert.in("cloths_type_id",strt);
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++){
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();
if(tag1.length()>7){
fzlx.setTag1(tag1.substring(0,7)+"...");
}else{
fzlx.setTag1(tag1);
}
String tag2 = zyClothsStyleService.getById(pageListt.getRecords().get(i).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());
nfzlxListt.add(fzlx);
}
map.put("tz",nfzlxListt);
return Result.OK(map);
}
}

@ -0,0 +1,63 @@
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 Fzlx 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.String title1;
/**商品名称*/
@Excel(name = "商品名称", width = 15)
@ApiModelProperty(value = "商品名称")
private java.lang.String title2;
/**特征*/
@Excel(name = "特征", width = 15)
@ApiModelProperty(value = "特征")
private java.lang.String tag1;
/**结构*/
@Excel(name = "结构", width = 15)
@ApiModelProperty(value = "结构")
private java.lang.String tag2;
/**单价*/
@Excel(name = "单价", width = 15)
@ApiModelProperty(value = "单价")
private java.lang.Double price;
/**销售数量*/
@Excel(name = "销售数量", width = 15)
@ApiModelProperty(value = "销售数量")
private java.lang.Integer sold;
}

@ -0,0 +1,47 @@
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 Tcsp 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.String title;
/**单价*/
@Excel(name = "单价", width = 15)
@ApiModelProperty(value = "单价")
private java.lang.Double time;
}

@ -0,0 +1,51 @@
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 Zxdz 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.String title1;
/**商品名称*/
@Excel(name = "商品名称", width = 15)
@ApiModelProperty(value = "商品名称")
private java.lang.String title2;
/**单价*/
@Excel(name = "单价", width = 15)
@ApiModelProperty(value = "单价")
private java.lang.Double price;
}

@ -137,4 +137,8 @@ public class ZyGoods implements Serializable {
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@ApiModelProperty(value = "企业id")
private java.lang.String enterprisesId;
/**销售数量*/
@Excel(name = "销售数量", width = 15)
@ApiModelProperty(value = "销售数量")
private java.lang.Integer num;
}

Loading…
Cancel
Save