个人中心

zhc4dev
wangjiadong 2 years ago
parent cd32c5e2e2
commit c2416e2ae9
  1. 71
      ant-design-vue-jeecg/src/views/shopping/pages/gerenzhongxin.vue
  2. 56
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
  3. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java
  4. 23
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserMapper.xml
  5. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysUserService.java
  6. 6
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java

@ -5,7 +5,8 @@
<div class="bg"></div>
<div class="info jz d-flex">
<img src="../assets/photo.png">
<p class="f_36 c_1B">welcome, 用户名</p>
<p class="f_36 c_1B" v-if="this.userInfo().username==null">请登录</p>
<p class="f_36 c_1B" v-if="this.userInfo().username!=null">welcome, {{this.userInfo().username}}</p>
<a>量体数据</a>
</div>
<div class="jz">
@ -90,14 +91,20 @@
import Header from "../components/Header/HeaderView";
import Footer from "../components/Footer/FooterView"
import {mapGetters} from 'vuex'
import { getFileAccessHttpUrl,getAction } from "@/api/manage"
import { getFileAccessHttpUrl} from "@/api/manage"
import { httpAction, getAction } from '@/api/manage'
export default {
name: "gerenzhongxin",
components: { Header,Footer },
data() {0
return {
model:{
username1: ""
},
current: ['allorders'],//
key:'',//
allOrders2:[],
allOrders1:[
{
id:1,
@ -143,22 +150,60 @@
}
],//
allOrders:[],//
url: {
list: "/starehouse/starehouse/list",
getusername: "/sys/user/getusername",
findgoods: "/sys/user/findgoods"
},
};
},
created() {
this.getusername();
this.getallgoods();
},
mounted() {
if(this.current[0] == 'allorders'){
this.allOrders = this.allOrders1
/*this.allOrders = this.allOrders1*/
this.allOrders = this.allOrders2
}
},
methods: {
...mapGetters(["nickname", "avatar","userInfo"]),
getallgoods(){
getAction(this.url.findgoods).then((res) => {
if(res.success) {
this.allOrders2 = res.result;
console.log("===========")
console.log(res.result)
console.log(this.allOrders2)
console.log("===========")
this.visible = true;
} else {
console.log("-----------")
}
});
},
getusername(){
getAction(this.url.getusername).then((res) => {
if(res.success) {
this.model.username1 = res.result;
console.log(res.message)
this.visible = true;
} else {
}
});
},
...mapGetters(["nickname", "avatar", "userInfo", "addRouters", "username", "permissionList"]),
//
getAvatar(){
return getFileAccessHttpUrl(this.avatar())
},
callback(key) {
console.log(key);
},
@ -195,16 +240,20 @@
this.current.shift()
this.current.push(key.key)
if(key.key == 'allorders'){
this.allOrders = this.allOrders1
/* this.allOrders = this.allOrders1*/
this.allOrders = this.allOrders2
}
else if(key.key == 'daizhifu'){
this.allOrders = this.allOrders1.filter(item=>item.pay == false)
/* this.allOrders = this.allOrders1.filter(item=>item.pay == false)*/
this.allOrders = this.allOrders2.filter(item=>item.pay == false)
}
else if(key.key == 'daishouhuo'){
this.allOrders = this.allOrders1.filter(item=>item.receipt == false && item.pay == true)
/*this.allOrders = this.allOrders1.filter(item=>item.receipt == false && item.pay == true)*/
this.allOrders = this.allOrders2.filter(item=>item.receipt == false && item.pay == true)
}
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)
}else{
this.allOrders=[]
}

@ -33,6 +33,8 @@ import org.jeecg.modules.system.entity.*;
import org.jeecg.modules.system.model.DepartIdModel;
import org.jeecg.modules.system.model.SysUserSysDepartModel;
import org.jeecg.modules.system.service.*;
import org.jeecg.modules.system.vo.Grzx1;
import org.jeecg.modules.system.vo.Grzx2;
import org.jeecg.modules.system.vo.SysDepartUsersVO;
import org.jeecg.modules.system.vo.SysUserRoleVO;
import org.jeecg.modules.team.entity.Groupx;
@ -1491,4 +1493,58 @@ public class SysUserController {
}
/**
* 根据用户名修改手机号
*
* @param json
* @return
*/
@RequestMapping(value = "/getusername", method = RequestMethod.GET)
public Result<?> changMobile1() {
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String username = loginUser.getUsername();
return Result.ok(username);
}
/**
* 个人中心
*
* @param json
* @return
*/
@RequestMapping(value = "/findgoods", method = RequestMethod.GET)
public Result<?> findgoods() {
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String userid = loginUser.getUsername();
List<Grzx1> gr1 = new ArrayList<>();
List<Grzx2> gr2 = new ArrayList<>();
gr1 =sysUserService.getallgr1(userid);
for (int i=0;i<gr1.size();i++){
Grzx2 g2 = new Grzx2();
g2.setId(gr1.get(i).getId());
g2.setOrderNum(gr1.get(i).getTotalNum());
g2.setPay("false");
g2.setReceipt("false");
g2.setUrl(gr1.get(i).getDefaultPicture());
g2.setName(gr1.get(i).getGoodsName());
g2.setType(gr1.get(i).getStyleNames());
g2.setSize(gr1.get(i).getModelNumber());
g2.setNum(gr1.get(i).getGoodsNum());
g2.setPrice(gr1.get(i).getUnitPrice());
g2.setMaterial(gr1.get(i).getName()+","+gr1.get(i).getTypeName());
g2.setTotal(gr1.get(i).getPayTotalPrice());
gr2.add(g2);
}
return Result.ok(gr2);
}
/* public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
Groupx groupx = groupxService.getById(id);
return Result.OK(groupx);
}*/
}

@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
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.SysUserDepVo;
import java.util.List;
@ -152,4 +153,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
* @return
*/
List<SysUser> queryByDepIds(@Param("departIds") List<String> departIds, @Param("username") String username);
List<Grzx1> getallgr1(String userid);
}

@ -45,7 +45,7 @@
and username = #{username}
</if>
</select>
<!-- 修改用户部门code -->
<update id="updateUserDepart">
UPDATE sys_user SET org_code = #{orgCode} where username = #{username}
@ -55,7 +55,7 @@
<select id="getUserByPhone" resultType="org.jeecg.modules.system.entity.SysUser">
select * from sys_user where phone = #{phone} and del_flag = 0
</select>
<!-- 根据邮箱查询用户信息 -->
<select id="getUserByEmail" resultType="org.jeecg.modules.system.entity.SysUser">
select * from sys_user where email = #{email} and del_flag = 0
@ -162,4 +162,21 @@
and username != #{username}
</if>
</select>
</mapper>
<!-- 根据用户名查询 -->
<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
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.create_by=#{userid}
</select>
</mapper>

@ -9,6 +9,7 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.vo.SysUserCacheInfo;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.model.SysUserSysDepartModel;
import org.jeecg.modules.system.vo.Grzx1;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collection;
@ -253,4 +254,5 @@ public interface ISysUserService extends IService<SysUser> {
/** userId转为username */
List<String> userIdToUsername(Collection<String> userIdList);
List<Grzx1> getallgr1(String userid);
}

@ -20,6 +20,7 @@ import org.jeecg.modules.system.entity.*;
import org.jeecg.modules.system.mapper.*;
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.SysUserDepVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
@ -542,4 +543,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return userList.stream().map(SysUser::getUsername).collect(Collectors.toList());
}
@Override
public List<Grzx1> getallgr1(String userid) {
return userMapper.getallgr1(userid);
}
}

Loading…
Cancel
Save