优化项

This commit is contained in:
cun-nan 2024-01-06 10:02:09 +08:00
parent 681381d60b
commit 0596e7f689
9 changed files with 59 additions and 18 deletions

View File

@ -726,17 +726,15 @@ export default {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id) {
getUserPhone({mobile:this.form.mobile}).then( response => {
if (response.data) {
updateUser(this.form).then(response => {
if (response.data==1){
this.$modal.msgSuccess("修改会员成功");
this.open = false;
this.getList();
}else {
this.$modal.msgError("手机号已存在");
} else {
updateUser(this.form).then(response => {
this.$modal.msgSuccess("修改会员成功");
this.open = false;
this.getList();
});
}
})
});
} else {
getUserPhone({mobile:this.form.mobile}).then( response => {
if(response.data){

View File

@ -236,6 +236,14 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
OilOrder oilOrder1 = null;
LJOrder ljOrder1 = null;
// 根据店铺id查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId);
if (ObjectUtil.isEmpty(merchantConfig)){
orders.put("error","请先配置支付通道");
return orders;
}
// 添加商品订单信息
if (!goodsOrder.equals("[]")){
LJOrder ljOrder = new LJOrder();
@ -358,8 +366,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
if (list.size()>0){
oilConfigService.oilRule();
}
// 根据店铺id查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId);
// 处理支付需要的数据
Map<String,String> map1 = new HashMap<>();
map1.put("authCode",map.get("authCode"));

View File

@ -116,6 +116,7 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
}
List<Map<String, Object>> list1 = new ArrayList<>();
List<Map<String, Object>> list2 = new ArrayList<>();
Integer storeId = null;
if (StringUtils.isNotEmpty(map.get("storeId"))){
@ -138,6 +139,7 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
store.setOilList(oilNumberNameVos);
Map<String,Object> map1 = new HashMap<>();
map1.put("store",store);
if (StringUtils.isNotEmpty(store.getLatitude()) && StringUtils.isNotEmpty(store.getLongitude())){
double dLat1 = Math.toRadians(Double.parseDouble(store.getLatitude()) - lat);
double dLon1 = Math.toRadians(Double.parseDouble(store.getLongitude()) - lon);
@ -149,8 +151,10 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
double c1 = 2 * Math.atan2(Math.sqrt(a1), Math.sqrt(1 - a1));
distance = earthRadius * c1;
map1.put("distance",distance);
map1.put("store",store);
list1.add(map1);
}else {
map1.put("distance","");
list2.add(map1);
}
}
@ -161,6 +165,9 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
return Double.compare(Double.parseDouble(o1.get("distance").toString()), Double.parseDouble(o2.get("distance").toString()));
}
});
for (Map<String, Object> stringObjectMap : list2) {
list1.add(stringObjectMap);
}
}
}
return list1;

View File

@ -117,6 +117,14 @@ public interface LJUserService extends IService<LJUser> {
*/
public int updateUser(LJUserVo user);
/**
* 根据用户id和手机号查询用户信息
* @param mobile
* @param userId
* @return
*/
LJUser selectUserByMobileAndUserId(String mobile,Integer userId);
/**
* 登录用户修改会员信息自己修改
* @param user

View File

@ -322,6 +322,12 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
*/
@Override
public int updateUser(LJUserVo userVo) {
int row = 0;
LJUser user1 = this.selectUserByMobileAndUserId(userVo.getMobile(), userVo.getId());
if (ObjectUtil.isNotEmpty(user1)){
row = 0;
return row;
}
LJUser user = new LJUser();
user.setId(userVo.getId());
user.setUserNo(userVo.getUserNo());
@ -338,7 +344,7 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
user.setStatus(userVo.getStatus());
user.setDescription(userVo.getDescription());
user.setOfficial(userVo.getOfficial());
int row = baseMapper.updateById(user);
row = baseMapper.updateById(user);
// 修改认证会员手机号
CertifiedMember certifiedMember = new CertifiedMember();
certifiedMember.setUserId(userVo.getId());
@ -357,6 +363,14 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
return row;
}
@Override
public LJUser selectUserByMobileAndUserId(String mobile, Integer userId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("mobile",mobile);
queryWrapper.eq("id",userId);
return baseMapper.selectOne(queryWrapper);
}
@Override
public int editUser(LJUser user) {
return baseMapper.updateById(user);

View File

@ -2557,6 +2557,12 @@
this.dialogVisiblej = false;
return;
}
if (response.data.error=="请先配置支付通道"){
this.$modal.msgError(response.data.error)
this.loading = false;
this.dialogVisiblej = false;
return;
}
})
this.loading = true;
_this.queryPayStatus();

View File

@ -223,10 +223,11 @@
if (uni.getStorageSync("storeId")) {
this.storeId = uni.getStorageSync("storeId")
} else {
let storeId = "12";
let storeId = "34";
uni.setStorageSync("storeId", storeId)
}
// this.isExistStoreId()
}
this.getUserAuthority();
this.getOilType();

View File

@ -210,9 +210,9 @@
},
//
getStore(id){
uni.showToast({
title:333
})
// uni.showToast({
// title:333
// })
let _this = this;
request({
url: "business/storeInformation/store/queryStoreById",

View File

@ -32,7 +32,7 @@
<view class="top-right-icon" v-if="index == 0">
<u-tag text="距离最近" size="mini" type="error" plain plainFill></u-tag>
</view>
<view class="box-hui" style="width: 80px;">{{(Math.ceil(item.distance)).toFixed(1)}}km
<view class="box-hui" style="width: 80px;">{{item.distance?(Math.ceil(item.distance)).toFixed(1)+"km":""}}
</view>
</view>