个人中心

zhc4dev
wangjiadong 2 years ago
parent e34520a3a8
commit e1b77ef21a
  1. 5
      ant-design-vue-jeecg/src/views/shopping/pages/gerenzhongxin.vue
  2. 81
      ant-design-vue-jeecg/src/views/shopping/pages/orderDetails.vue
  3. 40
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
  4. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java
  5. 21
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserMapper.xml
  6. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysUserService.java
  7. 13
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
  8. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/vo/Grzx1.java
  9. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/vo/Grzx2.java

@ -179,13 +179,8 @@
getAction(this.url.findgoods).then((res) => { getAction(this.url.findgoods).then((res) => {
if(res.success) { if(res.success) {
this.allOrders2 = res.result; this.allOrders2 = res.result;
console.log("===========")
console.log(res.result)
console.log(this.allOrders2)
console.log("===========")
this.visible = true; this.visible = true;
} else { } else {
console.log("-----------")
} }
}); });
}, },

@ -52,7 +52,7 @@
</div> </div>
<div class="r"> <div class="r">
<div class="title d-flex"> <div class="title d-flex">
<span class="f_20 c_333">订单号#{{this.model.orderNum}}<span class="line f_16 c_1B">|</span>2022-08-19</span> <span class="f_20 c_333">订单号#{{this.model.orderNum}}<span class="line f_16 c_1B">|</span>{{this.dingdaninfo.createTime}}</span>
<div class="right d-flex f_16"><span>数量</span><span>价格</span><span>总计</span></div> <div class="right d-flex f_16"><span>数量</span><span>价格</span><span>总计</span></div>
</div> </div>
<div class="d-flex orderDiv"> <div class="d-flex orderDiv">
@ -70,19 +70,19 @@
<div class="orderList "> <div class="orderList ">
<div class="item d-flex"> <div class="item d-flex">
<div class="img"> <div class="img">
<img src="../assets/cloth001.png"> <img src="{this.dingdaninfo.defaultPicture}">
</div> </div>
<div class="info"> <div class="info">
<p class="f_14 c_333 headline">商品名商品名商品名商品名商品</p> <p class="f_14 c_333 headline">{{this.dingdaninfo.goodsName}}</p>
<p class="d-flex">款式<span>衬衫</span></p> <p class="d-flex">款式<span>{{this.dingdaninfo.styleNames}}</span></p>
<p class="d-flex">尺码<span>XXL</span></p> <p class="d-flex">尺码<span>{{this.dingdaninfo.modelNumber}}</span></p>
<p class="d-flex">主辅料<span>主料1辅料2辅料3辅料4辅料5辅料6</span></p> <p class="d-flex">主辅料<span>{{this.dingdaninfo.name}},{{this.dingdaninfo.typeName}}</span></p>
</div> </div>
<div class="right d-flex f_14 c_333"> <div class="right d-flex f_14 c_333">
<span>1</span><span>2478</span><span>2478</span> <span>{{this.dingdaninfo.goodsNum}}</span><span>{{this.dingdaninfo.unitPrice}}</span><span>{{this.dingdaninfo.payTotalPrice}}</span>
</div> </div>
</div> </div>
<div class="item d-flex"> <!--<div class="item d-flex">
<div class="img"> <div class="img">
<img src="../assets/cloth001.png"> <img src="../assets/cloth001.png">
</div> </div>
@ -95,24 +95,24 @@
<div class="right d-flex f_14 c_333"> <div class="right d-flex f_14 c_333">
<span>1</span><span>2478</span><span>2478</span> <span>1</span><span>2478</span><span>2478</span>
</div> </div>
</div> </div>-->
</div> </div>
</div> </div>
<div class="heji"> <div class="heji">
<p class="d-flex"> <p class="d-flex">
<span class="leftSide f_20" style="font-weight:500">购买人</span> <span class="leftSide f_20" style="font-weight:500">购买人</span>
<span class="midst f_16">小记</span> <span class="midst f_16">小记</span>
<span class="rightSide f_16" style="font-weight:500">4,956</span> <span class="rightSide f_16" style="font-weight:500">{{this.dingdaninfo.payTotalPrice}}</span>
</p> </p>
<p class="d-flex"> <p class="d-flex">
<span class="leftSide f_18">王贰</span> <span class="leftSide f_18">{{this.dingdaninfo.createBy}}</span>
<span class="midst f_16">运费总计</span> <span class="midst f_16">运费总计</span>
<span class="rightSide f_16" style="font-weight:500">0</span> <span class="rightSide f_16" style="font-weight:500">0</span>
</p> </p>
<p class="d-flex"> <p class="d-flex">
<span class="leftSide"></span> <span class="leftSide"></span>
<span class="midst f_20" style="font-weight:600">总计</span> <span class="midst f_20" style="font-weight:600">总计</span>
<span class="rightSide f_20" style="font-weight:600">4,956</span> <span class="rightSide f_20" style="font-weight:600">{{this.dingdaninfo.payTotalPrice}}</span>
</p> </p>
</div> </div>
</div> </div>
@ -126,6 +126,7 @@
<script> <script>
import Header from "../components/Header/HeaderView"; import Header from "../components/Header/HeaderView";
import Footer from "../components/Footer/FooterView" import Footer from "../components/Footer/FooterView"
import { httpAction, getAction } from '@/api/manage'
export default { export default {
name: "orderDetails", name: "orderDetails",
components: { Header,Footer }, components: { Header,Footer },
@ -135,14 +136,28 @@
model:{ model:{
id:'', id:'',
orderNum:'', orderNum:'',
name:'',
pay:false, pay:false,
receipt:false receipt:false
} },
dingdaninfo:{},
dingdandh:{},
url: {
list: "/starehouse/starehouse/list",
getdingdandh: "/sys/user/getdingdandh",
getdingdaninfo: "/sys/user/getdingdaninfo"
},
}; };
}, },
created() { created() {
this.getallgoods();
this.getdingdandh();
this.model.id = this.$route.query.id this.model.id = this.$route.query.id
this.model.orderNum = this.$route.query.orderNum this.model.orderNum = this.$route.query.orderNum
this.model.name = this.$route.query.name
this.model.pay = JSON.parse(this.$route.query.pay) this.model.pay = JSON.parse(this.$route.query.pay)
this.model.receipt = JSON.parse(this.$route.query.receipt) this.model.receipt = JSON.parse(this.$route.query.receipt)
switch (this.$route.query.key) { switch (this.$route.query.key) {
@ -156,7 +171,47 @@
this.current=6 this.current=6
break; break;
} }
},
methods: {
getdingdandh(){
getAction(this.url.getdingdandh,{ id: this.$route.query.id}).then((res) => {
if(res.success) {
this.dingdandh = res.result;
console.log("=====================")
console.log(res.result)
console.log(this.dingdandh)
console.log("=====================")
this.visible = true;
} else {
console.log("zbc--------------------")
}
});
},
getallgoods(){
getAction(this.url.getdingdaninfo,{ id: this.$route.query.id}).then((res) => {
if(res.success) {
this.dingdaninfo = res.result;
this.visible = true;
} else {
console.log("+++++++++++++++++++++")
}
});
}
}, },
}; };
</script> </script>
<style> <style>

