Merge remote-tracking branch 'origin/master' into zhc4dev

zhc4dev
zhc077 2 years ago
commit ccf4d8b388
  1. 301
      ant-design-vue-jeecg/src/views/shopping/components/collection.vue
  2. 208
      ant-design-vue-jeecg/src/views/shopping/pages/gerenzhongxin.vue
  3. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/service/IZyGoodsService.java
  4. 42
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/service/impl/ZyGoodsServiceImpl.java
  5. 157
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/ApeopersionController.java
  6. 23
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java
  7. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserMapper.xml
  8. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysUserService.java
  9. 43
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java

@ -0,0 +1,301 @@
<template>
<div class="collection">
<!-- 收藏列表-->
<div class="d-flex collectList" v-if="collectList1.length != 0">
<div class="item d-flex" v-for="(item,index) in collectList1" :key="index" v-if="index<7">
<img :src="item.defaultPicture">
<div class="title f_14">{{item.goodsName}}</div>
<div class="price f_14">{{item.unitPrice}}</div>
<div class="c_75 f_12">{{item.styleNames}}</div>
<div class="c_75 f_12">{{item.address}}</div>
<div class="c_75 f_12">{{item.ordersNum}}</div>
<a class="button1 f_12">删除</a>
<div class="button2 f_12 c_fff" @click="ingwc(item.id)">加入购物袋</div>
</div>
<div class="more d-flex">
<!--<a class="c_1B f_20">点击进入选款<a-icon type="right" /></a>-->
<router-link class="c_1B f_20" to="/shopping/clothType">点击进入选款</router-link>
<!--<a class="f_14">查看更多收藏</a>-->
</div>
</div>
<!-- 收藏列表没有数据-->
<div class="else" v-if="collectList1.length == 0">
<p class="c_1B f_30">您的衣橱中没有收藏任何商品</p>
<div class="c_fff f_12">前往探索</div>
</div>
<div class="recommending d-flex" v-if="collectList.length == 0">
<div class="item title d-flex">
<p class="f_20">您可能喜欢</p>
<p class="f_14">根据算法推荐</p>
</div>
<div class="item" v-for="(item,index) in recommendList" :key="index" v-if="index<4">
<img :src="item.imgUrl">
<span v-if="!item.flag" class="iconfont icon-weishoucang" @click="shouCang(item)"></span>
<span v-if="item.flag" class="iconfont icon-yishoucang" @click="shouCang(item)"></span>
</div>
</div>
</div>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
export default {
name: "collection",
components: { },
data() {
return {
collectList:[
{
id:1,
imgUrl:require("../assets/cloth001.png"),
title:"商品名商品名商品名商品名商品名",
price:'23500',
size:"款式名",
zhuliao:"主料名",
fuliao:"辅料名",
},
{
id:2,
imgUrl:require("../assets/cloth002.png"),
title:"商品名商品名商品名商品名商品名",
price:'23500',
size:"款式名",
zhuliao:"主料名",
fuliao:"辅料名",
},
{
id:3,
imgUrl:require("../assets/cloth004.png"),
title:"商品名商品名商品名商品名商品名",
price:'23500',
size:"款式名",
zhuliao:"主料名",
fuliao:"辅料名",
},
{
id:4,
imgUrl:require("../assets/cloth003.png"),
title:"商品名商品名商品名商品名商品名",
price:'23500',
size:"款式名",
zhuliao:"主料名",
fuliao:"辅料名",
},
{
id:5,
imgUrl:require("../assets/cloth001.png"),
title:"商品名商品名商品名商品名商品名",
price:'23500',
size:"款式名",
zhuliao:"主料名",
fuliao:"辅料名",
},
{
id:6,
imgUrl:require("../assets/cloth002.png"),
title:"商品名商品名商品名商品名商品名",
price:'23500',
size:"款式名",
zhuliao:"主料名",
fuliao:"辅料名",
},
{
id:7,
imgUrl:require("../assets/cloth004.png"),
title:"商品名商品名商品名商品名商品名",
price:'23500',
size:"款式名",
zhuliao:"主料名",
fuliao:"辅料名",
},
{
id:8,
imgUrl:require("../assets/cloth003.png"),
title:"商品名商品名商品名商品名商品名",
price:'23500',
size:"款式名",
zhuliao:"主料名",
fuliao:"辅料名",
}
],
collectList1:[],
recommendList:[
{
id:1,
imgUrl:require("../assets/cloth003.png"),
flag:false//
},
{
id:2,
imgUrl:require("../assets/cloth002.png"),
flag:false
},
{
id:3,
imgUrl:require("../assets/cloth002.png"),
flag:false
},
{
id:4,
imgUrl:require("../assets/cloth003.png"),
flag:false
},
],
url: {
findallcg: "/getuserpersion/findallcg",
ingwc: "/getuserpersion/ingwc"
},
};
},
created() {
this.findallcg();
},
methods: {
shouCang(item){
console.log(item)
item.flag = !item.flag
},
findallcg(){
getAction(this.url.findallcg).then((res) => {
if(res.success) {
this.collectList1 = res.result;
console.log(res.result)
this.visible = true;
} else {
}
});
},
ingwc(id){
getAction(this.url.ingwc,{id,id}).then((res) => {
if(res.success) {
alert('宝贝已经添加到购物了,请查收');
} else {
}
});
},
},
};
</script>
<style lang="less" scoped>
@import '../assets/common.css';
.collection{
width: 1114px;margin:0 auto;
.collectList{
justify-content: flex-start;
flex-wrap: wrap;
.more{
width: 240px;
flex-direction: column;
align-items: center;
justify-content: center;
.c_1B{
margin-bottom: 12px;
}
.f_14{
color: #666;
}
}
.item{
width: 240px;
flex-direction: column;
align-items: center;
margin-bottom: 100px;
margin-right: 30px;
img{
width: 220px;
height: 220px;
}
.title{
color: #1A1919;
}
.price{
color: #1A1919;
margin-top: 9px;
margin-bottom: 12px;
}
.c_75{
color: #757575;
}
.button1{
margin-top: 10px;
margin-bottom: 24px;
color: #1A1919;
text-decoration: underline;
}
.button2{
background-color: #000;
padding: 8px 16px;
transition: all 0.3s;
&:hover{
opacity: 0.6;
}
}
}
}
.else{
text-align: center;
padding-top: 60px;
margin-bottom: 150px;
.c_fff{
width: 196px;
height: 42px;
line-height: 42px;
background-color: #000;
margin: 0 auto;
transition: all 0.3s;
&:hover{
opacity: 0.8;
}
}
}
.recommending{
border: 1px solid #E7E7E7;
.title{
flex-direction: column;
justify-content: center;
align-items: center;
.f_20{
color: #313131;
}
.f_14{
color: #4B4E4B;
}
}
.item{
position: relative;
width: 300px;
border-right: 1px solid #E7E7E7;
.iconfont{
width: 24px;
height: 24px;
text-align: center;
box-sizing: border-box;
border: 1px dashed #fff;
position: absolute;
transition: all 0.1s;
top: 5%;
right: 5%;
&:hover{
border-color: #999;
}
}
img{
width: 200px;
}
}
}
}
</style>

