package com.trs.nike.controller.admin;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.trs.nike.pojo.Area;
import com.trs.nike.pojo.Member;
import com.trs.nike.pojo.Product;
import com.trs.nike.service.AreaService;
import com.trs.nike.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Arrays;
import java.util.List;
@Controller
@RequestMapping("/nikemanage.com")
public class Admin_MemberController {
@Autowired
private MemberService memberService;
@Autowired
private AreaService areaService;
/**
* 根据地区上一级id查询到下一级的集合
* @param areaId
* @return
*/
public List<Area> findBySuperiorId(String areaId){
QueryWrapper<Area> wrapper = new QueryWrapper();
wrapper.eq("superior_id",areaId);
List<Area> areas = areaService.list(wrapper);
return areas;
}
@RequestMapping("/skip-member-list")
String skipMemberList(@RequestParam(value = "current",required = false) Integer current,
@RequestParam(value = "search",required = false) String search,
@RequestParam(value = "value",required = false) String value, Model model){
// 防止页面未能及时加载出来而设置一段时间延迟
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
IPage<Member> iPage = new Page<>();
iPage.setCurrent(1);
if(current!=null){
iPage.setCurrent(current);
}
iPage.setSize(9);
QueryWrapper<Member> wrapper = new QueryWrapper<>();
if(search!=null && search!=""){
if(search.equals("name")){
wrapper.like(value!=null,"name", value);
}else if(search.equals("phone")){
wrapper.like(value!=null,"phone", value);
}
}
iPage = memberService.page(iPage,wrapper);
//如果删除整个页面的数据,就会导致页码大于真实数据的页数
if(current!=null) {
if (current > iPage.getPages()) {
iPage.setCurrent(iPage.getPages());
iPage = memberService.page(iPage, wrapper);
}
}
for (Member member: iPage.getRecords()) {
Area area = areaService.getByAreaId(member.getAreaId());
if(area.getSuperiorId().equals("")){
member.setAreaName(area.getAreaName());
}else{
Area city = areaService.getByAreaId(area.getSuperiorId());
Area province = areaService.getByAreaId(city.getSuperiorId());
Area state = areaService.getByAreaId(province.getSuperiorId());
member.setAreaName(state.getAreaName() + " " + province.getAreaName()+" "+city.getAreaName()+" "+area.getAreaName());
}
}
model.addAttribute("iPage", iPage);
model.addAttribute("search", search);
model.addAttribute("value", value);
return "/admin/member-list";
}
@RequestMapping("/member-del")
@ResponseBody
boolean delMember(@RequestParam(value = "memberIds",required = false) String memberIds,
@RequestParam(value = "memberId",required = false) Long memberId){
boolean flag = false;
if(memberIds!="" && memberIds!=null){
//解析字符,转化为String数组
String[] array = memberIds.split(",");
//转成Long型数组
Long[] memberIdList = new Long[array.length];
for(int i = 0; i<memberIdList.length; i++){
memberIdList[i] = Long.parseLong(array[i]);
}
flag = memberService.removeByIds(Arrays.asList(memberIdList));
}else{
QueryWrapper<Product> wrapper = new QueryWrapper();
wrapper.eq("member_id", memberId);
flag = memberService.removeById(memberId);
}
return flag;
}
@RequestMapping("/skip-member-save")
String skipSaveMember(@RequestParam(value = "operation") String operation,@RequestParam(value = "memberId",required = false) Long memberId,Model model){
model.addAttribute("operation", "member-add");
List<Area> states = null;
List<Area> provinces = null;
List<Area> citys = null;
List<Area> countys = null;
if(memberId != null){
Member member = memberService.getById(memberId);
Area area = areaService.getByAreaId(member.getAreaId());
Area city = null;
Area province = null;
Area state = null;
//判断该用户的地区是否只到国家还是县级
if(area.getSuperiorId().equals("")){
state = area;
}else{
city = areaService.getByAreaId(area.getSuperiorId());
province = areaService.getByAreaId(city.getSuperiorId());
state = areaService.getByAreaId(province.getSuperiorId());
model.addAttribute("county", area);
model.addAttribute("city", city);
model.addAttribute("province", province);
}
model.addAttribute("state", state);
//获取对应地区集合
if(operation.equals("member-update")){
QueryWrapper<Area> wrapper = new QueryWrapper();
wrapper.eq("superior_id","");
states = areaService.list(wrapper);
if(city != null){
provinces = findBySuperiorId(state.getAreaId());
citys = findBySuperiorId(province.getAreaId());
countys = findBySuperiorId(city.getAreaId());
}else{
//获取对应国家/地区下一级的集合
provinces = findBySuperiorId(state.getAreaId());
//获取第一个省级下一级的集合
citys = findBySuperiorId(provinces.get(0).getAreaId());
//获取第一个市级下一级的集合
countys = findBySuperiorId(citys.get(0).getAreaId());
}
model.addAttribute("states",states);
model.addAttribute("provinces",provinces);
model.addAttribute("citys",citys);
model.addAttribute("countys",countys);
}
model.addAttribute("operation", operation);
model.addAttribute("member", member);
return "admin/member-save";
}
//新增-获取多个国家/地区的集合
QueryWrapper<Area> wrapper = new QueryWrapper();
wrapper.eq("superior_id","");
states = areaService.list(wrapper);
//获取第一个国家/地区下一级的集合
provinces = findBySuperiorId(states.get(0).getAreaId());
//获取第一个省级下一级的集合
citys = findBySuperiorId(provinces.get(0).getAreaId());
//获取第一个市级下一级的集合
countys = findBySuperiorId(citys.get(0).getAreaId());
model.addAttribute("states",states);
model.addAttribute("provinces",provinces);
model.addAttribute("citys",citys);
model.addAttribute("countys",countys);
model.addAttribute("operation","member-add");
return "admin/member-save";
}
@RequestMapping("/get-area-list")
@ResponseBody
String getAreaList(@Request
没有合适的资源?快使用搜索试试~ 我知道了~
基于HTML、JavaScript、Java和CSS的Nike网站设计源码
共461个文件
js:172个
png:119个
java:66个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 144 浏览量
2024-10-08
17:05:19
上传
评论
收藏 94.06MB ZIP 举报
温馨提示
该Nike网站设计源码采用HTML、JavaScript、Java和CSS等多语言开发,总计包含461个文件,其中JS脚本文件172个,图片文件119个(包括PNG、JPG、GIF等格式),Java源代码66个,CSS样式18个。该源码集成了丰富的资源,旨在打造一个功能完善、界面美观的在线购物平台。
资源推荐
资源详情
资源评论
收起资源包目录
基于HTML、JavaScript、Java和CSS的Nike网站设计源码 (461个子文件)
mvnw.cmd 6KB
style.min.css 110KB
bootstrap.min.css 106KB
materialdesignicons.min.css 85KB
layui.css 78KB
animate.css 71KB
bootstrap-datepicker3.css 22KB
jquery-confirm.min.css 22KB
bootstrap-datepicker3.min.css 21KB
layer.css 14KB
ion.rangeSlider.min.css 11KB
bootstrap-datetimepicker.css 9KB
bootstrap-datetimepicker.min.css 8KB
laydate.css 7KB
bootstrap-colorpicker.css 5KB
bootstrap-colorpicker.min.css 4KB
code.css 1KB
jquery.tagsinput.min.css 903B
mine.css 865B
materialdesignicons.eot 286KB
iconfont.eot 46KB
loading-0.gif 6KB
loading-2.gif 2KB
loading-1.gif 701B
.gitignore 395B
member-save.html 38KB
admin-index.html 30KB
productType-list.html 27KB
member-list.html 26KB
exercise-list.html 26KB
series-list.html 26KB
brand-list.html 25KB
productType-save.html 25KB
product-list.html 23KB
exercise-save.html 18KB
series-save.html 18KB
brand-save.html 18KB
login.html 6KB
maven-wrapper.jar 50KB
Admin_MemberController.java 9KB
Admin_ProductTypeController.java 5KB
Admin_ExerciseController.java 5KB
MavenWrapperDownloader.java 5KB
Admin_SeriesController.java 5KB
Admin_BrandController.java 5KB
ProductType.java 3KB
AdminController.java 3KB
Admin_ProductController.java 3KB
Area.java 2KB
Exercise.java 2KB
Product.java 2KB
MybatisPlusConfig.java 2KB
Member.java 2KB
Style.java 1016B
Resource.java 848B
NikeApplicationTests.java 836B
MyMetaObjectHandler.java 781B
MemberServiceImpl.java 757B
ProductServiceImpl.java 723B
Address.java 605B
AreaServiceImpl.java 593B
StyleServiceImpl.java 584B
PromotionCode.java 534B
ProductController.java 528B
User.java 528B
Series.java 511B
OrderInfo.java 508B
Size.java 451B
ResourceServiceImpl.java 442B
StyleMapper.java 436B
ProductService.java 434B
OrderDetails.java 431B
BrandServiceImpl.java 421B
ProductTypeServiceImpl.java 416B
ProductMapper.java 397B
MemberService.java 397B
ExerciseServiceImpl.java 395B
Brand.java 386B
Admin.java 385B
SeriesServiceImpl.java 381B
AdminServiceImpl.java 374B
AddressServiceImpl.java 362B
StyleService.java 356B
NikeApplication.java 313B
BrandMapper.java 288B
AdminMapper.java 286B
PromotionCodeMapper.java 265B
OrderDetailsMapper.java 262B
ProductTypeMapper.java 259B
OrderInfoMapper.java 253B
ResourceMapper.java 250B
ExerciseMapper.java 250B
AddressMapper.java 247B
SeriesMapper.java 244B
MemberMapper.java 244B
ResourceService.java 239B
AreaMapper.java 238B
SizeMapper.java 237B
AreaService.java 225B
ProductTypeService.java 201B
共 461 条
- 1
- 2
- 3
- 4
- 5
资源评论
lsx202406
- 粉丝: 2584
- 资源: 5607
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功