@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
@ -29,6 +30,8 @@ import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.*; import org.jeecg.common.util.*;
import org.jeecg.modules.demo.collecttype.entity.CollectType; import org.jeecg.modules.demo.collecttype.entity.CollectType;
import org.jeecg.modules.demo.collecttype.service.ICollectTypeService; import org.jeecg.modules.demo.collecttype.service.ICollectTypeService;
import org.jeecg.modules.demo.zygoods.entity.ZyGoods;
import org.jeecg.modules.orderbymakeclothplan.service.ZyOrderService;
import org.jeecg.modules.system.entity.*; import org.jeecg.modules.system.entity.*;
import org.jeecg.modules.system.model.DepartIdModel; import org.jeecg.modules.system.model.DepartIdModel;
import org.jeecg.modules.system.model.SysUserSysDepartModel; import org.jeecg.modules.system.model.SysUserSysDepartModel;
@ -60,6 +63,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.jeecg.modules.orderbymakeclothplan.pojo.ZyOrder;
/** /**
* <p> * <p>
@ -73,6 +77,9 @@ import java.util.stream.Collectors;
@RestController @RestController
@RequestMapping("/sys/user") @RequestMapping("/sys/user")
public class SysUserController { public class SysUserController {
@Autowired
private ZyOrderService orderService;
@Autowired @Autowired
private ISysBaseAPI sysBaseAPI; private ISysBaseAPI sysBaseAPI;
@ -1525,8 +1532,8 @@ public class SysUserController {
for (int i=0;i<gr1.size();i++){ for (int i=0;i<gr1.size();i++){
Grzx2 g2 = new Grzx2(); Grzx2 g2 = new Grzx2();
g2.setId(gr1.get(i).getId()); g2.setId(gr1.get(i).getId());
g2.setOrderNum(gr1.get(i).getTotalNum()); g2.setOrderNum(gr1.get(i).getOrdersNum());
g2.setPay("false"); g2.setPay(gr1.get(i).getDeliveryStatus());
g2.setReceipt("false"); g2.setReceipt("false");
g2.setUrl(gr1.get(i).getDefaultPicture()); g2.setUrl(gr1.get(i).getDefaultPicture());
g2.setName(gr1.get(i).getGoodsName()); g2.setName(gr1.get(i).getGoodsName());
@ -1541,10 +1548,31 @@ public class SysUserController {
return Result.ok(gr2); return Result.ok(gr2);
} }
/* public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
Groupx groupx = groupxService.getById(id);
return Result.OK(groupx);
}*/
/*
获取个人中心的订单详情
*/
@RequestMapping(value = "/getdingdaninfo", method = RequestMethod.GET)
public Result<?> findgoods(@RequestParam(name="id",required=true) String id) {
//这个是获取订单的数据中的商品数据
Grzx1 g1 = new Grzx1();
g1 = sysUserService.getallg2(id);
System.out.println(g1);
return Result.ok(g1);
}
/*
获取个人中心的订单详情的物流信息orderService
*/
@RequestMapping(value = "/getdingdandh", method = RequestMethod.GET)
public Result<?> getdingdandh(@RequestParam(name="id",required=true) String id) {
//这个是用于获取一个订单的全部信息
ZyOrder zyo = sysUserService.getallzyo(id);
if(zyo==null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyo);
}
} }

