更新
This commit is contained in:
parent
9aa8a2bcce
commit
d0209a7944
@ -257,4 +257,13 @@ public class InspectionInfoController extends BaseController {
|
||||
inspectionWorkNodeService.recheck(inspectionWorkNode);
|
||||
return success("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前登陆人是否有重检、重审、退办理的权限(app)
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("isExamine")
|
||||
public CommonResult isExamine(){
|
||||
return success(inspectionInfoService.isExamine());
|
||||
}
|
||||
}
|
||||
|
@ -159,8 +159,10 @@ public class PartnerOwnController extends BaseController {
|
||||
* 检测线图
|
||||
*/
|
||||
@GetMapping("/chartInfoRatio")
|
||||
public CommonResult chartInfoRatio(Long partnerId,String unit)
|
||||
{
|
||||
public CommonResult chartInfoRatio(Long partnerId,String unit) throws Exception {
|
||||
if (ObjectUtil.isNull(partnerId)) {
|
||||
partnerId = partnerList.shopInfoByUserId().getPartnerId();
|
||||
}
|
||||
return success(partnerList.chartInfoRatio(partnerId, unit));
|
||||
}
|
||||
/**
|
||||
|
@ -103,4 +103,10 @@ public interface IInspectionInfoService extends IService<InspectionInfo>
|
||||
* @return
|
||||
*/
|
||||
List<InspectionWorkNode> getWeorkNodesById(Integer inspectionId);
|
||||
|
||||
/**
|
||||
* 判断app当前检测人是否有审核权限
|
||||
* @return
|
||||
*/
|
||||
Boolean isExamine();
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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.appBase.controller.admin.InspectionSocket;
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerMain;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerMainService;
|
||||
@ -54,6 +55,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_CUS;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
*
|
||||
@ -137,13 +140,14 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
AdminUserDO workerUser = userService.getUser(loginUser.getId());
|
||||
String buyName = StringUtils.isNotEmpty(inspectionInfo.getBuyName()) ? inspectionInfo.getBuyName() : "未知客户";
|
||||
String buyPhone = StringUtils.isNotEmpty(inspectionInfo.getBuyPhone()) ? inspectionInfo.getBuyPhone() : StringUtils.isNotEmpty(inspectionInfo.getBuyName()) ? inspectionInfo.getBuyName() : "无";
|
||||
AdminUserDO user = userService.getUserByMobile(buyPhone);
|
||||
AdminUserDO user = getAdminUserDO(buyPhone);
|
||||
if (ObjectUtils.isEmpty(user)) {
|
||||
//新增用户
|
||||
UserSaveReqVO userSaveReqVO = new UserSaveReqVO();
|
||||
userSaveReqVO.setNickname(buyName);
|
||||
userSaveReqVO.setUsername(buyPhone);
|
||||
userSaveReqVO.setMobile(buyPhone);
|
||||
userSaveReqVO.setUserType(USER_TYPE_CUS);
|
||||
userSaveReqVO.setPassword("123456");
|
||||
Long uid = userService.createUser(userSaveReqVO);
|
||||
inspectionInfo.setUserId(uid);
|
||||
@ -183,7 +187,9 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
inspectionInfo.setPartnerId(partners.getPartnerId());
|
||||
inspectionInfo.setWorkerName(workerUser.getNickname());
|
||||
inspectionInfo.setWorkerPhone(workerUser.getMobile());
|
||||
inspectionInfo.setStartTime(new Date());
|
||||
if (ObjectUtil.isNull(inspectionInfo.getStartTime())) {
|
||||
inspectionInfo.setStartTime(new Date());
|
||||
}
|
||||
inspectionInfo.setCategoryId(goods.getGoodsCategoryId());
|
||||
inspectionInfo.setStatus("0");
|
||||
inspectionInfo.setWorkId(workerUser.getId());
|
||||
@ -271,6 +277,12 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
return save ? 1 : 0;
|
||||
}
|
||||
|
||||
@TenantIgnore
|
||||
private AdminUserDO getAdminUserDO(String buyPhone) {
|
||||
AdminUserDO user = userService.getUserByMobileTenantIgnore(buyPhone);
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void settleAccounts(Long InspectionId) {
|
||||
@ -309,7 +321,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
// }
|
||||
String buyName = StringUtils.isNotEmpty(inspectionInfo.getBuyName()) ? inspectionInfo.getBuyName() : "未知客户";
|
||||
String buyPhone = StringUtils.isNotEmpty(inspectionInfo.getBuyPhone()) ? inspectionInfo.getBuyPhone() : StringUtils.isNotEmpty(inspectionInfo.getBuyName()) ? inspectionInfo.getBuyName() : "无";
|
||||
AdminUserDO user = userService.getUserByMobile(buyPhone);
|
||||
AdminUserDO user = getAdminUserDO(buyPhone);
|
||||
if (ObjectUtils.isEmpty(user)) {
|
||||
//新增用户
|
||||
UserSaveReqVO userSaveReqVO = new UserSaveReqVO();
|
||||
@ -424,6 +436,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
|
||||
/**
|
||||
* 获取工单详情
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@ -453,4 +466,29 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
public List<InspectionWorkNode> getWeorkNodesById(Integer inspectionId) {
|
||||
return workNodeService.getWeorkNodesById(inspectionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断app当前检测人是否有审核权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean isExamine() {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
//获取当前登陆人的所有角色
|
||||
List<UserRoleDO> userRoles = roleService.getByUserId(loginUser.getId());
|
||||
List<Long> userRoleIds = userRoles.stream().map(UserRoleDO::getRoleId).collect(Collectors.toList());
|
||||
List<RoleDO> roleList = roleService.getRoleList(userRoleIds);
|
||||
|
||||
//判断当前角色集合中的code是否包含jcyszz
|
||||
if (CollectionUtil.isNotEmpty(roleList)) {
|
||||
List<RoleDO> filteredRoleList = roleList.stream()
|
||||
.filter(role -> role.getCode().contains("jcsfdl"))
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(filteredRoleList)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -91,10 +91,10 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
||||
|
||||
//查询用户 信息
|
||||
//修改工单表中当前施工人
|
||||
inspectionInfo.setWorkId(workerUser.getId());
|
||||
inspectionInfo.setWorkerName(workerUser.getNickname());
|
||||
inspectionInfo.setWorkerPhone(workerUser.getMobile());
|
||||
inspectionInfoService.updateById(inspectionInfo);
|
||||
// inspectionInfo.setWorkId(workerUser.getId());
|
||||
// inspectionInfo.setWorkerName(workerUser.getNickname());
|
||||
// inspectionInfo.setWorkerPhone(workerUser.getMobile());
|
||||
// inspectionInfoService.updateById(inspectionInfo);
|
||||
|
||||
// //新增步骤
|
||||
// //根据projectId查询项目名称
|
||||
|
@ -80,4 +80,6 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
int updateSetOpenId(@Param("userId")Long userId,@Param("openId")String openId);
|
||||
|
||||
int updateCusInfo(@Param("entity") UserInfoVO userInfoVO);
|
||||
|
||||
AdminUserDO getUserByMobileTenantIgnore(String mobile);
|
||||
}
|
||||
|
@ -145,6 +145,13 @@ public interface AdminUserService extends IService<AdminUserDO> {
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
AdminUserDO getUserByMobile(String mobile);
|
||||
/**
|
||||
* 通过手机号获取用户(不带租户id)
|
||||
*
|
||||
* @param mobile 手机号
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
AdminUserDO getUserByMobileTenantIgnore(String mobile);
|
||||
|
||||
/**
|
||||
* 获得用户分页列表
|
||||
|
@ -303,6 +303,11 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||
|
||||
return userMapper.selectByMobile(mobile);
|
||||
}
|
||||
@Override
|
||||
public AdminUserDO getUserByMobileTenantIgnore(String mobile) {
|
||||
|
||||
return userMapper.getUserByMobileTenantIgnore(mobile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<AdminUserDO> getUserPage(UserPageReqVO reqVO) {
|
||||
|
@ -75,4 +75,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND deleted = 0
|
||||
limit 1
|
||||
</select>
|
||||
<select id="getUserByMobileTenantIgnore"
|
||||
resultType="cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
system_users
|
||||
WHERE
|
||||
mobile = #{phoneNumber}
|
||||
AND deleted = 0
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user