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