@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.orderbymakeclothplan.pojo.ZyOrder;
import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.entity.SysUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.system.model.SysUserSysDepartModel; import org.jeecg.modules.system.model.SysUserSysDepartModel;
import org.jeecg.modules.system.vo.Grzx1; import org.jeecg.modules.system.vo.Grzx1;
import org.jeecg.modules.system.vo.Grzx2;
import org.jeecg.modules.system.vo.SysUserDepVo; import org.jeecg.modules.system.vo.SysUserDepVo;
import java.util.List; import java.util.List;
@ -155,4 +158,10 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
List<SysUser> queryByDepIds(@Param("departIds") List<String> departIds, @Param("username") String username); List<SysUser> queryByDepIds(@Param("departIds") List<String> departIds, @Param("username") String username);
List<Grzx1> getallgr1(String userid); List<Grzx1> getallgr1(String userid);
//这个是获取订单的数据中的商品数据
Grzx1 getallg2(String id);
@Select("select * from zy_order where id =#{id}")
ZyOrder getallzyo(String id);
} }

@ -166,7 +166,9 @@
<!-- 根据用户名查询 --> <!-- 根据用户名查询 -->
<select id="getallgr1" resultType="org.jeecg.modules.system.vo.Grzx1"> <select id="getallgr1" resultType="org.jeecg.modules.system.vo.Grzx1">
SELECT og.id, zo.total_num , zg.goods_name , zcs.style_names,zsm.model_number,og.goods_num,zf.name,za.type_name,zg.default_picture,og.pay_total_price,og.unit_price FROM zy_order AS zo SELECT og.id, zo.orders_num , zg.goods_name , zcs.style_names,zsm.model_number,og.goods_num,zf.name,za.type_name,zg.default_picture,og.pay_total_price,og.unit_price,og.create_time,og.create_by ,
zo.delivery_status
FROM zy_orders AS zo
INNER JOIN order_goods AS og ON zo.id = og.orders_id INNER JOIN order_goods AS og ON zo.id = og.orders_id
LEFT JOIN zy_goods AS zg ON og.goods_id = zg.id LEFT JOIN zy_goods AS zg ON og.goods_id = zg.id
LEFT JOIN zy_cloths_style AS zcs ON og.style_id = zcs.id LEFT JOIN zy_cloths_style AS zcs ON og.style_id = zcs.id
@ -179,4 +181,21 @@ WHERE og.create_by=#{userid}
</select> </select>
<!-- 这个是获取订单的数据中的商品数据 -->
<select id="getallg2" resultType="org.jeecg.modules.system.vo.Grzx1">
SELECT og.id, zo.orders_num , zg.goods_name , zcs.style_names,zsm.model_number,og.goods_num,zf.name,
za.type_name,zg.default_picture,og.pay_total_price,og.unit_price,og.create_time,og.create_by
FROM zy_orders AS zo
INNER JOIN order_goods AS og ON zo.id = og.orders_id
LEFT JOIN zy_goods AS zg ON og.goods_id = zg.id
LEFT JOIN zy_cloths_style AS zcs ON og.style_id = zcs.id
LEFT JOIN zy_style_model AS zsm ON og.model_id = zsm.id
LEFT JOIN order_goods_fabric AS ogf ON ogf.order_goods_id = og.id
LEFT JOIN zy_fabric AS zf ON ogf.fabric_id = zf.id
LEFT JOIN order_goods_accessories AS oga ON oga.order_goods_id = og.id
LEFT JOIN zy_accessories AS za ON oga.accessories_id = za.id
WHERE og.id=#{id}
</select>
</mapper> </mapper>

