From ad4cc050c77b41637d1ac445c7dc6922c3e63624 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期三, 02 七月 2025 09:17:59 +0800
Subject: [PATCH] Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/HongRuiTang into 2.0
---
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopStaffServiceImpl.java | 99 ++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 92 insertions(+), 7 deletions(-)
diff --git a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopStaffServiceImpl.java b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopStaffServiceImpl.java
index 2e21710..7d46d76 100644
--- a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopStaffServiceImpl.java
+++ b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopStaffServiceImpl.java
@@ -4,17 +4,20 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.utils.bean.BeanUtils;
-import com.ruoyi.shop.domain.pojo.shop.ShopRelTag;
import com.ruoyi.shop.domain.pojo.shop.ShopStaff;
import com.ruoyi.shop.mapper.shop.ShopStaffMapper;
import com.ruoyi.shop.service.shop.ShopStaffService;
-import com.ruoyi.system.api.RemoteMemberService;
+import com.ruoyi.system.api.domain.dto.AppEditUserDto;
+import com.ruoyi.system.api.domain.dto.CodeGetDto;
import com.ruoyi.system.api.domain.dto.MerEditUserDto;
-import com.ruoyi.system.api.domain.poji.member.Member;
+import com.ruoyi.system.api.domain.dto.MgtShopStaffEditDto;
import com.ruoyi.system.api.domain.poji.shop.Shop;
import com.ruoyi.system.api.domain.vo.MerStaffInfoVo;
-import org.springframework.beans.factory.annotation.Autowired;
+import com.ruoyi.system.api.service.RemoteFileService;
+import com.ruoyi.system.api.service.RemoteSysStaffService;
+import com.ruoyi.system.api.service.RemoteUserService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -31,6 +34,17 @@
public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff> implements ShopStaffService {
+ @Resource
+ private ShopStaffMapper shopStaffMapper;
+
+ @Resource
+ private RemoteUserService remoteUserService;
+
+ @Resource
+ private RemoteSysStaffService remoteSysStaffService;
+
+ @Resource
+ private RemoteFileService remoteFileService;
/**
*
* @param userId
@@ -43,6 +57,18 @@
return this.getOne(queryWrapper,false);
}
+ /**
+ * 通过手机号获取商户员工
+ * @param mobile
+ * @return
+ */
+ @Override
+ public ShopStaff getByMobile(String mobile){
+ LambdaQueryWrapper<ShopStaff> queryWrapper = Wrappers.lambdaQuery();
+ queryWrapper.eq(ShopStaff::getDelFlag, 0).eq(ShopStaff::getStaffMobile, mobile);
+ return this.getOne(queryWrapper,false);
+ }
+
/**
* 获取商户员工信息
@@ -50,16 +76,32 @@
* @return
*/
@Override
- public MerStaffInfoVo getShopStaffInfo(Long userId){
+ public MerStaffInfoVo getShopStaffInfo(Long userId,Shop shop){
MerStaffInfoVo merStaffInfoVo = new MerStaffInfoVo();
ShopStaff shopStaff = this.getByUserId(userId);
BeanUtils.copyProperties(shopStaff,merStaffInfoVo);
-
+ merStaffInfoVo.setShopName(shop.getShopName());
+ merStaffInfoVo.setShopAddress(shop.getShopAddress());
+ merStaffInfoVo.setShopServicePhone(shop.getShopServicePhone());
+ merStaffInfoVo.setBusinessTime(shop.getBusinessStartTime()+"-"+shop.getBusinessEndTime());
+ merStaffInfoVo.setShopType(shop.getShopType());
+ merStaffInfoVo.setShopNumber(shop.getShopNumber());
+ if(StringUtils.isNotBlank(shop.getShopCode())){
+ merStaffInfoVo.setShopCodeUrl(shop.getShopCode());
+ }else{
+ CodeGetDto codeGetDto = new CodeGetDto();
+ String url = "https://wxapp.hhhrt.cn/mini/shop?id="+shop.getShopId();
+ codeGetDto.setUrl(url);
+ codeGetDto.setFileName("shop-"+shop.getShopId());
+ String codeUrl = remoteFileService.getAppOrderTotal(codeGetDto).getData();
+ merStaffInfoVo.setShopCodeUrl(codeUrl);
+ shopStaffMapper.updateShopCodeUrl(shop.getShopId(),codeUrl);
+ }
return merStaffInfoVo;
}
/**
- *
+ * 编辑商户员工信息
* @param merEditUserDto
*/
@Override
@@ -79,7 +121,50 @@
case 4:
shopStaff.setStaffBirthday(merEditUserDto.getEditValue());
break;
+ default:
+ break;
}
this.saveOrUpdate(shopStaff);
+ //同步修改系统用户表
+ AppEditUserDto appEditUserDto = new AppEditUserDto();
+ appEditUserDto.setEditType(merEditUserDto.getEditType());
+ appEditUserDto.setEditValue(merEditUserDto.getEditValue());
+ appEditUserDto.setUserId(merEditUserDto.getUserId());
+ remoteUserService.editUserInfo(appEditUserDto);
+ //同步修改平台员工表
+ remoteSysStaffService.editUserInfo(merEditUserDto);
+ }
+
+ /**
+ * 清空商户员工关联
+ * @param shopId
+ */
+ @Override
+ public void clearShopStaffRelation(Long shopId){
+ shopStaffMapper.clearShopStaffRelation(shopId);
+ }
+
+ /**
+ * @description 修改商户员工信息
+ * @author jqs
+ * @date 2023/7/19 19:03
+ * @param mgtShopStaffEditDto
+ * @return void
+ */
+ @Override
+ public void editMgtShopStaff(MgtShopStaffEditDto mgtShopStaffEditDto){
+ ShopStaff shopStaff = this.getByUserId(mgtShopStaffEditDto.getUserId());
+ if(shopStaff!=null){
+ if(StringUtils.isNotBlank(mgtShopStaffEditDto.getStaffName())){
+ shopStaff.setStaffName(mgtShopStaffEditDto.getStaffName());
+ }
+ if(StringUtils.isNotBlank(mgtShopStaffEditDto.getStaffMobile())){
+ shopStaff.setStaffMobile(mgtShopStaffEditDto.getStaffMobile());
+ }
+ if(StringUtils.isNotBlank(mgtShopStaffEditDto.getStaffAvatar())){
+ shopStaff.setStaffAvatar(mgtShopStaffEditDto.getStaffAvatar());
+ }
+ this.saveOrUpdate(shopStaff);
+ }
}
}
--
Gitblit v1.7.1