feat(property): 新增入驻员工登录功能
This commit is contained in:
@@ -9,8 +9,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.excel.core.ExcelResult;
|
||||
import org.dromara.property.domain.vo.ResidentPersonImportVo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonImportVo;
|
||||
import org.dromara.property.listener.ResidentPersonImportListener;
|
||||
import org.dromara.property.utils.UploadFaceUtil;
|
||||
import org.springframework.http.MediaType;
|
||||
@@ -26,8 +25,8 @@ import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.property.domain.vo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.bo.ResidentPersonBo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.bo.residentBo.ResidentPersonBo;
|
||||
import org.dromara.property.service.IResidentPersonService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
@@ -17,8 +17,8 @@ import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.property.domain.vo.ResidentUnitVo;
|
||||
import org.dromara.property.domain.bo.ResidentUnitBo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentUnitVo;
|
||||
import org.dromara.property.domain.bo.residentBo.ResidentUnitBo;
|
||||
import org.dromara.property.service.IResidentUnitService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
|
@@ -0,0 +1,114 @@
|
||||
package org.dromara.property.controller.xcx;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.property.api.model.LoginResidentPerson;
|
||||
import org.dromara.property.domain.bo.residentBo.ResidentPersonBo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.property.service.IResidentPersonService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 移动端访问入驻员工
|
||||
* 前端访问路由地址为:/property/person
|
||||
*
|
||||
* @author mocheng
|
||||
* @since 2025-06-19
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/xcx/person")
|
||||
public class XResidentPersonController extends BaseController {
|
||||
|
||||
private final IResidentPersonService residentPersonService;
|
||||
/**
|
||||
* 获取登录员工信息
|
||||
*/
|
||||
@GetMapping("/getInfo")
|
||||
public R<ResidentPersonVo> getInfo() {
|
||||
LoginResidentPerson loginUser = LoginHelper.getLoginResident();
|
||||
ResidentPersonVo vo = new ResidentPersonVo();
|
||||
assert loginUser != null;
|
||||
vo.setId(loginUser.getUserId());
|
||||
vo.setUserName(loginUser.getUsername());
|
||||
vo.setUserRoles(loginUser.getUserRoles());
|
||||
vo.setUnitId(loginUser.getUnitId());
|
||||
vo.setUnitName(loginUser.getUnitName());
|
||||
return R.ok(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单位未审核入驻员工列表
|
||||
*/
|
||||
@SaCheckPermission("resident:person:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ResidentPersonVo> list(ResidentPersonBo bo, PageQuery pageQuery) {
|
||||
return residentPersonService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取入驻员工详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("resident:person:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<ResidentPersonVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(residentPersonService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增入驻员工
|
||||
*/
|
||||
@SaCheckPermission("resident:person:add")
|
||||
@Log(title = "入驻员工", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ResidentPersonBo bo) {
|
||||
return toAjax(residentPersonService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改入驻员工
|
||||
*/
|
||||
@SaCheckPermission("resident:person:edit")
|
||||
@Log(title = "入驻员工", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ResidentPersonBo bo) {
|
||||
return toAjax(residentPersonService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除入驻员工
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("resident:person:remove")
|
||||
@Log(title = "入驻员工", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("ids") Long[] ids) {
|
||||
return toAjax(residentPersonService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
package org.dromara.property.domain.bo;
|
||||
package org.dromara.property.domain.bo.residentBo;
|
||||
|
||||
import org.dromara.property.domain.ResidentPerson;
|
||||
import org.dromara.property.domain.entity.resident.ResidentPerson;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
@@ -114,7 +114,7 @@ public class ResidentPersonBo extends BaseEntity {
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Long state = 1L;
|
||||
private Integer state = 1;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
@@ -129,9 +129,10 @@ public class ResidentPersonBo extends BaseEntity {
|
||||
/**
|
||||
* 用户角色(1管理员2普通用户)
|
||||
*/
|
||||
private String userRoles;
|
||||
private Integer userRoles;
|
||||
|
||||
/**
|
||||
* 是否审核通过(1通过2不通过)
|
||||
*/
|
||||
private String isAudit;
|
||||
private Integer isAudit;
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
package org.dromara.property.domain.bo;
|
||||
package org.dromara.property.domain.bo.residentBo;
|
||||
|
||||
import org.dromara.property.domain.ResidentUnit;
|
||||
import org.dromara.property.domain.entity.resident.ResidentUnit;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
@@ -1,4 +1,4 @@
|
||||
package org.dromara.property.domain;
|
||||
package org.dromara.property.domain.entity.resident;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
@@ -87,15 +87,15 @@ public class ResidentPerson extends TenantEntity {
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Long state;
|
||||
private Integer state;
|
||||
/**
|
||||
* 用户角色(1管理员2普通用户)
|
||||
*/
|
||||
private String userRoles;
|
||||
private Integer userRoles;
|
||||
/**
|
||||
* 是否审核通过(1通过2不通过)
|
||||
*/
|
||||
private String isAudit;
|
||||
private Integer isAudit;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
@@ -1,4 +1,4 @@
|
||||
package org.dromara.property.domain;
|
||||
package org.dromara.property.domain.entity.resident;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
@@ -2,11 +2,9 @@ package org.dromara.property.domain.vo;
|
||||
|
||||
import org.dromara.property.domain.MeetParticipants;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
@@ -1,17 +1,13 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
package org.dromara.property.domain.vo.residentVo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.property.domain.ResidentPerson;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
@@ -1,7 +1,8 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
package org.dromara.property.domain.vo.residentVo;
|
||||
|
||||
import java.util.Date;
|
||||
import org.dromara.property.domain.ResidentPerson;
|
||||
|
||||
import org.dromara.property.domain.entity.resident.ResidentPerson;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
@@ -11,7 +12,6 @@ import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 入驻员工视图对象 resident_person
|
||||
*
|
||||
@@ -102,7 +102,7 @@ public class ResidentPersonVo implements Serializable {
|
||||
* 状态
|
||||
*/
|
||||
@ExcelProperty(value = "状态")
|
||||
private Long state;
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
@@ -143,5 +143,20 @@ public class ResidentPersonVo implements Serializable {
|
||||
*/
|
||||
private Integer rosterType;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 用户角色(1管理员2普通用户)
|
||||
*/
|
||||
private Integer userRoles;
|
||||
|
||||
/**
|
||||
* 是否审核通过(1通过2不通过)
|
||||
*/
|
||||
private Integer isAudit;
|
||||
|
||||
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
package org.dromara.property.domain.vo.residentVo;
|
||||
|
||||
import java.util.Date;
|
||||
import org.dromara.property.domain.ResidentUnit;
|
||||
import org.dromara.property.domain.entity.resident.ResidentUnit;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
@@ -1,12 +1,16 @@
|
||||
package org.dromara.property.dubbo;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.tenant.helper.TenantHelper;
|
||||
import org.dromara.property.api.RemoteResidentPersonService;
|
||||
import org.dromara.property.api.domain.vo.RemoteResidentPersonVo;
|
||||
import org.dromara.property.domain.bo.ResidentPersonBo;
|
||||
import org.dromara.property.domain.vo.ResidentPersonVo;
|
||||
import org.dromara.property.api.model.LoginResidentPerson;
|
||||
import org.dromara.property.domain.bo.residentBo.ResidentPersonBo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.common.core.exception.residentPerson.ResidentPersonException;
|
||||
import org.dromara.property.service.IResidentPersonService;
|
||||
|
||||
import java.util.List;
|
||||
@@ -52,4 +56,44 @@ public class RemoteResidentPersonServiceImpl implements RemoteResidentPersonServ
|
||||
return residentPersonService.updateByBo(bo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过手机号查询用户信息
|
||||
*
|
||||
* @param phone 手机号
|
||||
* @param tenantId 租户id
|
||||
* @return 结果
|
||||
*/
|
||||
public LoginResidentPerson getResidentPersonInfo(String phone, String tenantId) throws ResidentPersonException {
|
||||
return TenantHelper.dynamic(tenantId, () -> {
|
||||
ResidentPersonVo vo = residentPersonService.queryByPhone(phone, tenantId);
|
||||
if (ObjectUtil.isEmpty(vo)) {
|
||||
throw new ResidentPersonException("入驻员工");
|
||||
}
|
||||
if (vo.getIsAudit() == null || vo.getIsAudit() != 1) {
|
||||
throw new ResidentPersonException("当前员工未审核");
|
||||
}
|
||||
|
||||
if (vo.getState() == 0) {
|
||||
throw new ResidentPersonException("当前员工账号被禁用");
|
||||
}
|
||||
|
||||
if (vo.getState() == 2) {
|
||||
throw new ResidentPersonException("当前员工已离职");
|
||||
}
|
||||
|
||||
LoginResidentPerson login = new LoginResidentPerson();
|
||||
login.setTenantId(tenantId);
|
||||
login.setUserId(vo.getId());
|
||||
login.setUsername(vo.getUserName());
|
||||
login.setNickname(vo.getUserName());
|
||||
login.setPassword(vo.getPassword());
|
||||
login.setUserRoles(vo.getUserRoles());
|
||||
login.setUnitId(vo.getUnitId());
|
||||
login.setUnitName(vo.getUnitName());
|
||||
login.setUserType("resident_person");
|
||||
return login;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -15,14 +15,13 @@ import org.dromara.common.core.utils.ValidatorUtils;
|
||||
import org.dromara.common.excel.core.ExcelListener;
|
||||
import org.dromara.common.excel.core.ExcelResult;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.property.domain.bo.ResidentPersonBo;
|
||||
import org.dromara.property.domain.vo.ResidentPersonImportVo;
|
||||
import org.dromara.property.domain.vo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.vo.ResidentUnitVo;
|
||||
import org.dromara.property.domain.bo.residentBo.ResidentPersonBo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonImportVo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentUnitVo;
|
||||
import org.dromara.property.service.IResidentPersonService;
|
||||
import org.dromara.property.service.IResidentUnitService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -69,7 +68,7 @@ public class ResidentPersonImportListener extends AnalysisEventListener<Resident
|
||||
if (person == null) { // 判断当前单位是否已存在该用户
|
||||
ResidentPersonBo bo = BeanUtil.toBean(personVo, ResidentPersonBo.class);
|
||||
ValidatorUtils.validate(bo);
|
||||
bo.setState(1L);
|
||||
bo.setState(1);
|
||||
bo.setUnitId(unitId);
|
||||
bo.setTime(new Date());
|
||||
bo.setUnitName(unitVo.getName().trim());
|
||||
|
@@ -1,8 +1,8 @@
|
||||
package org.dromara.property.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.dromara.property.domain.ResidentPerson;
|
||||
import org.dromara.property.domain.vo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.entity.resident.ResidentPerson;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
|
@@ -1,8 +1,8 @@
|
||||
package org.dromara.property.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.dromara.property.domain.ResidentUnit;
|
||||
import org.dromara.property.domain.vo.ResidentUnitVo;
|
||||
import org.dromara.property.domain.entity.resident.ResidentUnit;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentUnitVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package org.dromara.property.service;
|
||||
|
||||
import org.dromara.property.domain.vo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.bo.ResidentPersonBo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.bo.residentBo.ResidentPersonBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
@@ -24,6 +24,15 @@ public interface IResidentPersonService {
|
||||
*/
|
||||
ResidentPersonVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询入驻员工
|
||||
*
|
||||
* @param phone 手机号
|
||||
* @param tenantId 租户id
|
||||
* @return 入驻员工
|
||||
*/
|
||||
ResidentPersonVo queryByPhone(String phone, String tenantId);
|
||||
|
||||
/**
|
||||
* 分页查询入驻员工列表
|
||||
*
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package org.dromara.property.service;
|
||||
|
||||
import org.dromara.property.domain.ResidentUnit;
|
||||
import org.dromara.property.domain.vo.ResidentUnitVo;
|
||||
import org.dromara.property.domain.bo.ResidentUnitBo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentUnitVo;
|
||||
import org.dromara.property.domain.bo.residentBo.ResidentUnitBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
@@ -13,7 +12,7 @@ import java.util.List;
|
||||
* 入驻单位Service接口
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-19
|
||||
* @since 2025-06-19
|
||||
*/
|
||||
public interface IResidentUnitService {
|
||||
|
||||
|
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.*;
|
||||
import org.dromara.property.domain.entity.resident.ResidentPerson;
|
||||
import org.dromara.property.domain.vo.CapitalInfoVo;
|
||||
import org.dromara.property.mapper.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@@ -17,13 +17,13 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.property.domain.*;
|
||||
import org.dromara.property.domain.bo.CostCarChargeBo;
|
||||
import org.dromara.property.domain.bo.CostChargeReturnFeeBo;
|
||||
import org.dromara.property.domain.entity.resident.ResidentPerson;
|
||||
import org.dromara.property.domain.enums.ChargeStatusEnum;
|
||||
import org.dromara.property.domain.vo.CostCarChargeVo;
|
||||
import org.dromara.property.domain.vo.CostItemsVo;
|
||||
import org.dromara.property.mapper.*;
|
||||
import org.dromara.property.service.ICostCarChargeService;
|
||||
import org.dromara.system.api.RemoteUserService;
|
||||
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -31,8 +31,6 @@ import java.math.BigDecimal;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 费用-车辆收费Service业务层处理
|
||||
|
@@ -17,11 +17,12 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.*;
|
||||
import org.dromara.property.domain.bo.CostChargeReturnFeeBo;
|
||||
import org.dromara.property.domain.entity.resident.ResidentPerson;
|
||||
import org.dromara.property.domain.enums.ChargeStatusEnum;
|
||||
import org.dromara.property.domain.vo.*;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.property.mapper.*;
|
||||
import org.dromara.system.api.RemoteUserService;
|
||||
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.bo.CostHouseChargeBo;
|
||||
import org.dromara.property.service.ICostHouseChargeService;
|
||||
|
@@ -11,15 +11,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.property.domain.CostReturnPayFee;
|
||||
import org.dromara.property.domain.CustomerContingenPlan;
|
||||
import org.dromara.property.domain.CustomerContingenPlanRecord;
|
||||
import org.dromara.property.domain.ResidentPerson;
|
||||
import org.dromara.property.domain.entity.resident.ResidentPerson;
|
||||
import org.dromara.property.domain.bo.CustomerContingenPlanBo;
|
||||
import org.dromara.property.domain.vo.CustomerContingenPlanRecordVo;
|
||||
import org.dromara.property.domain.vo.CustomerContingenPlanVo;
|
||||
import org.dromara.property.domain.vo.ResidentUnitVo;
|
||||
import org.dromara.property.mapper.CustomerContingenPlanMapper;
|
||||
import org.dromara.property.mapper.CustomerContingenPlanRecordMapper;
|
||||
import org.dromara.property.mapper.ResidentPersonMapper;
|
||||
|
@@ -24,9 +24,8 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.property.domain.*;
|
||||
import org.dromara.property.domain.bo.InspectionPlanBo;
|
||||
import org.dromara.property.domain.bo.InspectionPlanStaffBo;
|
||||
import org.dromara.property.domain.bo.MachineMaintainPlanBo;
|
||||
import org.dromara.property.domain.bo.MachineMaintainPlanStaffBo;
|
||||
import org.dromara.property.domain.vo.*;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.property.mapper.*;
|
||||
import org.dromara.property.service.IInspectionPlanService;
|
||||
import org.dromara.system.api.RemoteUserService;
|
||||
|
@@ -11,9 +11,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.MachineMaintainTask;
|
||||
import org.dromara.property.domain.MachineType;
|
||||
import org.dromara.property.domain.vo.*;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.property.mapper.MachineLocationMapper;
|
||||
import org.dromara.property.mapper.MachineTypeMapper;
|
||||
import org.dromara.property.mapper.ResidentPersonMapper;
|
||||
|
@@ -14,15 +14,15 @@ import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.property.domain.MeetAttach;
|
||||
import org.dromara.property.domain.MeetAttachOrder;
|
||||
import org.dromara.property.domain.MeetBooking;
|
||||
import org.dromara.property.domain.bo.MeetBookingBo;
|
||||
import org.dromara.property.domain.vo.*;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentUnitVo;
|
||||
import org.dromara.property.mapper.*;
|
||||
import org.dromara.property.service.IMeetBookingService;
|
||||
import org.dromara.system.api.RemoteUserService;
|
||||
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
@@ -11,10 +11,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.bo.MeetBookingBo;
|
||||
import org.dromara.property.domain.vo.MeetBookingVo;
|
||||
import org.dromara.property.domain.vo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.vo.ResidentUnitVo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentUnitVo;
|
||||
import org.dromara.property.mapper.MeetBookingMapper;
|
||||
import org.dromara.property.mapper.ResidentPersonMapper;
|
||||
import org.dromara.property.mapper.ResidentUnitMapper;
|
||||
@@ -27,8 +26,6 @@ import org.dromara.property.service.IMeetParticipantsService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 会议室参会记录Service业务层处理
|
||||
|
@@ -1,10 +1,8 @@
|
||||
package org.dromara.property.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@@ -16,8 +14,6 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.MeetAttach;
|
||||
import org.dromara.property.domain.MeetBooking;
|
||||
import org.dromara.property.domain.vo.MeetAttachVo;
|
||||
import org.dromara.property.domain.vo.ResidentPersonVo;
|
||||
import org.dromara.property.mapper.*;
|
||||
import org.dromara.system.api.RemoteUserService;
|
||||
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||
@@ -34,7 +30,6 @@ import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package org.dromara.property.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.crypto.digest.BCrypt;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
@@ -11,16 +12,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.Questionnaire;
|
||||
import org.dromara.property.domain.vo.ResidentUnitVo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentUnitVo;
|
||||
import org.dromara.property.service.IResidentUnitService;
|
||||
import org.dromara.sis.api.RemoteSisAuthService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.bo.ResidentPersonBo;
|
||||
import org.dromara.property.domain.vo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.ResidentPerson;
|
||||
import org.dromara.property.domain.bo.residentBo.ResidentPersonBo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.entity.resident.ResidentPerson;
|
||||
import org.dromara.property.mapper.ResidentPersonMapper;
|
||||
import org.dromara.property.service.IResidentPersonService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -59,7 +59,23 @@ public class ResidentPersonServiceImpl implements IResidentPersonService {
|
||||
*/
|
||||
@Override
|
||||
public ResidentPersonVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
ResidentPersonVo residentPersonVo = baseMapper.selectVoById(id);
|
||||
residentPersonVo.setPassword(null);
|
||||
return residentPersonVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询入驻员工
|
||||
*
|
||||
* @param phone 手机号
|
||||
* @param tenantId 租户id
|
||||
* @return 入驻员工
|
||||
*/
|
||||
@Override
|
||||
public ResidentPersonVo queryByPhone(String phone, String tenantId) {
|
||||
return baseMapper.selectVoOne(new LambdaQueryWrapper<ResidentPerson>()
|
||||
.eq(ResidentPerson::getPhone, phone)
|
||||
.eq(ResidentPerson::getTenantId, tenantId));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,6 +89,9 @@ public class ResidentPersonServiceImpl implements IResidentPersonService {
|
||||
public TableDataInfo<ResidentPersonVo> queryPageList(ResidentPersonBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ResidentPerson> lqw = buildQueryWrapper(bo);
|
||||
Page<ResidentPersonVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
result.getRecords().forEach(s -> {
|
||||
s.setPassword(null);
|
||||
});
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@@ -85,7 +104,11 @@ public class ResidentPersonServiceImpl implements IResidentPersonService {
|
||||
@Override
|
||||
public List<ResidentPersonVo> queryList(ResidentPersonBo bo) {
|
||||
LambdaQueryWrapper<ResidentPerson> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
List<ResidentPersonVo> residentPersonVos = baseMapper.selectVoList(lqw);
|
||||
residentPersonVos.forEach(s -> {
|
||||
s.setPassword(null);
|
||||
});
|
||||
return residentPersonVos;
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ResidentPerson> buildQueryWrapper(ResidentPersonBo bo) {
|
||||
@@ -123,10 +146,11 @@ public class ResidentPersonServiceImpl implements IResidentPersonService {
|
||||
|
||||
// 首次入驻新用户权限组默认使用公司权限
|
||||
ResidentUnitVo ruVo = residentUnitService.queryById(bo.getUnitId());
|
||||
add.setPassword("123456");
|
||||
// 密码加密,不存明文密码
|
||||
add.setPassword(BCrypt.hashpw("123456"));
|
||||
//查询该单位下是否有管理员
|
||||
new LambdaQueryWrapper<ResidentPerson>().eq(ResidentPerson::getUnitId, bo.getUnitId())
|
||||
.eq(ResidentPerson::getUserRoles, "1");
|
||||
.eq(ResidentPerson::getUserRoles, 1);
|
||||
|
||||
add.setAuthGroupId(ruVo.getAuthGroupId());
|
||||
add.setAuthBegDate(ruVo.getAuthBegDate());
|
||||
@@ -188,7 +212,7 @@ public class ResidentPersonServiceImpl implements IResidentPersonService {
|
||||
private void validEntityBeforeSave(ResidentPerson entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
LambdaQueryWrapper<ResidentPerson> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(ResidentPerson::getIdCard, entity.getUserName())
|
||||
lqw.eq(ResidentPerson::getPhone, entity.getPhone())
|
||||
.eq(ResidentPerson::getUnitId, entity.getUnitId());
|
||||
boolean exists = baseMapper.exists(lqw);
|
||||
Assert.isTrue(!exists, "当前单位,{}已入驻!", entity.getUserName());
|
||||
|
@@ -10,14 +10,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.ResidentPerson;
|
||||
import org.dromara.property.domain.entity.resident.ResidentPerson;
|
||||
import org.dromara.property.mapper.ResidentPersonMapper;
|
||||
import org.dromara.property.service.IResidentPersonService;
|
||||
import org.dromara.property.service.ITbRoomService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.bo.ResidentUnitBo;
|
||||
import org.dromara.property.domain.vo.ResidentUnitVo;
|
||||
import org.dromara.property.domain.ResidentUnit;
|
||||
import org.dromara.property.domain.bo.residentBo.ResidentUnitBo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentUnitVo;
|
||||
import org.dromara.property.domain.entity.resident.ResidentUnit;
|
||||
import org.dromara.property.mapper.ResidentUnitMapper;
|
||||
import org.dromara.property.service.IResidentUnitService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -32,7 +32,7 @@ import java.util.stream.Collectors;
|
||||
* 入驻单位Service业务层处理
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-19
|
||||
* @since 2025-06-19
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@@ -139,16 +139,16 @@ public class ResidentUnitServiceImpl implements IResidentUnitService {
|
||||
|
||||
/**
|
||||
* 新增一个管理员
|
||||
* @param unit
|
||||
* @param unit 入驻单位
|
||||
*/
|
||||
private void addResidentPerson(ResidentUnit unit) {
|
||||
ResidentPerson residentPerson = new ResidentPerson();
|
||||
residentPerson.setUserName(unit.getContactPerson());
|
||||
residentPerson.setPhone(unit.getPhone().toString());
|
||||
residentPerson.setGender(1L);
|
||||
residentPerson.setState(2L);
|
||||
residentPerson.setUserRoles("1");
|
||||
residentPerson.setIsAudit("1");
|
||||
residentPerson.setState(2);
|
||||
residentPerson.setUserRoles(1);
|
||||
residentPerson.setIsAudit(1);
|
||||
residentPerson.setAuthGroupId(unit.getAuthGroupId());
|
||||
residentPerson.setAuthBegDate(unit.getAuthBegDate());
|
||||
residentPerson.setAuthEndDate(unit.getAuthEndDate());
|
||||
|
@@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.ResidentUnit;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.bo.ServerBookingBo;
|
||||
import org.dromara.property.domain.vo.ServerBookingVo;
|
||||
|
@@ -301,6 +301,7 @@ public class TbMeterRecordServiceImpl implements ITbMeterRecordService {
|
||||
private Map<String, Object> trendMonthData(String floorId, String meterId, Long meterType, String year) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
List<Map<String, Object>> monthList = baseMapper.getMonthTrend(StrUtil.isBlank(floorId) ? null : Long.parseLong(floorId), StrUtil.isBlank(meterId) ? null : Long.parseLong(meterId), meterType, year);
|
||||
log.info("year:{},monthList:{}", year, monthList);
|
||||
List<String[]> monthData = new ArrayList<>();
|
||||
monthList.forEach(item -> monthData.add(new String[]{item.get("month").toString(), item.get("total_consumption").toString()}));
|
||||
Float total = monthList.stream().map(map -> new BigDecimal(map.get("total_consumption").toString())).reduce(BigDecimal::add).orElse(BigDecimal.ZERO).floatValue();
|
||||
|
@@ -13,7 +13,7 @@ import org.dromara.property.domain.InspectionTask;
|
||||
import org.dromara.property.domain.bo.InspectionPlanBo;
|
||||
import org.dromara.property.domain.vo.InspectionPlanStaffVo;
|
||||
import org.dromara.property.domain.vo.InspectionPlanVo;
|
||||
import org.dromara.property.domain.vo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.property.mapper.InspectionPlanStaffMapper;
|
||||
import org.dromara.property.mapper.InspectionTaskMapper;
|
||||
import org.dromara.property.mapper.ResidentPersonMapper;
|
||||
@@ -21,10 +21,6 @@ import org.dromara.property.service.IInspectionPlanService;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
@@ -35,8 +31,6 @@ import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.dromara.common.mybatis.core.mapper.BaseMapperPlus.log;
|
||||
|
||||
/**
|
||||
* @Author:yuyongle
|
||||
* @Date:2025/7/11 15:28
|
||||
|
@@ -14,7 +14,7 @@ import org.dromara.property.domain.MachineMaintainTask;
|
||||
import org.dromara.property.domain.bo.MachineMaintainPlanBo;
|
||||
import org.dromara.property.domain.vo.MachineMaintainPlanStaffVo;
|
||||
import org.dromara.property.domain.vo.MachineMaintainPlanVo;
|
||||
import org.dromara.property.domain.vo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.property.mapper.MachineMaintainPlanStaffMapper;
|
||||
import org.dromara.property.mapper.MachineMaintainTaskMapper;
|
||||
import org.dromara.property.mapper.ResidentPersonMapper;
|
||||
@@ -22,10 +22,6 @@ import org.dromara.property.service.IMachineMaintainPlanService;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
@@ -36,8 +32,6 @@ import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.dromara.common.mybatis.core.mapper.BaseMapperPlus.log;
|
||||
|
||||
/**
|
||||
* @Author:yuyongle
|
||||
* @Date:2025/7/17 09:25
|
||||
|
@@ -4,8 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.property.domain.bo.ResidentPersonBo;
|
||||
import org.dromara.property.domain.vo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.bo.residentBo.ResidentPersonBo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.property.service.IResidentPersonService;
|
||||
import org.dromara.resource.api.RemoteFileService;
|
||||
import org.dromara.resource.api.domain.RemoteFile;
|
||||
|
@@ -53,8 +53,8 @@
|
||||
<if test="meterId != '' and meterId != null">
|
||||
AND a.meter_id = #{meterId}
|
||||
</if>
|
||||
GROUP BY MONTH(reading_time)
|
||||
ORDER BY `month`;
|
||||
GROUP BY `month`
|
||||
ORDER BY `month`
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
Reference in New Issue
Block a user