@ -7,9 +7,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.vo.SysUserCacheInfo; import org.jeecg.common.system.vo.SysUserCacheInfo;
import org.jeecg.modules.orderbymakeclothplan.pojo.ZyOrder;
import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.model.SysUserSysDepartModel; import org.jeecg.modules.system.model.SysUserSysDepartModel;
import org.jeecg.modules.system.vo.Grzx1; import org.jeecg.modules.system.vo.Grzx1;
import org.jeecg.modules.system.vo.Grzx2;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Collection; import java.util.Collection;
@ -255,4 +257,10 @@ public interface ISysUserService extends IService<SysUser> {
List<String> userIdToUsername(Collection<String> userIdList); List<String> userIdToUsername(Collection<String> userIdList);
List<Grzx1> getallgr1(String userid); List<Grzx1> getallgr1(String userid);
//这个是获取订单的数据中的商品数据
Grzx1 getallg2(String id);
//这个是用于获取一个订单的全部信息
ZyOrder getallzyo(String id);
} }

@ -16,11 +16,13 @@ import org.jeecg.common.util.PasswordUtil;
import org.jeecg.common.util.UUIDGenerator; import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.base.service.BaseCommonService; import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.modules.orderbymakeclothplan.pojo.ZyOrder;
import org.jeecg.modules.system.entity.*; import org.jeecg.modules.system.entity.*;
import org.jeecg.modules.system.mapper.*; import org.jeecg.modules.system.mapper.*;
import org.jeecg.modules.system.model.SysUserSysDepartModel; import org.jeecg.modules.system.model.SysUserSysDepartModel;
import org.jeecg.modules.system.service.ISysUserService; import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.system.vo.Grzx1; import org.jeecg.modules.system.vo.Grzx1;
import org.jeecg.modules.system.vo.Grzx2;
import org.jeecg.modules.system.vo.SysUserDepVo; import org.jeecg.modules.system.vo.SysUserDepVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
@ -548,4 +550,15 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return userMapper.getallgr1(userid); return userMapper.getallgr1(userid);
} }
//这个是获取订单的数据中的商品数据
@Override
public Grzx1 getallg2(String id) {
return userMapper.getallg2(id);
}
@Override
public ZyOrder getallzyo(String id) {
return userMapper.getallzyo(id);
}
} }

@ -8,7 +8,7 @@ public class Grzx1 {
//这个类主要适用于个人中心,主要目的是个人中心的全部订单页面,注意这里不是详情页,是列表的数据获取 //这个类主要适用于个人中心,主要目的是个人中心的全部订单页面,注意这里不是详情页,是列表的数据获取
private String id; private String id;
//订单编号 //订单编号
private String totalNum; private String ordersNum;
//商品名称 //商品名称
private String goodsName; private String goodsName;
//商品款式 //商品款式
@ -28,5 +28,18 @@ public class Grzx1 {
//单价 //单价
private String unitPrice; private String unitPrice;
//创建时间
private String createTime;
//创建人
private String createBy;
//城市
private String cityId;
//地址
private String address;
//邮编
private String zipCode;
//支付状态
private String deliveryStatus;
} }

@ -29,4 +29,5 @@ public class Grzx2 {
private String total; private String total;
} }

Loading…
Cancel
Save