维修流程

This commit is contained in:
13405411873 2024-11-04 16:48:31 +08:00
parent a2fbf98de6
commit 768c09b0e4
6 changed files with 59 additions and 64 deletions

View File

@ -195,11 +195,9 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
*/
@Override
public ShopMallPartners shopInfoByUserId() throws Exception {
LoginUser user = SecurityFrameworkUtils.getLoginUser();
ShopMallPartners partner = new ShopMallPartners();
LambdaQueryWrapper<ShopMallPartners> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ShopMallPartners::getUserId, user.getId());
partner = this.getOne(queryWrapper);
queryWrapper.orderByDesc(ShopMallPartners::getPartnerId).last("limit 1");
ShopMallPartners partner = this.getOne(queryWrapper);
if (ObjectUtil.isEmpty(partner)){
throw new Exception("未查询到信息");
}
@ -1452,8 +1450,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
InspectionInfo info = inspectionInfoService.getById(inspectionInfoId);
OrderInfo order = orderService.getById(info.getInspectionOrderId());
AdminUserDO buyUser = userService.getUser(info.getUserId());
PartnerWorker temp = partnerWorkerService.getById(info.getWorkId());
AdminUserDO worker = userService.getUser(temp.getUserId());
AdminUserDO worker = userService.getUser(info.getWorkId());
InspectionInfoVo res =new InspectionInfoVo();
BeanUtils.copyProperties(order,res);
res.setInspectionId(info.getId());

View File

@ -120,14 +120,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
public int insertInspectionInfo(InspectionInfo inspectionInfo) throws Exception {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
ShopMallPartners partners = appInspectionPartnerService.shopInfo();
// LambdaQueryWrapper<PartnerWorker> workerQueryWrapper =new LambdaQueryWrapper<>();
// workerQueryWrapper.eq(PartnerWorker::getUserId,loginUser.getId()).eq(PartnerWorker::getPartnerId,partners.getPartnerId());
// PartnerWorker worker = workerService.getOne(workerQueryWrapper);
// if (ObjectUtils.isNotEmpty(worker)){
// inspectionInfo.setWorkId(worker.getId());
// }else {
// throw new Exception("请先将接待员加入员工");
// }
if (ObjectUtils.isEmpty(inspectionInfo.getInspectionWorkNodes())) {
throw new RuntimeException("请选择检测项目");
}

View File

@ -9,6 +9,7 @@ import cn.iocoder.yudao.framework.security.config.SecurityProperties;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.partner.entity.PartnerWorker;
import cn.iocoder.yudao.util.RedisCache;
import cn.iocoder.yudao.module.rescue.domain.DriverInfo;
import cn.iocoder.yudao.module.rescue.domain.LoginBody;
@ -81,8 +82,6 @@ public class SysLoginController {
@Resource
private PermissionApi permissionApi;
@Resource
private PasswordEncoder passwordEncoder;
@Resource
private RoleApi roleApi;
@ -577,50 +576,23 @@ public class SysLoginController {
map.put("driverInfo", driverInfo);
return success(map);
}
//
//
// /**
// * 获取检测工用户信息
// *
// * @return 用户信息
// */
// @GetMapping("/getJcWorkerInfo")
// public AjaxResult getJcWorkerInfo()
// {
// AjaxResult ajax = success();
// LambdaQueryWrapper<PartnerWorker> queryWrapper =new LambdaQueryWrapper<>();
// SysUser user = SecurityUtils.getLoginUser().getUser();
// queryWrapper.eq(PartnerWorker::getUserId,user.getUserId());
// PartnerWorker worker = jcWorkerService.getOne(queryWrapper);
// if (ObjectUtil.isNotEmpty(worker)){
// LambdaQueryWrapper<ShopMallPartners> queryWrapper1 =new LambdaQueryWrapper<>();
// queryWrapper1.eq(ShopMallPartners::getPartnerId,worker.getPartnerId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
// ShopMallPartners partner = partnersService.getOne(queryWrapper1);
// if (ObjectUtil.isEmpty(partner)){
// return error("信息有误");
// }
// ajax.put("partnerInfo", partner);
// }else {
// return error("信息有误");
// }
// SysUser sysUser = userService.selectUserById(user.getUserId());
//
// ajax.put("user", sysUser);
//
// return ajax;
// }
// /**
// * 获取路由信息
// *
// * @return 路由信息
// */
// @GetMapping("getRouters")
// public CommonResult getRouters()
// {
// Long userId = SecurityFrameworkUtils.getLoginUserId();
// List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
// return AjaxResult.success(menuService.buildMenus(menus));
// }
/**
* 获取检测工用户信息
*
* @return 用户信息
*/
@GetMapping("/getJcWorkerInfo")
public CommonResult getJcWorkerInfo()
{
LoginUser user = SecurityFrameworkUtils.getLoginUser();
Map<String, Object> map = new HashMap<>();
map.put("partnerId", user.getTenantId());
map.put("user", user);
return CommonResult.success(map);
}
@PostMapping("/wxLogin")
public CommonResult wxLogin(@RequestBody WxLoginBody wxLoginBody) {

View File

@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.system.dal.mysql.user;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO;
import cn.iocoder.yudao.module.system.controller.app.user.UserInfoVO;
@ -30,7 +32,15 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
}
default AdminUserDO selectByMobile(String mobile) {
return getUserByMobileWithoutTenant(mobile);
Long tenantId=null;
try {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
tenantId = loginUser.getTenantId();
}catch (Exception e){
}
return getUserByMobileWithoutTenant(mobile,tenantId);
}
default PageResult<AdminUserDO> selectPage(UserPageReqVO reqVO, Collection<Long> deptIds) {
@ -65,7 +75,7 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
AdminUserDO selectUserByPhone(String phone);
AdminUserDO getUserByMobileWithoutTenant(String phoneNumber);
AdminUserDO getUserByMobileWithoutTenant(@Param("phoneNumber") String phoneNumber,@Param("tenantId") Long tenantId);
int updateSetOpenId(@Param("userId")Long userId,@Param("openId")String openId);

View File

@ -10,6 +10,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import cn.iocoder.yudao.module.infra.api.config.ConfigApi;
@ -298,6 +300,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
@Override
public AdminUserDO getUserByMobile(String mobile) {
return userMapper.selectByMobile(mobile);
}
@ -451,7 +454,15 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
if (StrUtil.isBlank(mobile)) {
return;
}
AdminUserDO user = userMapper.getUserByMobileWithoutTenant(mobile);
Long tenantId=null;
try {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
tenantId = loginUser.getTenantId();
}catch (Exception e){
}
AdminUserDO user = userMapper.getUserByMobileWithoutTenant(mobile,tenantId);
if (user == null) {
return;
}
@ -562,7 +573,15 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
@Override
public AdminUserDO getUserByMobileWithoutTenant(String phoneNumber) {
return userMapper.getUserByMobileWithoutTenant(phoneNumber);
Long tenantId=null;
try {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
tenantId = loginUser.getTenantId();
}catch (Exception e){
}
return userMapper.getUserByMobileWithoutTenant(phoneNumber,tenantId);
}
/**

View File

@ -69,6 +69,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
system_users
WHERE
mobile = #{phoneNumber}
<if test="tenantId!=null">
and tenant_id = #{tenantId}
</if>
AND deleted = 0
limit 1
</select>
</mapper>