@ -50,6 +50,79 @@
</a-sub-menu>
</a-menu>
<div class="mall" v-if="current[0] == 'mail'">
<div style="width: 1002px;margin: 0 auto">
<a-form-model
ref="ruleForm"
:model="form"
:rules="rules"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-model-item label="性别" prop="sex">
<!-- <a-select v-model="form.sex" placeholder="请选择性别" >
<a-select-option value="2">
女士
</a-select-option>
<a-select-option value="1">
先生
</a-select-option>
</a-select>-->
<j-dict-select-tag type="list" v-model="form.sex" dictCode="sex" placeholder="请选择性别" />
</a-form-model-item>
<a-form-model-item label="姓名" prop="realname">
<a-input placeholder="请输入姓名" v-model="form.realname" />
</a-form-model-item>
<!-- <a-form-model-item label="地区" prop="desc">
<a-input placeholder="请选择地区" v-model="form.desc" />
</a-form-model-item>-->
<a-form-model-item label="电话" prop="phone">
<a-input placeholder="请输入电话" v-model="form.phone" />
</a-form-model-item>
<a-form-model-item label="出生日期" required prop="birthday">
<a-date-picker
v-model="form.birthday"
show-time
type="date"
placeholder="请选择出生日期"
style="width: 100%;"
/>
</a-form-model-item>
<a-form-model-item label="电子邮箱" prop="email">
<a-input placeholder="请输入电子邮箱" v-model="form.email" />
</a-form-model-item>
<a-form-model-item label="1" prop="type">
<a-checkbox value="1" name="type">
我已阅读并同意黄淮服装定制商城的销售条款和个人信息处理规则
</a-checkbox>
<a-checkbox value="2" name="type">
我同意按照个人信息处理规则告知的内容跨境提供本人的个人信息
</a-checkbox>
</a-form-model-item>
</a-form-model>
<div class="d-flex btnDiv">
<div type="primary" style="width: 100%;margin-bottom: 10px" class="dialogButton primary f_12" @click="handuser()">修改信息</div>
</div>
<a @click="handleChangePassword(form.username)" class="xgmm"> 更改密码?</a>
<!-- <a-modal v-model="visible1" title="更改密码" @ok="handleOk" @cancel="handleCancel">
<a-form-model
ref="ruleForm1"
:model="form1"
:rules="rules"
>
<a-form-model-item label="当前密码" prop="desc">
<a-input placeholder="请输入当前密码" v-model="form.desc" />
</a-form-model-item>
<a-form-model-item label="新密码" prop="desc">
<a-input placeholder="请输入新密码" v-model="form.desc" />
</a-form-model-item>
</a-form-model>
</a-modal>-->
</div>
</div>
<Collection v-if="current[0] == 'collect'"></Collection>
<div class="orderList" >
<div class="item" v-for="(item,index) in allOrders" :key="index">
<div class="top d-flex">
@ -84,8 +157,10 @@
</div>
</div>
</div>
<password-modal ref="passwordmodal" @ok="passwordModalOk"></password-modal>
<Footer></Footer>
</div>
</template>
<script>
import Header from "../components/Header/HeaderView";
@ -93,9 +168,11 @@
import {mapGetters} from 'vuex'
import { getFileAccessHttpUrl} from "@/api/manage"
import { httpAction, getAction } from '@/api/manage'
import PasswordModal from '../../system/modules/PasswordModal'
import Collection from "../components/collection";
export default {
name: "gerenzhongxin",
components: { Header,Footer },
components: { Header,Footer,PasswordModal ,Collection},
data() {0
return {
model:{
@ -155,10 +232,56 @@
url: {
list: "/starehouse/starehouse/list",
getusername: "/sys/user/getusername",
findgoods: "/sys/user/findgoods"
findgoods: "/sys/user/findgoods",
getneeduser: "/getuserpersion/getneeduser",
updateneeduser: "/getuserpersion/updateneeduser",
},
labelCol: { span: 3 },
wrapperCol: { span: 21 },
other: '',
/*form: {
realname: '',
sex: '',
birthday: '',
email: '',
phone: '',
type: [],
resource: '',
desc: '',
},*/
form: {
},
form1: {
name: '',
region: undefined,
date1: undefined,
delivery: false,
type: [],
resource: '',
desc: '',
},
rules: {
/*name: [
{ required: true, message: 'Please input Activity name', trigger: 'blur' },
{ min: 3, max: 5, message: 'Length should be 3 to 5', trigger: 'blur' },
],
region: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
date1: [{ required: true, message: 'Please pick a date', trigger: 'change' }],*/
type: [
{
type: 'array',
required: true,
message: '请选择',
trigger: 'change',
},
],
/*resource: [
{ required: true, message: 'Please select activity resource', trigger: 'change' },
],
desc: [{ required: true, message: 'Please input activity form', trigger: 'blur' }],*/
},
visible1: false,
};
},
@ -166,6 +289,7 @@
created() {
this.getusername();
this.getallgoods();
this.getneeduser();
},
mounted() {
@ -175,6 +299,32 @@
}
},
methods: {
passwordModalOk() {
//TODO datasource
},
handleCancel(e) {
this.visible1 = false;
},
handleChangePassword(username) {
this.$refs.passwordmodal.show(username);
},
handleOk(e) {
console.log(e);
this.visible1 = false;
},
onSubmit() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
alert('submit!');
} else {
console.log('error submit!!');
return false;
}
});
},
resetForm() {
this.$refs.ruleForm.resetFields();
},
getallgoods(){
getAction(this.url.findgoods).then((res) => {
if(res.success) {
@ -188,12 +338,31 @@
getAction(this.url.getusername).then((res) => {
if(res.success) {
this.model.username1 = res.result;
console.log(res.message)
this.visible = true;
} else {
}
});
},
getneeduser(){
getAction(this.url.getneeduser).then((res) => {
if(res.success) {
this.form = res.result;
this.visible = true;
} else {
}
});
},
handuser(){
getAction(this.url.updateneeduser,{form: JSON.stringify(this.form)}).then((res) => {
if(res.success) {
console.log("-----------------------")
this.loadData(1);
} else {
}
});
},
...mapGetters(["nickname", "avatar", "userInfo", "addRouters", "username", "permissionList"]),
//
getAvatar(){
@ -258,6 +427,24 @@
</script>
<style lang="less" scoped>
@import '../assets/common.css';
.btnDiv{
justify-content: space-around;
.dialogButton {
width: 240px;
height: 40px;
text-align: center;
line-height: 40px;
transition: all 0.2s;
}
.primary {
background: #1b1b1b;
border: 2px solid #1b1b1b;
color: #e5dfd9;
&:hover {
opacity: 0.8;
}
}
}
.bg{
width: 100%;
height: 250px;
@ -359,5 +546,18 @@
}
}
}
.mall{
padding: 50px 100px;
.ant-checkbox-wrapper + .ant-checkbox-wrapper{
margin-left: 0;
}
.xgmm{
color: #1b1b1b;
transition: all 0.32s;
&:hover{
opacity: 0.8;
}
}
}
</style>

@ -1,5 +1,6 @@
package org.jeecg.modules.demo.zygoods.service;
import org.jeecg.modules.demo.ordergoods.entity.OrderGoodsJk;
import org.jeecg.modules.demo.zygoods.entity.ZyGoods;
import com.baomidou.mybatisplus.extension.service.IService;
@ -13,5 +14,7 @@ import java.util.List;
*/
public interface IZyGoodsService extends IService<ZyGoods> {
public List<ZyGoods> selectByMainId(String mainId);
//随机获取商品
List<OrderGoodsJk> SJgetOrder();
}

@ -1,5 +1,7 @@
package org.jeecg.modules.demo.zygoods.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.modules.demo.ordergoods.entity.OrderGoodsJk;
import org.jeecg.modules.demo.zygoods.entity.ZyGoods;
import org.jeecg.modules.demo.zygoods.mapper.ZyGoodsMapper;
import org.jeecg.modules.demo.zygoods.service.IZyGoodsService;
@ -8,6 +10,7 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.ArrayList;
import java.util.List;
/**
@ -26,4 +29,43 @@ public class ZyGoodsServiceImpl extends ServiceImpl<ZyGoodsMapper, ZyGoods> impl
return zyGoodsMapper.selectByMainId(mainId);
}
/**
* 随机获取商品
* @return
*/
@Override
public List<OrderGoodsJk> SJgetOrder() {
List<OrderGoodsJk> orderGoodsJkList = new ArrayList<>();
QueryWrapper<ZyGoods> wrapper = new QueryWrapper<>();
List<ZyGoods> goodsList = baseMapper.selectList(wrapper);
if(goodsList.size()>10){
//随机取商品数(1-5)个
int number = (int)(Math.random()*5)+1;
for(int i = 0 ; i < number ; i++){
//goodsList的随机下标数
int numberxb = (int)(Math.random()*goodsList.size());
//随机取商品数量(1-5)个
int numbersl = (int)(Math.random()*5)+1;
OrderGoodsJk orderGoodsJk = new OrderGoodsJk();
orderGoodsJk.setGoodsId(goodsList.get(numberxb).getId());
orderGoodsJk.setGoodsNum(numbersl);
orderGoodsJkList.add(orderGoodsJk);
}
}else{
if(goodsList.size()>0){
//goodsList的随机下标数
int numberxb1 = (int)(Math.random()*goodsList.size());
//随机取商品数量(1-5)个
int numbersl = (int)(Math.random()*5)+1;
OrderGoodsJk orderGoodsJk = new OrderGoodsJk();
orderGoodsJk.setGoodsId(goodsList.get(numberxb1).getId());
orderGoodsJk.setGoodsNum(numbersl);
orderGoodsJkList.add(orderGoodsJk);
}
}
return orderGoodsJkList;
}
}

@ -0,0 +1,157 @@
package org.jeecg.modules.system.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Joiner;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.aspectj.apache.bcel.generic.RET;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.modules.demo.customercollectgoods.entity.Customercollectgoods;
import org.jeecg.modules.demo.customercollectgoods.service.ICustomercollectgoodsService;
import org.jeecg.modules.demo.customershoppingcart.entity.CustomerShoppingCart;
import org.jeecg.modules.demo.customershoppingcart.service.ICustomerShoppingCartService;
import org.jeecg.modules.demo.zygoods.entity.ZyGoods;
import org.jeecg.modules.demo.zygoods.service.IZyGoodsService;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.system.vo.Grzx1;
import org.jeecg.modules.system.vo.Grzx2;
import org.jeecg.modules.system.vo.Grzx3;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.lang.reflect.Field;
import java.util.*;
import java.util.stream.Collectors;
/*
这个是个人中心专用控制器之前全都写在SysUserController用户控制器里面感觉不妥因此就专门拖出来一个
*/
@Slf4j
@RestController
@RequestMapping("/getuserpersion")
public class ApeopersionController {
@Autowired
private ISysUserService sysUserService;
@Autowired
private ICustomercollectgoodsService customercollectgoodsService;
@Autowired
private IZyGoodsService zyGoodsService;
@Autowired
private ICustomerShoppingCartService customerShoppingCartService;
/*
个人中心我的账户的数据获取
*/
@RequestMapping(value = "/getneeduser", method = RequestMethod.GET)
public Result<?> getdingdandh() {
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String id = loginUser.getId();
SysUser syu = new SysUser();
syu = sysUserService.getneeduser(id);
findgoods();
return Result.ok(syu);
}
//个人中心的我的账户页面需要的数据
@RequestMapping(value = "/updateneeduser", method = RequestMethod.GET)
public Result<?> updateneeduser(@RequestParam(name = "form", required = true) String form) {
Map map = JSON.parseObject(form,Map.class);
String id = (String) map.get("id");
String sex= map.get("sex").toString();
String birthday= (String) map.get("birthday");
String realname= (String) map.get("realname");
String phone= (String) map.get("phone");
String email= (String) map.get("email");
sysUserService.updateneed(id,sex,birthday,realname,phone,email);
return Result.ok("success");
}
//个人中心的我的收藏的首页需要的数据
@RequestMapping(value = "/findallcg", method = RequestMethod.GET)
public Result<?> findgoods() {
//获取当前登人的信息
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String userid = loginUser.getUsername();
List<Grzx1> g3 = new ArrayList<>();
//根据当前登的人获取收藏夹里面的搜藏的商品的名称及其款式
g3 = sysUserService.getscgoods(userid);
//获取的是辅料
List<String> s1 =new ArrayList<>();
//获取的是面料
List<String> s2 =new ArrayList<>();
//把获取的商品信息导入到新的list里面
for (int i=0;i<g3.size();i++){
if (g3.get(i)!=null) {
s1=sysUserService.getscgoodfi(g3.get(i).getId());
s2=sysUserService.getscgoodml(g3.get(i).getId());
g3.get(i).setOrdersNum(s2.toString());
if(s2.get(0)==null){
}else {
if (s2.size()==1){
g3.get(i).setAddress(s2.get(0).toString().replace("[","").replace("]",""));
} else{
g3.get(i).setAddress(StringUtils.join(s2, ","));
}
}
if(s1.get(0)==null){
}else {
if (s1.size()==1){
g3.get(i).setOrdersNum(s1.get(0).toString().replace("[","").replace("]",""));
} else{
g3.get(i).setOrdersNum(StringUtils.join(s1, ","));
}
}
}
}
return Result.ok(g3);
}
//个人中心的我的收藏的首页需要的数据
@RequestMapping(value = "/ingwc", method = RequestMethod.GET)
public Result<?> findgoods(@RequestParam(name = "id", required = true) String id) {
//这里方便获取当前登陆信息
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//这里获取当前登陆的id
String userid = loginUser.getId();
//这里获取当前登陆的真实姓名
String rlname = loginUser.getRealname();
//这个是根据goodid查询收藏的场频的信息
Customercollectgoods ccs = customercollectgoodsService.getById(id);
String goodid= ccs.getGoodsId();
//根据goodid查询goods的对象
ZyGoods zyd =zyGoodsService.getById(goodid);
//初始化购物车对象
CustomerShoppingCart cst =new CustomerShoppingCart();
//开始组装购物车对象
cst.setUserId(userid);
cst.setUsername(rlname);
cst.setGoodsId(zyd.getId());
cst.setGoodsname(zyd.getGoodsName());
cst.setNumber(1);
cst.setPrice(zyd.getPromotionPrice());
cst.setZj(zyd.getPromotionPrice() * 1);
cst.setPlaceorigin(zyd.getPlaceOrigin());
cst.setGoodimg(zyd.getDefaultPicture());
cst.setStyleId(zyd.getStyleId());
customerShoppingCartService.save(cst);
return Result.ok("添加完成");
}
}

@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.jeecg.modules.orderbymakeclothplan.pojo.ZyOrder;
import org.jeecg.modules.system.entity.SysUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.system.model.SysUserSysDepartModel;
import org.jeecg.modules.system.vo.Grzx1;
import org.jeecg.modules.system.vo.Grzx2;
import org.jeecg.modules.system.vo.Grzx3;
import org.jeecg.modules.system.vo.SysUserDepVo;
import java.util.List;
@ -164,4 +166,25 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
@Select("select * from zy_order where id =#{id}")
ZyOrder getallzyo(String id);
//这个是根据roleid查询用户id
@Select("select user_id from sys_user_role where role_id =#{roleid}")
List<String> getuserids(String roleid);
//根据id获取用户
@Select("select * from sys_user where id=#{needid}")
SysUser getneeduser(String needid);
//个人中心我的账户修改个人信息
@Update("UPDATE sys_user SET realname = #{realname},sex=#{sex},birthday=#{birthday},phone=#{phone},email=#{email} WHERE id = #{id} ")
void updateneed(String id, String sex, String birthday, String realname, String phone, String email);
List<Grzx1> getscgoods(String userid);
@Select("SELECT zf.name FROM customercollectgoods AS crg LEFT JOIN goods_fabric AS gf ON crg.goods_id = gf.goods_id LEFT JOIN zy_fabric AS zf ON gf.fabric_id = zf.id WHERE crg.id=#{id}")
List<String> getscgoodml(String id);
@Select("SELECT za.contents FROM customercollectgoods AS crg LEFT JOIN goods_accessories AS ga ON crg.goods_id = ga.goods_id LEFT JOIN zy_accessories AS za ON ga.accessories_id = za.id where crg.id=#{id}")
List<String> getscgoodfi(String id);
}

