喻忠伟 2 years ago
commit 310a6d9339
  1. 4
      ant-design-vue-jeecg/src/views/shopping/assets/common.css
  2. BIN
      ant-design-vue-jeecg/src/views/shopping/assets/erweima.png
  3. 445
      ant-design-vue-jeecg/src/views/shopping/components/addrView.vue
  4. 320
      ant-design-vue-jeecg/src/views/shopping/components/collection.vue
  5. 165
      ant-design-vue-jeecg/src/views/shopping/pages/gerenzhongxin.vue
  6. 19
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/mapper/CustomerReceivingAddressMapper.java
  7. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/service/ICustomerReceivingAddressService.java
  8. 37
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/service/impl/CustomerReceivingAddressServiceImpl.java
  9. 14
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanAutoController.java
  10. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyProductPlanAutoService.java
  11. 167
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java
  12. 244
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/ApeopersionController.java
  13. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java
  14. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserMapper.xml
  15. 7
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysUserService.java
  16. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java

@ -71,7 +71,9 @@ a {
.fw_600 { .fw_600 {
font-weight: 600; font-weight: 600;
} }
.fw_500 {
font-weight: 500;
}
.c_333 { .c_333 {
color: #333; color: #333;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

@ -0,0 +1,445 @@
<template>
<div class="addrView">
<div class="weizhuce d-flex" v-if="addrList1.length == 0">
<p class="c_1B f_30"> 您还未注册地址</p>
</div>
<div class="d-flex btnDiv">
<div type="primary" class="dialogButton primary f_12" @click="addAddr">创建新地址</div>
</div>
<div class="addrList" v-if="addrList1.length != 0">
<div class="item" v-for="(item,index) in addrList1" :key="index">
<p class="default" v-if="item.sort==0"><span class="f_12">默认地址</span></p>
<div class="d-flex">
<div><span>{{item.usernamme}}</span><span v-if="item.sysOrgCode == 2">女士</span><span v-if="item.sysOrgCode == 1">先生</span></div>
<div class="btnDiv">
<span class="btn" @click="handleEdit(item)">编辑</span>
<a-popconfirm
title="确定删除吗?"
ok-text="Yes"
cancel-text="No"
@confirm="confirm1(item.id)"
@cancel="cancel"
><span class="btn">删除</span></a-popconfirm>
<a-popconfirm
title="确定将其设置为默认地址吗?"
ok-text="Yes"
cancel-text="No"
@confirm="confirm2(item.id)"
@cancel="cancel"
v-if="!item.sort==0"
><span class="btn">将其设置为默认地址</span></a-popconfirm>
<!-- <span class="btn" v-if="!item.flag" @click="handleDefault(item.id)">将其设置为默认地址</span>-->
</div>
</div>
<p>
{{item.address}}
</p>
<p><j-area-linkage disabled type="cascader" v-model="item.cityId" placeholder="请选择省市区"/></p>
</div>
</div>
<a-modal
title="地址操作"
:visible="visible"
:width="800"
>
<template slot="footer">
<a-button key="back" @click="handleCancel">
取消
</a-button>
<a-button key="submit" type="primary" @click="handleOk">
确定
</a-button>
</template>
<template>
<a-form-model
ref="ruleForm"
:model="form"
:rules="rules"
:label-col="labelCol" :wrapper-col="wrapperCol"
class="modelForm"
>
<a-form-model-item label="称呼" >
<a-select v-model="form.sex" placeholder="请选择称呼">
<a-select-option value="1">
女士
</a-select-option>
<a-select-option value="2">
先生
</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item
label="姓名"
prop="name"
>
<a-input placeholder="请输入姓名" v-model="form.name" />
</a-form-model-item>
<a-form-model-item
label="选择地址"
prop="addr"
>
<j-area-linkage type="cascader" v-model="form.addr" placeholder="请选择省市区"/>
</a-form-model-item>
<a-form-model-item
label="手机号码"
prop="phone"
>
<a-input placeholder="请输入手机号码" v-model="form.phone">
<template slot="addonBefore">
<span>+86 中国大陆地区</span>
</template>
</a-input>
</a-form-model-item>
<a-form-model-item label="详细地址" prop="detailed">
<a-input v-model="form.detailed" type="textarea" />
</a-form-model-item>
<a-form-model-item>
<a-checkbox @change="onChange" :checked="form.flag">
设置为默认地址
</a-checkbox>
</a-form-model-item>
</a-form-model>
</template>
</a-modal>
</div>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { deleteAction } from '@/api/manage'
import {mapGetters} from 'vuex'
export default {
name: "addrView",
components: { },
data() {
return {
visible: false,
flag:'',//addedit
copyItem:{},//
labelCol: { span: 4 },
wrapperCol: { span: 20 },
addrList1:[],
addrList:[
{
id:1,
name:'吴一',
sex:'1',
phone:'17777777777',
addr:'210521',
detailed:'黄淮学院北区',
flag:true,//
},//
{
id:2,
name:'吴二',
sex:'2',
phone:'17777777777',
addr:'210521',
detailed:'黄淮学院北区',
flag:false,//
},//
{
id:3,
name:'吴三',
sex:'1',
phone:'17777777777',
addr:'210521',
detailed:'黄淮学院北区',
flag:false,//
},//
],//
addrList1:[],
addr1:'210521',
//
form: {
id:'',
sex: undefined,
name: '',
addr: '',
detailed: '',
phone: '',
flag:false//
},
rules: {
name: [
{ required: true, message: '请输入姓名', trigger: 'blur' },
],
visit: [
{ required: true, message: '请选择您的配送方式', trigger: 'change' },
],
addr: [{ required: true, message: '请选择地址', trigger: 'blur' }],
detailed: [{ required: true, message: '请输入详细地址', trigger: 'blur' }],
phone: [{ required: true, message: '请输入手机号码', trigger: 'blur' },
],
},
url: {
getaddress: "/getuserpersion/getaddress",
deleteadd: "/getuserpersion/deleteadd",
sdqx: "/getuserpersion/sdqx",
addadressress: "/getuserpersion/addadressress",
updateadressress: "/getuserpersion/updateadressress"
},
};
},
created() {
this.getaddress();
},
methods: {
...mapGetters(["nickname", "avatar","userInfo"]),
reload() {
this.isReload = false
this.$nextTick(() => {
this.isReload = true
})
},
getaddress(){
getAction(this.url.getaddress).then((res) => {
if(res.success) {
this.addrList1= res.result;
} else {
}
});
},
addAddr(){
this.visible = true
this.flag = 'add'
},
changeDefault(){
this.addrList.forEach(obj =>{
if(obj.flag){
obj.flag = !obj.flag
}
})
},
clearForm(){
this.form = {
id:'',
sex: undefined,
name: '',
addr: '',
detailed: '',
phone: '',
flag:false//
}
},
handleOk(e) {
//
let that = this
this.$refs.ruleForm.validate(valid => {
if (valid) {//
if(this.flag == 'add') {//
if(this.form.flag){//
this.changeDefault()
this.addrList.unshift(this.form)
//
getAction(this.url.addadressress,{form : JSON.stringify(this.form)}).then((res) => {
if(res.success) {
this.$router.go(0)
} else {
}
});
}else{//
this.addrList.push(this.form)
console.log(this.userInfo())
//
getAction(this.url.addadressress,{form : JSON.stringify(this.form)}).then((res) => {
if(res.success) {
this.$router.go(0)
} else {
}
});
}
}else if(this.flag == 'edit'){
//
//
let itemIndex3 = this.addrList.findIndex(item =>item.id == this.form.id)
if(this.form.flag){//
this.changeDefault()
this.form.flag = true
this.addrList[itemIndex3] = this.form
/* console.log("this.addrList2")
console.log(this.addrList)*/
console.log(this.form)
getAction(this.url.updateadressress,{form : JSON.stringify(this.form)}).then((res) => {
if(res.success) {
this.$router.go(0)
} else {
}
});
}else{
this.addrList[itemIndex3] = this.form
getAction(this.url.updateadressress,{form : JSON.stringify(this.form)}).then((res) => {
if(res.success) {
this.$router.go(0)
} else {
}
});
console.log(this.form)
}
}
//
this.clearForm()
this.flag = ''
this.visible = false;
} else {}
});
},
handleCancel() {
this.visible = false;
if(this.flag == 'edit'){
let itemIndex4 = this.addrList.findIndex(item =>item.id == this.form.id)
this.addrList[itemIndex4] = this.copyItem
}
this.clearForm()
this.flag = ''
},
onChange(e) {
this.form.flag = e.target.checked
},
handleEdit(item){
this.copyItem = JSON.parse(JSON.stringify(item));
this.visible = true
this.flag = 'edit'
this.form = item
},
confirm1(id) {
/*这个是删除功能*/
console.log(id)
deleteAction(this.url.deleteadd,{id,id}).then((res) => {
if(res.success) {
this.$router.go(0)
} else {
}
});
},
confirm2(id) {
console.log(id)
getAction(this.url.sdqx,{id,id}).then((res) => {
if(res.success) {
this.$router.go(0)
} else {
}
});
},
cancel(e) {
this.$message.warning('已取消');
},
},
};
</script>
<style lang="less" scoped>
@import '../assets/common.css';
.modelForm{
padding:20px 100px;
}
.addrList .j-area-linkage /deep/ .area-select{
background-color: #fff;
border: none;
span{
padding-left: 0;
font-size: 12px;
color:#313131;
cursor:auto;
font-weight: 500;
}
i{
display: none;
}
}
.btnDiv{
justify-content: center;
.dialogButton {
width: 300px;
height: 42px;
text-align: center;
line-height: 42px;
transition: all 0.2s;
}
.primary {
background: #1b1b1b;
border: 2px solid #1b1b1b;
color: #e5dfd9;
&:hover {
opacity: 0.8;
}
}
}
.addrView{
width: 1114px;
margin:0 auto;
padding-top: 50px;
.weizhuce{
text-align: center;
flex-direction: column;
justify-content: center;
align-items: center;
p{
width: 300px;
}
}
.addrList{
width: 800px;
margin: 0 auto;
.item{
padding-top: 40px;
border-bottom: 1px solid #DADADA;
color: #1A1919;
p{
font-size: 12px;
}
.default{
span{
display: inline-block;
padding: 4px 12px;
box-sizing: content-box;
background: #F8F8F8;
width: 72px;
height: 21px;
text-align: center;
line-height: 21px;
}
}
.d-flex{
justify-content: space-between;
font-size: 14px;
.btnDiv{
.btn{
cursor: pointer;
}
}
.btn{
text-decoration: underline;
margin-right: 20px;
}
div:first-child{
margin-bottom: 12px;
}
}
}
}
}
</style>

@ -0,0 +1,320 @@
<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>-->
<a-popconfirm class="button1 f_12" title="确定删除吗?" @confirm="() => delteys(item.id)">
<a>删除</a>
</a-popconfirm>
<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",
delteys: "/getuserpersion/delteys"
},
};
},
created() {
this.findallcg();
},
methods: {
shouCang(item){
console.log(item)
item.flag = !item.flag
},
delteys(id){
getAction(this.url.delteys,{id,id}).then((res) => {
if(res.success) {
this.loadData(1);
} else {
}
});
},
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('宝贝已经添加到购物了,请查收');
this.loadData(1);
} 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>

