no message
This commit is contained in:
parent
8fb4b20d7f
commit
78c6d5d5d9
@ -73,6 +73,13 @@ public class LJUserController extends BaseController {
|
||||
return getSuccessResult(user);
|
||||
}
|
||||
|
||||
@GetMapping("/getByUniApp")
|
||||
public ResponseObject getByUniApp(){
|
||||
LJUserVo user = userService.getByUniApp();
|
||||
return getSuccessResult(user);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据手机号查询会员信息
|
||||
* @param map
|
||||
|
@ -86,5 +86,21 @@ public class MtUserExpressAddressController extends BaseController {
|
||||
return getSuccessResult(this.mtUserExpressAddressService.deleteById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询默认快递地址
|
||||
*/
|
||||
public ResponseObject getDefault() {
|
||||
return getSuccessResult(this.mtUserExpressAddressService.getDefault());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有快递地址
|
||||
*/
|
||||
@GetMapping("getList")
|
||||
public ResponseObject getList() {
|
||||
return getSuccessResult(this.mtUserExpressAddressService.getList());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,9 @@ public class MtUserExpressAddress extends BaseEntity {
|
||||
* 是否默认,0表示否,1表示是
|
||||
*/
|
||||
private String ifDefault;
|
||||
|
||||
|
||||
private String fullAddress;
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
|
@ -3,6 +3,7 @@ package com.fuint.business.userManager.mapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.userManager.entity.MtUserExpressAddress;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.List;
|
||||
@ -73,6 +74,12 @@ public interface MtUserExpressAddressMapper {
|
||||
*/
|
||||
int update(MtUserExpressAddress mtUserExpressAddress);
|
||||
|
||||
/**
|
||||
* 修改为非默认
|
||||
* @return
|
||||
*/
|
||||
int updateIfDefault(Integer userId);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
@ -81,5 +88,17 @@ public interface MtUserExpressAddressMapper {
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询默认快递地址
|
||||
*/
|
||||
MtUserExpressAddress getDefault();
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有快递地址
|
||||
*/
|
||||
List<MtUserExpressAddress> getList(Integer userId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
|
||||
<result property="fullAddress" column="full_address" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
@ -90,10 +91,11 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mt_user_express_address(user_id, name, mobile, address, if_default, store_id, create_time, update_time, create_by, update_by)
|
||||
values (#{userId}, #{name}, #{mobile}, #{address}, #{ifDefault}, #{storeId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy})
|
||||
insert into mt_user_express_address(user_id, name, mobile, address, if_default, store_id, create_time, update_time, create_by, update_by,full_address)
|
||||
values (#{userId}, #{name}, #{mobile}, #{address}, #{ifDefault}, #{storeId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy},#{fullAddress})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
@ -154,14 +156,35 @@
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="fullAddress != null">
|
||||
full_address = #{fullAddress},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateIfDefault">
|
||||
update mt_user_express_address set if_default = 2 where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from mt_user_express_address where id = #{id}
|
||||
</delete>
|
||||
|
||||
|
||||
|
||||
<select id="getDefault" resultMap="MtUserExpressAddressMap">
|
||||
select
|
||||
id, user_id, name, mobile, address, if_default, store_id, create_time, update_time, create_by, update_by
|
||||
from mt_user_express_address
|
||||
</select>
|
||||
<select id="getList" resultMap="MtUserExpressAddressMap">
|
||||
select
|
||||
id, user_id, name, mobile, address, if_default, store_id, create_time, update_time, create_by, update_by
|
||||
from mt_user_express_address
|
||||
where user_id = #{userId}
|
||||
order by if_default
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.userManager.entity.LJUserGrade;
|
||||
import com.fuint.repository.model.MtUserGrade;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -71,4 +72,10 @@ public interface LJUserGradeService extends IService<LJUserGrade> {
|
||||
* @return
|
||||
*/
|
||||
public int updateUserGrade(LJUserGrade userGrade);
|
||||
/**
|
||||
* 获取最低等级
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
|
||||
}
|
||||
|
@ -39,6 +39,9 @@ public interface LJUserService extends IService<LJUser> {
|
||||
*/
|
||||
public LJUserVo selectUserById(int id);
|
||||
|
||||
|
||||
public LJUserVo getByUniApp();
|
||||
|
||||
/**
|
||||
* 根据手机号查询会员信息
|
||||
* @param mobile
|
||||
|
@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.userManager.entity.MtUserExpressAddress;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员快递信息表(MtUserExpressAddress)表服务接口
|
||||
*
|
||||
@ -21,6 +23,7 @@ public interface MtUserExpressAddressService {
|
||||
*/
|
||||
MtUserExpressAddress queryById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
@ -54,4 +57,17 @@ public interface MtUserExpressAddressService {
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询默认快递地址
|
||||
*/
|
||||
MtUserExpressAddress getDefault();
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有快递地址
|
||||
*/
|
||||
List<MtUserExpressAddress> getList();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.fuint.business.userManager.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -12,6 +13,7 @@ import com.fuint.business.userManager.service.LJUserGradeService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.StringUtils;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.repository.model.MtUserGrade;
|
||||
import com.fuint.system.config.service.SysConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -109,6 +109,14 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
return baseMapper.selectUserById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LJUserVo getByUniApp() {
|
||||
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
return baseMapper.selectUserById(nowAccountInfo.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据手机号查询会员信息
|
||||
* @param mobile
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.userManager.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.userManager.entity.MtUserExpressAddress;
|
||||
@ -11,6 +12,7 @@ import org.springframework.stereotype.Service;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员快递信息表(MtUserExpressAddress)表服务实现类
|
||||
@ -58,7 +60,12 @@ public class MtUserExpressAddressServiceImpl implements MtUserExpressAddressServ
|
||||
public MtUserExpressAddress insert(MtUserExpressAddress mtUserExpressAddress) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
mtUserExpressAddress.setStoreId(nowAccountInfo.getStoreId());
|
||||
mtUserExpressAddress.setCreateBy(nowAccountInfo.getStaffId().toString());
|
||||
mtUserExpressAddress.setUserId(nowAccountInfo.getId());
|
||||
mtUserExpressAddress.setCreateBy(nowAccountInfo.getId().toString());
|
||||
// 设置默认
|
||||
if (ObjectUtil.isNotEmpty(mtUserExpressAddress.getIfDefault()) && "1".equals(mtUserExpressAddress.getIfDefault())) {
|
||||
mtUserExpressAddressMapper.updateIfDefault(nowAccountInfo.getId());
|
||||
}
|
||||
this.mtUserExpressAddressMapper.insert(mtUserExpressAddress);
|
||||
return mtUserExpressAddress;
|
||||
}
|
||||
@ -72,8 +79,10 @@ public class MtUserExpressAddressServiceImpl implements MtUserExpressAddressServ
|
||||
@Override
|
||||
public MtUserExpressAddress update(MtUserExpressAddress mtUserExpressAddress) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
mtUserExpressAddress.setUpdateBy(nowAccountInfo.getStaffId().toString());
|
||||
|
||||
// 设置默认
|
||||
if (ObjectUtil.isNotEmpty(mtUserExpressAddress.getIfDefault()) && "1".equals(mtUserExpressAddress.getIfDefault())) {
|
||||
mtUserExpressAddressMapper.updateIfDefault(nowAccountInfo.getId());
|
||||
}
|
||||
this.mtUserExpressAddressMapper.update(mtUserExpressAddress);
|
||||
return this.queryById(mtUserExpressAddress.getId());
|
||||
}
|
||||
@ -88,4 +97,17 @@ public class MtUserExpressAddressServiceImpl implements MtUserExpressAddressServ
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.mtUserExpressAddressMapper.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MtUserExpressAddress getDefault() {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MtUserExpressAddress> getList() {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
return mtUserExpressAddressMapper.getList(nowAccountInfo.getId());
|
||||
}
|
||||
}
|
||||
|
@ -9,10 +9,12 @@ import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||
import com.fuint.business.userManager.entity.LJUserGrade;
|
||||
import com.fuint.business.userManager.entity.MtInvitation;
|
||||
import com.fuint.business.userManager.entity.UserBalance;
|
||||
import com.fuint.business.userManager.mapper.MtInvitationMapper;
|
||||
import com.fuint.business.userManager.mapper.UserBalanceMapper;
|
||||
import com.fuint.business.userManager.service.LJUserGradeService;
|
||||
import com.fuint.business.userManager.service.LJUserService;
|
||||
import com.fuint.business.userManager.service.MtInvitationService;
|
||||
import com.fuint.business.userManager.service.UserBalanceService;
|
||||
@ -731,8 +733,11 @@ public class MemberServiceImpl extends ServiceImpl<MtUserMapper, MtUser> impleme
|
||||
private ILJStoreService iljStoreService;
|
||||
@Resource
|
||||
LJUserService ljUserService;
|
||||
@Resource
|
||||
LJUserGradeService ljUserGradeService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public MtUser queryMemberByOpenId2(String openId, JSONObject userInfo) throws BusinessCheckException {
|
||||
// merchantId 可以不需要
|
||||
// MtUser user = mtUserMapper.queryMemberByOpenId2(openId);
|
||||
@ -779,30 +784,29 @@ public class MemberServiceImpl extends ServiceImpl<MtUserMapper, MtUser> impleme
|
||||
// 新增余额信息
|
||||
if (ObjectUtil.isNotEmpty(storeId) && storeId !="") {
|
||||
// 根据userid和stortId查询是否存在对应的余额信息
|
||||
UserBalance userBalance = userBalanceService.selectUserBalance(mtUserMobile.getId(), Integer.parseInt(storeId));
|
||||
UserBalance userBalance = userBalanceService.selectUserBalance(mtUser.getId(), Integer.parseInt(storeId));
|
||||
if (ObjectUtil.isEmpty(userBalance)) {
|
||||
// 新增余额信息
|
||||
UserBalance userBalanceAdd = new UserBalance();
|
||||
userBalanceAdd.setMtUserId(mtUserMobile.getId());
|
||||
userBalanceAdd.setMtUserId(mtUser.getId());
|
||||
userBalanceAdd.setStoreId(Integer.parseInt(storeId));
|
||||
userBalanceAdd.setCardBalance(0.0);
|
||||
userBalanceAdd.setPoints(0);
|
||||
userBalanceAdd.setGrowthValue(0);
|
||||
userBalanceAdd.setConsumeNum(0);
|
||||
|
||||
MtUserGrade lowGrade = userGradeService.getLowGrade(Integer.parseInt(storeId));
|
||||
if (ObjectUtil.isNotEmpty(lowGrade) && ObjectUtil.isNotEmpty(lowGrade.getId())) {
|
||||
userBalanceAdd.setGradeId(lowGrade.getId());
|
||||
LJUserGrade ljUserGrade = ljUserGradeService.selectUserGradeByStoreId(Integer.parseInt(storeId));
|
||||
if (ObjectUtil.isNotEmpty(ljUserGrade) && ObjectUtil.isNotEmpty(ljUserGrade.getId())) {
|
||||
userBalanceAdd.setGradeId(ljUserGrade.getId());
|
||||
}
|
||||
// 新增会员余额信息
|
||||
userBalanceService.insertUserBalance(userBalanceAdd);
|
||||
}
|
||||
LJStore store = iljStoreService.selectStoreByStoreId(Integer.parseInt(storeId));
|
||||
// 查询关联表里面是否有信息
|
||||
MtInvitation mtInvitation1 = mtInvitationMapper.queryByStoreId(Integer.parseInt(storeId), mtUserMobile.getId());
|
||||
MtInvitation mtInvitation1 = mtInvitationMapper.queryByStoreId(Integer.parseInt(storeId), mtUser.getId());
|
||||
if (ObjectUtil.isEmpty(mtInvitation1)) {
|
||||
MtInvitation mtInvitation = new MtInvitation();
|
||||
mtInvitation.setUserId(mtUserMobile.getId());
|
||||
mtInvitation.setUserId(mtUser.getId());
|
||||
mtInvitation.setStoreId(Integer.parseInt(storeId));
|
||||
if (ObjectUtil.isNotEmpty(staffId) && staffId !="") {
|
||||
mtInvitation.setStaffId(Integer.parseInt(staffId));
|
||||
|
@ -72,10 +72,10 @@ public class UserGradeServiceImpl extends ServiceImpl<MtUserGradeMapper, MtUserG
|
||||
if (StringUtils.isNotBlank(status)) {
|
||||
lambdaQueryWrapper.eq(MtUserGrade::getStatus, status);
|
||||
}
|
||||
String merchantId = paginationRequest.getSearchParams().get("merchantId") == null ? "" : paginationRequest.getSearchParams().get("merchantId").toString();
|
||||
if (StringUtils.isNotBlank(merchantId)) {
|
||||
lambdaQueryWrapper.eq(MtUserGrade::getMerchantId, merchantId);
|
||||
}
|
||||
// String merchantId = paginationRequest.getSearchParams().get("merchantId") == null ? "" : paginationRequest.getSearchParams().get("merchantId").toString();
|
||||
// if (StringUtils.isNotBlank(merchantId)) {
|
||||
// lambdaQueryWrapper.eq(MtUserGrade::getMerchantId, merchantId);
|
||||
// }
|
||||
|
||||
lambdaQueryWrapper.orderByDesc(MtUserGrade::getId);
|
||||
List<MtUserGrade> dataList = mtUserGradeMapper.selectList(lambdaQueryWrapper);
|
||||
@ -195,7 +195,7 @@ public class UserGradeServiceImpl extends ServiceImpl<MtUserGradeMapper, MtUserG
|
||||
initGrade.setId(0);
|
||||
initGrade.setStatus(StatusEnum.ENABLED.getKey());
|
||||
initGrade.setGrade(0);
|
||||
initGrade.setMerchantId(0);
|
||||
// initGrade.setMerchantId(0);
|
||||
initGrade.setSpeedPoint(1f);
|
||||
initGrade.setDiscount(0f);
|
||||
}
|
||||
|
@ -214,13 +214,13 @@ public class BackendUserGradeController extends BaseController {
|
||||
|
||||
info.setGrade(Integer.parseInt(grade));
|
||||
info.setName(name);
|
||||
info.setMerchantId(accountInfo.getMerchantId());
|
||||
// info.setMerchantId(accountInfo.getMerchantId());
|
||||
if (StringUtil.isNotEmpty(catchType)) {
|
||||
info.setCatchType(catchType);
|
||||
}
|
||||
if (StringUtil.isNotEmpty(condition)) {
|
||||
info.setCatchCondition(condition);
|
||||
}
|
||||
// if (StringUtil.isNotEmpty(condition)) {
|
||||
// info.setCatchCondition(condition);
|
||||
// }
|
||||
if (StringUtil.isNotEmpty(privilege)) {
|
||||
info.setUserPrivilege(privilege);
|
||||
}
|
||||
|
@ -650,6 +650,7 @@ import {
|
||||
let exchangePoints_sum = new BigNumber(res.exchangePoints_sum);
|
||||
allPoints = allPoints.plus(exchangePoints_sum);
|
||||
}
|
||||
// todo 计算
|
||||
if (res.exchangeAmount_sum) {
|
||||
let exchangeAmount_sum = new BigNumber(res.exchangeAmount_sum);
|
||||
allAmout = allAmout.plus(exchangeAmount_sum);
|
||||
|
@ -109,6 +109,8 @@
|
||||
<script>
|
||||
import config from '@/config'
|
||||
import request from '../../utils/request'
|
||||
// import BigNumber from BigNumber
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
|
Loading…
Reference in New Issue
Block a user