@ -198,4 +198,14 @@ WHERE og.id=#{id}
</select>
<!-- 这个是获取订单的数据中的商品数据 -->
<select id="getscgoods" resultType="org.jeecg.modules.system.vo.Grzx1">
SELECT crg.id,zgs.goods_name,zcs.style_names,zgs.default_picture,zgs.unit_price FROM customercollectgoods AS crg
LEFT JOIN zy_goods AS zgs ON crg.goods_id = zgs.id
LEFT JOIN zy_cloths_style AS zcs ON zgs.style_id = zcs.id
WHERE crg.create_by=#{userid}
</select>
</mapper>

@ -12,6 +12,7 @@ import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.model.SysUserSysDepartModel;
import org.jeecg.modules.system.vo.Grzx1;
import org.jeecg.modules.system.vo.Grzx2;
import org.jeecg.modules.system.vo.Grzx3;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collection;
@ -263,4 +264,20 @@ public interface ISysUserService extends IService<SysUser> {
//这个是用于获取一个订单的全部信息
ZyOrder getallzyo(String id);
//这里是产生一个随机虚拟用户,用于虚拟下单
SysUser getuser();
SysUser getneeduser(String id);
void updateneed(String id, String sex, String birthday, String realname, String phone, String email);
//此处用于个人中心获取收藏商品的信息
List<Grzx1> getscgoods(String userid);
//此处用于个人中心获取收藏商品的面料
List<String> getscgoodml(String id);
//此处用于个人中心获取收藏商品的辅料
List<String> getscgoodfi(String id);
}