@ -18,16 +18,16 @@
<span slot="title" class="submenu-title-wrapper">发票管理<a-icon type="down" /></span> <span slot="title" class="submenu-title-wrapper">发票管理<a-icon type="down" /></span>
<a-menu-item key="invoice1"> <a-menu-item key="invoice1">
Option 1 全部发票
</a-menu-item> </a-menu-item>
<a-menu-item key="invoice2"> <a-menu-item key="invoice2">
Option 2 已开发票
</a-menu-item> </a-menu-item>
<a-menu-item key="invoice3"> <a-menu-item key="invoice3">
Option 3 待开发票
</a-menu-item> </a-menu-item>
<a-menu-item key="invoice4"> <a-menu-item key="invoice4">
Option 4 抬头管理
</a-menu-item> </a-menu-item>
</a-sub-menu> </a-sub-menu>
<a-sub-menu> <a-sub-menu>
@ -122,6 +122,37 @@
</a-modal>--> </a-modal>-->
</div> </div>
</div> </div>
<Collection v-if="current[0] == 'collect'"></Collection>
<AddrView v-if="current[0] == 'addr'"></AddrView>
<div class="invoiceList">
<!-- 发票管理-->
<div class="invoice" v-for="(item,index) in invoiceList" :key="index">
<div class="d-flex title">
<span class="c_333 f_16">{{item.date}}</span>
<span class="font_01" v-if="item.billing">已开票</span>
<span class="font_01" v-if="!item.billing">待开票</span>
</div>
<div class="d-flex">
<div class="img">
<img :src="item.imgUrl"/>
</div>
<div class="invoiceInfo">
<div class="font_01">订单编号{{item.orderNum}}</div>
<div class="font_02">发票类型{{item.type}}</div>
<div class="font_02">发票内容{{item.content}}</div>
<div class="font_02">发票抬头{{item.title}}</div>
<div class="font_02">开票金额{{item.price}}</div>
</div>
<div class="btnDiv d-flex">
<div class="dialogButton primary">申请换开</div>
<div class="dialogButton default">查看详情</div>
</div>
</div>
</div>
<!-- 发票抬头管理-->
<div class="invoice"></div>
</div>
<div class="orderList" > <div class="orderList" >
<div class="item" v-for="(item,index) in allOrders" :key="index"> <div class="item" v-for="(item,index) in allOrders" :key="index">
<div class="top d-flex"> <div class="top d-flex">
@ -168,16 +199,17 @@
import { getFileAccessHttpUrl} from "@/api/manage" import { getFileAccessHttpUrl} from "@/api/manage"
import { httpAction, getAction } from '@/api/manage' import { httpAction, getAction } from '@/api/manage'
import PasswordModal from '../../system/modules/PasswordModal' import PasswordModal from '../../system/modules/PasswordModal'
import Collection from "../components/collection";
import AddrView from "../components/addrView"
export default { export default {
name: "gerenzhongxin", name: "gerenzhongxin",
components: { Header,Footer,PasswordModal }, components: { Header,Footer,PasswordModal ,Collection,AddrView},
data() {0 data() {
return { return {
model:{ model:{
username1: "" username1: ""
}, },
current: ['invoice1'],//
current: ['allorders'],//
key:'',// key:'',//
allOrders2:[], allOrders2:[],
allOrders1:[ allOrders1:[
@ -225,7 +257,42 @@
} }
],// ],//
allOrders:[],// allOrders:[],//
invoiceList:[],//
invoiceList1:[
{
id:1,
date:'2022-08-19 14:09:13',
billing:true,//
imgUrl:require("../assets/cloth001.png"),
orderNum:1237943879,//
type:"1",//1
content:"商品明细",//
title:"易创网络科技有限公司",//
price:2456,//
},
{
id:2,
date:'2022-08-20 14:09:13',
billing:false,//
imgUrl:require("../assets/cloth002.png"),
orderNum:1237943880,//
type:"1",//1
content:"商品明细",//
title:"易创网络科技有限公司",//
price:2456,//
},
{
id:3,
date:'2022-08-30 14:09:13',
billing:true,//
imgUrl:require("../assets/cloth003.png"),
orderNum:1237943881,//
type:"1",//1
content:"商品明细",//
title:"易创网络科技有限公司",//
price:2456,//
},
],//
url: { url: {
list: "/starehouse/starehouse/list", list: "/starehouse/starehouse/list",
@ -416,9 +483,18 @@
else if(key.key == 'yiwancheng'){ else if(key.key == 'yiwancheng'){
/*this.allOrders = this.allOrders1.filter(item=>item.receipt == true)*/ /*this.allOrders = this.allOrders1.filter(item=>item.receipt == true)*/
this.allOrders = this.allOrders2.filter(item=>item.receipt == true) this.allOrders = this.allOrders2.filter(item=>item.receipt == true)
}else{ }else if(key.key == 'invoice1'){//
this.allOrders=[] this.invoiceList = this.invoiceList1
} }
else if(key.key == 'invoice2'){//
this.invoiceList = this.invoiceList1.filter(item=>item.billing == true)
}
else if(key.key == 'invoice3'){//
this.invoiceList = this.invoiceList1.filter(item=>item.billing == false)
}
// else{
// this.allOrders=[]
// }
} }
}, },
}; };
@ -434,6 +510,18 @@
line-height: 40px; line-height: 40px;
transition: all 0.2s; transition: all 0.2s;
} }
.default {
border: 2px solid #1b1b1b;
color: #1b1b1b;
margin-right: 20px;
&:hover {
border: 2px solid #1b1b1b;
color: #fff;
opacity: 0.8;
background-color: #1b1b1b;
}
}
.primary { .primary {
background: #1b1b1b; background: #1b1b1b;
border: 2px solid #1b1b1b; border: 2px solid #1b1b1b;
@ -443,6 +531,15 @@
} }
} }
} }
.font_01{
color: #333;
font-size: 16px;
font-weight: 500;
}
.font_02{
color: #333;
font-size: 16px;
}
.bg{ .bg{
width: 100%; width: 100%;
height: 250px; height: 250px;
@ -470,6 +567,52 @@
/deep/ .ant-menu{ /deep/ .ant-menu{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
}
.invoiceList{
padding-left: 20px;
padding-right: 20px;
width: 1114px;margin:0 auto;
.d-flex{
justify-content: space-between;
}
.invoice{
padding-top: 40px;
padding-bottom: 20px;
border-bottom: 1px solid #DADADA;
.title{
margin-bottom: 25px;
}
.img{
width: 232px;
height: 232px;
img{
width: 232px;
height: 232px;
}
}
.invoiceInfo{
width: 483px;
.font_01{
margin-bottom: 26px;
}
.font_02{
margin-bottom: 12px;
}
}
.btnDiv{
width: 145px;
flex-direction: column;
justify-content: flex-end;
padding-bottom: 26px;
.dialogButton{
width: 100%;
margin-bottom: 17px;
}
}
}
} }
.orderList{ .orderList{
/*margin-top: 60px;*/ /*margin-top: 60px;*/

@ -31,5 +31,24 @@ public interface CustomerReceivingAddressMapper extends BaseMapper<CustomerRecei
@Select("select sort from customer_receiving_address where id=#{id} ") @Select("select sort from customer_receiving_address where id=#{id} ")
int findSort(String id); int findSort(String id);
@Select("select * from customer_receiving_address where user_id =#{userid}")
List<CustomerReceivingAddress> getcra(String userid);
@Select("select * from customer_receiving_address where user_id =#{userid} and sort ='0'")
CustomerReceivingAddress getneed(String userid);
@Update("update customer_receiving_address set sort ='0' where id = #{id} ")
void updatesetneed(String id);
@Update("update customer_receiving_address set sort =#{sort} where id = #{id} ")
void updatec(String id, Integer sort);
@Update("update customer_receiving_address set sort ='0' where id = #{id} ")
void updates(String id);
@Select("SELECT * FROM customer_receiving_address WHERE create_by=#{username} ORDER BY sort DESC LIMIT 1")
CustomerReceivingAddress getcreatbuyuser(String username);
@Select("select * from customer_receiving_address where create_by =#{username} and sort ='0'")
CustomerReceivingAddress getneedyls(String username);
} }

@ -3,6 +3,8 @@ package org.jeecg.modules.demo.customerreceivingaddress.service;
import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress; import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/** /**
* @Description: 顾客地址表 * @Description: 顾客地址表
* @Author: jeecg-boot * @Author: jeecg-boot
@ -16,4 +18,18 @@ public interface ICustomerReceivingAddressService extends IService<CustomerRecei
int findSort(String id); int findSort(String id);
void down(String id); void down(String id);
List<CustomerReceivingAddress> getcra(String userid);
CustomerReceivingAddress getneed(String userid);
void updatesetneed(String id);
void updatec(String id, Integer sort);
void updates(String id);
CustomerReceivingAddress getcreatbuyuser(String username);
CustomerReceivingAddress getneedyls(String username);
} }

@ -8,6 +8,8 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/** /**
* @Description: 顾客地址表 * @Description: 顾客地址表
* @Author: jeecg-boot * @Author: jeecg-boot
@ -51,4 +53,39 @@ public class CustomerReceivingAddressServiceImpl extends ServiceImpl<CustomerRec
} }
} }
} }
@Override
public List<CustomerReceivingAddress> getcra(String userid) {
return customerReceivingAddressMapper.getcra(userid);
}
@Override
public CustomerReceivingAddress getneed(String userid) {
return customerReceivingAddressMapper.getneed(userid);
}
@Override
public void updatesetneed(String id) {
customerReceivingAddressMapper.updatesetneed(id);
}
@Override
public void updatec(String id, Integer sort) {
customerReceivingAddressMapper.updatec(id,sort);
}
@Override
public void updates(String id) {
customerReceivingAddressMapper.updates(id);
}
@Override
public CustomerReceivingAddress getcreatbuyuser(String username) {
return customerReceivingAddressMapper.getcreatbuyuser(username);
}
@Override
public CustomerReceivingAddress getneedyls(String username) {
return customerReceivingAddressMapper.getneedyls(username);
}
} }

@ -30,6 +30,7 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
/** /**
* @Description: 生产计划自动化 * @Description: 生产计划自动化
@ -46,10 +47,17 @@ public class ZyProductPlanAutoController extends JeecgController<ZyProductPlan,
@Autowired @Autowired
private IZyProductPlanAutoService iZyProductPlanAutoService; private IZyProductPlanAutoService iZyProductPlanAutoService;
@ApiOperation(value = "生产计划自动化-模拟测试", notes = "生产计划自动化-模拟测试")
@GetMapping(value = "/productPlanAuto4Mock")
public Result<?> productPlanAuto4Mock(List<String> workOrderIds) {
iZyProductPlanAutoService.doAuto(workOrderIds);
return Result.OK();
}
@ApiOperation(value = "生产计划自动化", notes = "生产计划自动化") @ApiOperation(value = "生产计划自动化", notes = "生产计划自动化")
@GetMapping(value = "/auto") @GetMapping(value = "/productPlanAuto")
public Result<?> auto(HttpServletRequest req) { public Result<?> productPlanAuto() {
iZyProductPlanAutoService.doAuto(req); iZyProductPlanAutoService.doAuto(null);
return Result.OK(); return Result.OK();
} }

@ -3,8 +3,10 @@ package org.jeecg.modules.productplan.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.productplan.entity.ZyProductPlan; import org.jeecg.modules.productplan.entity.ZyProductPlan;
import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo; import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo;
import org.jeecg.modules.workorder.entity.WorkOrder;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List;
/** /**
* @Description: 生产计划 * @Description: 生产计划
@ -14,7 +16,7 @@ import javax.servlet.http.HttpServletRequest;
*/ */
public interface IZyProductPlanAutoService extends IService<ZyProductPlan> { public interface IZyProductPlanAutoService extends IService<ZyProductPlan> {
void doAuto(HttpServletRequest req); void doAuto(List<String> workOrderList);
boolean filling4Auto(String planId); boolean filling4Auto(String planId);
} }

@ -37,6 +37,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
@ -89,8 +90,7 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp
@Autowired @Autowired
private IZyPlanProcessAccessoriesService iZyPlanProcessAccessoriesService; private IZyPlanProcessAccessoriesService iZyPlanProcessAccessoriesService;
// @Transactional(rollbackFor = Exception.class, readOnly = false) @Transactional(rollbackFor = Exception.class, readOnly = false)
@Transactional
List<ZyProductPlan> saveProductPlan(List<WorkOrder> workOrderList) { List<ZyProductPlan> saveProductPlan(List<WorkOrder> workOrderList) {
if (ObjectUtils.isEmpty(workOrderList)) return Collections.EMPTY_LIST; if (ObjectUtils.isEmpty(workOrderList)) return Collections.EMPTY_LIST;
@ -109,8 +109,14 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp
//2,保存生产计划 //2,保存生产计划
ZyProductPlan zyProductPlan = new ZyProductPlan(); ZyProductPlan zyProductPlan = new ZyProductPlan();
zyProductPlan.setProductCode(productCode); zyProductPlan.setProductCode(productCode);
// zyProductPlan.setProductNo(StringUtils.isNotBlank(zyProduct.getProductCode()) ? zyProduct.getProductCode() : ""); zyProductPlan.setProductNo(zyProduct.getProductCode());
zyProductPlan.setProductName(zyProduct.getProductName()); zyProductPlan.setProductName(zyProduct.getProductName());
if (StringUtils.isNotBlank(zyProduct.getEnterprisesId())) {
SysDepart sysDepart = iSysDepartService.getById(zyProduct.getEnterprisesId());
//生产企业
zyProductPlan.setProductOrg(StringUtils.isNotBlank(sysDepart.getDepartName()) ? sysDepart.getDepartName() : "");
}
//生产时长,取zy_product表生产时间 //生产时长,取zy_product表生产时间
zyProductPlan.setDuration(zyProduct.getProduceTime()); zyProductPlan.setDuration(zyProduct.getProduceTime());
SysDepart sysDepart = sysDepartList2.get(i.get()); SysDepart sysDepart = sysDepartList2.get(i.get());
@ -121,7 +127,7 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp
if (!ObjectUtils.isEmpty(sysUserList)) { if (!ObjectUtils.isEmpty(sysUserList)) {
SysUser sysUser = sysUserList.get(0); SysUser sysUser = sysUserList.get(0);
//车间负责人 //车间负责人
zyProductPlan.setResponsiblePerson(sysUser.getRealname()); zyProductPlan.setResponsiblePerson(sysUser.getUsername());
} }
//车间 //车间
zyProductPlan.setWorkshopId(sysDepart.getId()); zyProductPlan.setWorkshopId(sysDepart.getId());
@ -131,17 +137,106 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp
//班组 //班组
zyProductPlan.setTeamId(groupx.getId()); zyProductPlan.setTeamId(groupx.getId());
//班长 //班长
zyProductPlan.setTeamLeader(groupx.getEnterprisesManager()); SysUser sysUser = iSysUserService.getById(groupx.getEnterprisesManager());
zyProductPlan.setTeamLeader(sysUser.getUsername());
} }
Date date = new Date();
//开始时间
zyProductPlan.setWorkTime(date);
//审核人
zyProductPlan.setAuditBy("admin");
//审核时间
zyProductPlan.setAuditTimr(date);
//生产计划状态为未审核
zyProductPlan.setStatus(new Integer(ProductPlanStatusEnum.UNAUDITED.getCode()));
//保存生产计划 //保存生产计划
iZyProductPlanService.save(zyProductPlan);
//更新work_order表work_order_status为“1” (不能为其新增生产计划)
iWorkOrderService.lambdaUpdate().set(WorkOrder::getWorkOrderStatus, WorkOrderStatusEnum.REVIEWED.getCode()).update();
zyProductPlanProductCodes.add(productCode);
});
//根据productCode,查询本次创建生产计划
List<ZyProductPlan> productPlanList = iZyProductPlanService.list(new LambdaQueryWrapper<ZyProductPlan>()
.eq(ZyProductPlan::getStatus, ProductPlanStatusEnum.UNAUDITED.getCode())
.in(ZyProductPlan::getStatus, zyProductPlanProductCodes));
return productPlanList;
}
/**
* 模拟测试方法
*
* @param workOrderList
* @return
*/
@Transactional(rollbackFor = Exception.class, readOnly = false)
List<ZyProductPlan> saveProductPlan4Mock(List<WorkOrder> workOrderList) {
if (ObjectUtils.isEmpty(workOrderList)) return Collections.EMPTY_LIST;
Set<String> zyProductPlanProductCodes = new LinkedHashSet<>();
/**
* 模拟测试 车间负责人班组组长使用固定值
*/
workOrderList.stream().forEach(e -> {
String productCode = e.getProductCode();
ZyProduct zyProduct = iZyProductService.getOne(new LambdaQueryWrapper<ZyProduct>()
.eq(ZyProduct::getWorkOrderId, productCode));
Optional.ofNullable(zyProduct).orElseThrow(() -> new JeecgBootException(productCode + ":产品不存在"));
//2,保存生产计划
ZyProductPlan zyProductPlan = new ZyProductPlan();
zyProductPlan.setProductCode(productCode);
zyProductPlan.setProductNo(zyProduct.getProductCode());
zyProductPlan.setProductName(zyProduct.getProductName());
if (StringUtils.isNotBlank(zyProduct.getEnterprisesId())) {
SysDepart sysDepart = iSysDepartService.getById(zyProduct.getEnterprisesId());
//生产企业
zyProductPlan.setProductOrg(StringUtils.isNotBlank(sysDepart.getDepartName()) ? sysDepart.getDepartName() : "");
}
//生产时长,取zy_product表生产时间
zyProductPlan.setDuration(zyProduct.getProduceTime());
SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper<SysDepart>()
.eq(SysDepart::getOrgCategory, "2")
.eq(SysDepart::getDepartName, "测试生产企业"));
if (ObjectUtils.isEmpty(sysDepart)) throw new JeecgBootException("生产计划自动化-mock-[企业信息]数据异常!");
//车间
zyProductPlan.setWorkshopId(sysDepart.getId());
List<String> sysDepartIds = new LinkedList<>();
sysDepartIds.add(sysDepart.getId());
List<SysUser> sysUserList = iSysUserService.getUserByDepIds(sysDepartIds, null);
//车间负责人
zyProductPlan.setResponsiblePerson(sysUserList.get(0).getUsername());
Groupx groupx = iGroupxService.getOne(new LambdaQueryWrapper<Groupx>().eq(Groupx::getDepartId, sysDepart.getId()).eq(Groupx::getGroupName, "测试班组"));
if (ObjectUtils.isEmpty(groupx)) throw new JeecgBootException("生产计划自动化-mock-[班组]数据异常!");
//班组
zyProductPlan.setTeamId(groupx.getId());
//班长
SysUser sysUser = iSysUserService.getById(groupx.getEnterprisesManager());
zyProductPlan.setTeamLeader(sysUser.getUsername());
Date date = new Date();
//开始时间
zyProductPlan.setWorkTime(date);
//审核人
zyProductPlan.setAuditBy("admin");
//审核时间
zyProductPlan.setAuditTimr(date);
//生产计划状态为未审核
zyProductPlan.setStatus(new Integer(ProductPlanStatusEnum.UNAUDITED.getCode())); zyProductPlan.setStatus(new Integer(ProductPlanStatusEnum.UNAUDITED.getCode()));
//保存生产计划
iZyProductPlanService.save(zyProductPlan); iZyProductPlanService.save(zyProductPlan);
//更新work_order表work_order_status为“1” (不能为其新增生产计划) //更新work_order表work_order_status为“1” (不能为其新增生产计划)
iWorkOrderService.lambdaUpdate().set(WorkOrder::getWorkOrderStatus, WorkOrderStatusEnum.REVIEWED.getCode()).update(); iWorkOrderService.lambdaUpdate().set(WorkOrder::getWorkOrderStatus, WorkOrderStatusEnum.REVIEWED.getCode()).update();
zyProductPlanProductCodes.add(productCode); zyProductPlanProductCodes.add(productCode);
}); });
//根据productCode,查询本次创建生产计划 //根据productCode,查询本次创建生产计划
List<ZyProductPlan> productPlanList = iZyProductPlanService.list(new LambdaQueryWrapper<ZyProductPlan>() List<ZyProductPlan> productPlanList = iZyProductPlanService.list(new LambdaQueryWrapper<ZyProductPlan>()
.eq(ZyProductPlan::getStatus, ProductPlanStatusEnum.UNAUDITED.getCode()) .eq(ZyProductPlan::getStatus, ProductPlanStatusEnum.UNAUDITED.getCode())
@ -162,50 +257,28 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp
return sysDepartList2; return sysDepartList2;
} }
public static void main(String[] args) {
List list = new LinkedList();
List list2 = new LinkedList();
list.add("1");
list.add("2");
list.add("3");
list.add("4");
list.add("5");
list.add("6");
list.add("7");
list.add("8");
list2.add("a");
list2.add("b");
list2.add("c");
list2.add("c");
list2.add("c");
list2.add("c");
int size = list.size();
List<String> sysDepartList2 = new LinkedList<>();
sysDepartList2.addAll(list2);
int size2 = sysDepartList2.size();
while (size2 < size) {
sysDepartList2.addAll(list2);
size2 = sysDepartList2.size();
}
System.out.println("sysDepartList2 = " + sysDepartList2.size());
System.out.println("list2 = " + list2.size());
System.out.println("list = " + list.size());
}
@Override @Override
public void doAuto(HttpServletRequest req) { @Transactional(rollbackFor = Exception.class, readOnly = false)
public void doAuto(List<String> workOrderList4Mock) {
//1,获取未排产工单 //1,获取未排产工单
List<WorkOrder> workOrderList = iWorkOrderService.list(new LambdaQueryWrapper<WorkOrder>() List<WorkOrder> workOrderList;
if (ObjectUtils.isEmpty(workOrderList4Mock)) {
workOrderList = iWorkOrderService.list(new LambdaQueryWrapper<WorkOrder>()
.eq(WorkOrder::getWorkOrderStatus, WorkOrderStatusEnum.UNAUDITED.getCode())); .eq(WorkOrder::getWorkOrderStatus, WorkOrderStatusEnum.UNAUDITED.getCode()));
} else {
workOrderList = iWorkOrderService.list(new LambdaQueryWrapper<WorkOrder>()
.eq(WorkOrder::getWorkOrderStatus, WorkOrderStatusEnum.UNAUDITED.getCode())
.in(WorkOrder::getId, workOrderList4Mock));
}
// List<WorkOrder> workOrderList = iWorkOrderService.list(new LambdaQueryWrapper<WorkOrder>()
// .eq(WorkOrder::getWorkOrderStatus, WorkOrderStatusEnum.UNAUDITED.getCode()));
if (ObjectUtils.isEmpty(workOrderList)) return;
//2,保存生产计划 //2,保存生产计划
List<ZyProductPlan> productPlanList = this.saveProductPlan(workOrderList); // List<ZyProductPlan> productPlanList = this.saveProductPlan(workOrderList);
List<ZyProductPlan> productPlanList = this.saveProductPlan4Mock(workOrderList);
if (ObjectUtils.isEmpty(productPlanList)) return; if (ObjectUtils.isEmpty(productPlanList)) return;
//3,同步计划生产工序、同步生产计划工序面料、同步生产计划辅料 //3,同步计划生产工序、同步生产计划工序面料、同步生产计划辅料
@ -219,6 +292,7 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp
// 匹配工序设备、工序工具有一个工序失败,则工单作为异常处理,删除生产计划及相关子表 // 匹配工序设备、工序工具有一个工序失败,则工单作为异常处理,删除生产计划及相关子表
//只有一个生产计划的设备、工具都匹配成功才进行一下操作(生成物料单、发送到仓库) //只有一个生产计划的设备、工具都匹配成功才进行一下操作(生成物料单、发送到仓库)
productPlanList.stream().forEach(k -> { productPlanList.stream().forEach(k -> {
//TODO 数据不完整,测试时注释
// boolean b = this.filling4Auto(k.getId()); // boolean b = this.filling4Auto(k.getId());
// if (b) { // if (b) {
List<ZyPlanProcess> planProcessList = zyPlanProcessService.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, k.getId())); List<ZyPlanProcess> planProcessList = zyPlanProcessService.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, k.getId()));
@ -234,6 +308,8 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp
} }
/** /**
* 匹配设备&工具&工人
* <p>
* 匹配车间工位设备与工序设备工位设备包含工序设备即匹配成功匹配失败做异常处理 * 匹配车间工位设备与工序设备工位设备包含工序设备即匹配成功匹配失败做异常处理
* 匹配车间工位工具与工序设备工位设备包含工序设备即匹配成功匹配失败做异常处理 * 匹配车间工位工具与工序设备工位设备包含工序设备即匹配成功匹配失败做异常处理
* *
@ -265,8 +341,9 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp
return false; return false;
} }
List<ZyPlanProcess> planProcessList2 = zyPlanProcessService.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, planId));
//匹配工人 //匹配工人
this.diffWorker(planProcessList, planId); this.diffWorker(planProcessList2, planId);
return true; return true;
} }

@ -3,24 +3,37 @@ package org.jeecg.modules.system.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Joiner;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.aspectj.apache.bcel.generic.RET; import org.aspectj.apache.bcel.generic.RET;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.base.service.BaseCommonService; 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.customerreceivingaddress.entity.CustomerReceivingAddress;
import org.jeecg.modules.demo.customerreceivingaddress.service.ICustomerReceivingAddressService;
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.entity.SysUser;
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.Grzx2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest; import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.Date; import java.util.*;
import java.util.HashMap; import java.util.stream.Collectors;
import java.util.Map;
/* /*
这个是个人中心专用控制器之前全都写在SysUserController用户控制器里面感觉不妥因此就专门拖出来一个 这个是个人中心专用控制器之前全都写在SysUserController用户控制器里面感觉不妥因此就专门拖出来一个
@ -34,6 +47,18 @@ public class ApeopersionController {
@Autowired @Autowired
private ISysUserService sysUserService; private ISysUserService sysUserService;
@Autowired
private ICustomercollectgoodsService customercollectgoodsService;
@Autowired
private IZyGoodsService zyGoodsService;
@Autowired
private ICustomerShoppingCartService customerShoppingCartService;
@Autowired
private ICustomerReceivingAddressService customerReceivingAddressService;
/* /*
个人中心我的账户的数据获取 个人中心我的账户的数据获取
@ -44,15 +69,15 @@ public class ApeopersionController {
String id = loginUser.getId(); String id = loginUser.getId();
SysUser syu = new SysUser(); SysUser syu = new SysUser();
syu = sysUserService.getneeduser(id); syu = sysUserService.getneeduser(id);
findgoods();
return Result.ok(syu); return Result.ok(syu);
} }
//个人中心的我的账户页面需要的数据
@RequestMapping(value = "/updateneeduser", method = RequestMethod.GET) @RequestMapping(value = "/updateneeduser", method = RequestMethod.GET)
public Result<?> updateneeduser(@RequestParam(name = "form", required = true) String form) { public Result<?> updateneeduser(@RequestParam(name = "form", required = true) String form) {
Map map = JSON.parseObject(form,Map.class); Map map = JSON.parseObject(form,Map.class);
System.out.println(map);
String id = (String) map.get("id"); String id = (String) map.get("id");
String sex= map.get("sex").toString(); String sex= map.get("sex").toString();
String birthday= (String) map.get("birthday"); String birthday= (String) map.get("birthday");
@ -60,6 +85,215 @@ public class ApeopersionController {
String phone= (String) map.get("phone"); String phone= (String) map.get("phone");
String email= (String) map.get("email"); String email= (String) map.get("email");
sysUserService.updateneed(id,sex,birthday,realname,phone,email); sysUserService.updateneed(id,sex,birthday,realname,phone,email);
return Result.ok("success"); 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("添加完成");
}
//个人中心的我的收藏的首页需要的数据
@RequestMapping(value = "/delteys", method = RequestMethod.GET)
public Result<?> delteys(@RequestParam(name = "id", required = true) String id) {
customercollectgoodsService.removeById(id);
return Result.ok("添加完成");
}
//个人中心的收货地址的首页需要的数据
@RequestMapping(value = "/getaddress", method = RequestMethod.GET)
public Result<?> getaddress() {
//这里方便获取当前登陆信息
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//这里获取当前登陆的id
String userid = loginUser.getId();
Integer usersex = loginUser.getSex();
//这个是根据用户id查收货地址
List<CustomerReceivingAddress> cra =customerReceivingAddressService.getcra(userid);
for (int i=0;i<cra.size();i++) {
cra.get(i).setSysOrgCode(usersex.toString());
}
return Result.ok(cra);
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "顾客地址表-通过id删除")
@ApiOperation(value="顾客地址表-通过id删除", notes="顾客地址表-通过id删除")
@DeleteMapping(value = "/deleteadd")
public Result<?> deleteadd(@RequestParam(name="id",required=true) String id) {
customerReceivingAddressService.removeById(id);
return Result.OK("删除成功!");
}
@RequestMapping(value = "/getaddressbyid", method = RequestMethod.GET)
public Result<?> getaddressbyid(@RequestParam(name="id",required=true) String id) {
System.out.println(id);
/*return Result.ok("");*/
return null;
}
//这个功能是个人中心的地址管设置默认地址
@RequestMapping(value = "/sdqx", method = RequestMethod.GET)
public Result<?> sdqx(@RequestParam(name="id",required=true) String id) {
//根据id查询需要设置成默认收货地址的收货地址
CustomerReceivingAddress cus = customerReceivingAddressService.getById(id);
String userid = cus.getUserId();
Integer sort = cus.getSort();
//开始寻找之前的默认地址
CustomerReceivingAddress cusm = customerReceivingAddressService.getneed(userid);
//如果没有默认地址
if (cusm==null){
customerReceivingAddressService.updatesetneed(id);
}else{
//这个是更新默认地址
customerReceivingAddressService.updatec(cusm.getId(),sort);
customerReceivingAddressService.updates(id);
}
return Result.OK("成功!");
}
//这个功能是个人中心的地址添加收货地址,不是默认收货地址
@RequestMapping(value = "/addadressress", method = RequestMethod.GET)
public Result<?> addadressress(@RequestParam(name = "form", required = true) String form) {
System.out.println(form);
//这里方便获取当前登陆信息
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//这里获取当前登陆的用户名
String Username = loginUser.getUsername();
//将前台传过来的json数据包转化成map
Map map = JSON.parseObject(form,Map.class);
//获取flag的数据
String flag = map.get("flag").toString();
//通过flag判断是否是需要的设置成默认地址
if (flag.equals("false")){
//寻找之前的排序的最后一个
CustomerReceivingAddress cus = customerReceivingAddressService.getcreatbuyuser(Username);
CustomerReceivingAddress cus2 =new CustomerReceivingAddress();
cus2.setUserId(loginUser.getId());
cus2.setCityId((String)map.get("addr"));
cus2.setUsernamme((String)map.get("name"));
cus2.setAddress((String)map.get("detailed"));
cus2.setMobile((String)map.get("phone"));
cus2.setSort(cus.getSort()+1);
customerReceivingAddressService.save(cus2);
} else if (flag.equals("true")){
//寻找之前的排序的最后一个
CustomerReceivingAddress cus = customerReceivingAddressService.getcreatbuyuser(Username);
//开始寻找之前的默认地址
CustomerReceivingAddress cusm = customerReceivingAddressService.getneedyls(Username);
//开始组装需要的新的默认地址
CustomerReceivingAddress cus2 =new CustomerReceivingAddress();
cus2.setUserId(loginUser.getId());
cus2.setCityId((String)map.get("addr"));
cus2.setUsernamme((String)map.get("name"));
cus2.setAddress((String)map.get("detailed"));
cus2.setMobile((String)map.get("phone"));
cus2.setSort(0);
//将新的数据写入数据库
customerReceivingAddressService.save(cus2);
//将老的默认收货地址放在排序的最后一个
cusm.setSort(cus.getSort()+1);
customerReceivingAddressService.updateById(cusm);
}
return Result.OK("成功!");
}
//这个功能是个人中心的地址添加收货地址,不是默认收货地址
@RequestMapping(value = "/updateadressress", method = RequestMethod.GET)
public Result<?> updateadressress(@RequestParam(name = "form", required = true) String form) {
//将前台传过来的json数据包转化成map
Map map = JSON.parseObject(form,Map.class);
//查询需要的对象
CustomerReceivingAddress needc = customerReceivingAddressService.getById((String)map.get("id"));
needc.setMobile((String)map.get("phone"));
needc.setUsernamme((String)map.get("name"));
needc.setAddress((String)map.get("detailed"));
needc.setCityId((String)map.get("addr"));
customerReceivingAddressService.updateById(needc);
return Result.OK("成功!");
}
} }

@ -178,4 +178,12 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
//个人中心我的账户修改个人信息 //个人中心我的账户修改个人信息
@Update("UPDATE sys_user SET realname = #{realname},sex=#{sex},birthday=#{birthday},phone=#{phone},email=#{email} WHERE id = #{id} ") @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); 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>
<!-- 这个是获取订单的数据中的商品数据 -->
<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> </mapper>

@ -272,4 +272,11 @@ public interface ISysUserService extends IService<SysUser> {
SysUser getneeduser(String id); SysUser getneeduser(String id);
void updateneed(String id, String sex, String birthday, String realname, String phone, String email); 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.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.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;
@ -588,4 +589,19 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
userMapper.updateneed(id,sex,birthday,realname,phone,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