@ -23,6 +23,7 @@ import org.jeecg.modules.system.model.SysUserSysDepartModel;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.system.vo.Grzx1;
import org.jeecg.modules.system.vo.Grzx2;
import org.jeecg.modules.system.vo.Grzx3;
import org.jeecg.modules.system.vo.SysUserDepVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
@ -561,4 +562,46 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return userMapper.getallzyo(id);
}
//这个是获取一个虚拟用户的对象
@Override
public SysUser getuser() {
//虚拟角色id
String roleid="1630020854744330241";
//根据角色id查询用户id
List<String> uids = new ArrayList<>();
//获取用户id的合集
uids = userMapper.getuserids(roleid);
Random random = new Random();
int n = random.nextInt(uids.size());
String needid = uids.get(n);
SysUser sysUser = new SysUser();
sysUser = userMapper.getneeduser(needid);
return sysUser;
}
@Override
public SysUser getneeduser(String id) {
return userMapper.getneeduser(id);
}
@Override
public void updateneed(String id, String sex, String birthday, String realname, String phone, String email) {
userMapper.updateneed(id,sex,birthday,realname,phone,email);
}
@Override
public List<Grzx1> getscgoods(String userid) {
return userMapper.getscgoods(userid);
}
@Override
public List<String> getscgoodml(String id) {
return userMapper.getscgoodml(id);
}
@Override
public List<String> getscgoodfi(String id) {
return userMapper.getscgoodfi(id);
}
}

Loading…
Cancel
Save