feat(Property): 添加小程序工单处理功能
This commit is contained in:
@@ -44,11 +44,21 @@ public class SaPermissionImpl implements StpInterface {
|
||||
} else if (isResidentMatch) {
|
||||
// 居民匹配时的逻辑
|
||||
return Arrays.asList(
|
||||
"resident:person:list",
|
||||
"resident:person:add",
|
||||
"resident:person:query",
|
||||
"resident:person:edit",
|
||||
"resident:person:remove"
|
||||
// 入驻员工管理
|
||||
"xcx:person:list",
|
||||
"xcx:person:add",
|
||||
"xcx:person:query",
|
||||
"xcx:person:edit",
|
||||
"xcx:person:remove",
|
||||
// 入驻单位管理
|
||||
"xcx:unit:query",
|
||||
// 工单管理
|
||||
"xcx:workOrders:add",
|
||||
"xcx:workOrders:query",
|
||||
// 工单类型管理
|
||||
"xcx:workOrdersType:query",
|
||||
// 文件上传
|
||||
"system:oss:upload"
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package org.dromara.property.controller;
|
||||
package org.dromara.property.controller.residentController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
@@ -1,4 +1,4 @@
|
||||
package org.dromara.property.controller;
|
||||
package org.dromara.property.controller.residentController;
|
||||
|
||||
import java.util.List;
|
||||
|
@@ -56,9 +56,9 @@ public class XResidentPersonController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单位未审核入驻员工列表
|
||||
* 查询入驻员工列表
|
||||
*/
|
||||
@SaCheckPermission("resident:person:list")
|
||||
@SaCheckPermission("xcx:person:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ResidentPersonVo> list(ResidentPersonBo bo, PageQuery pageQuery) {
|
||||
return residentPersonService.queryPageList(bo, pageQuery);
|
||||
@@ -69,7 +69,7 @@ public class XResidentPersonController extends BaseController {
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("resident:person:query")
|
||||
@SaCheckPermission("xcx:person:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<ResidentPersonVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
@@ -79,7 +79,7 @@ public class XResidentPersonController extends BaseController {
|
||||
/**
|
||||
* 新增入驻员工
|
||||
*/
|
||||
@SaCheckPermission("resident:person:add")
|
||||
@SaCheckPermission("xcx:person:add")
|
||||
@Log(title = "入驻员工", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
@@ -90,7 +90,7 @@ public class XResidentPersonController extends BaseController {
|
||||
/**
|
||||
* 修改入驻员工
|
||||
*/
|
||||
@SaCheckPermission("resident:person:edit")
|
||||
@SaCheckPermission("xcx:person:edit")
|
||||
@Log(title = "入驻员工", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
@@ -103,7 +103,7 @@ public class XResidentPersonController extends BaseController {
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("resident:person:remove")
|
||||
@SaCheckPermission("xcx:person:remove")
|
||||
@Log(title = "入驻员工", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
|
@@ -0,0 +1,107 @@
|
||||
package org.dromara.property.controller.xcx;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.excel.utils.ExcelUtil;
|
||||
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.web.core.BaseController;
|
||||
import org.dromara.property.domain.bo.residentBo.ResidentUnitBo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentUnitVo;
|
||||
import org.dromara.property.service.residentService.IResidentUnitService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 入驻单位
|
||||
* 前端访问路由地址为:/property/resident_unit
|
||||
*
|
||||
* @author mocheng
|
||||
* @since 2025-06-19
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/xcx/unit")
|
||||
public class XResidentUnitController extends BaseController {
|
||||
|
||||
private final IResidentUnitService residentUnitService;
|
||||
|
||||
/**
|
||||
* 查询入驻单位列表
|
||||
*/
|
||||
@SaCheckPermission("property:resident_unit:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ResidentUnitVo> list(ResidentUnitBo bo, PageQuery pageQuery) {
|
||||
return residentUnitService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出入驻单位列表
|
||||
*/
|
||||
@SaCheckPermission("property:resident_unit:export")
|
||||
@Log(title = "入驻单位", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ResidentUnitBo bo, HttpServletResponse response) {
|
||||
List<ResidentUnitVo> list = residentUnitService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "入驻单位", ResidentUnitVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取入驻单位详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("xcx:unit:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<ResidentUnitVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(residentUnitService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增入驻单位
|
||||
*/
|
||||
@SaCheckPermission("property:resident_unit:add")
|
||||
@Log(title = "入驻单位", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ResidentUnitBo bo) {
|
||||
return toAjax(residentUnitService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改入驻单位
|
||||
*/
|
||||
@SaCheckPermission("property:resident_unit:edit")
|
||||
@Log(title = "入驻单位", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ResidentUnitBo bo) {
|
||||
return toAjax(residentUnitService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除入驻单位
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("property:resident_unit:remove")
|
||||
@Log(title = "入驻单位", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("ids") Long[] ids) {
|
||||
return toAjax(residentUnitService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
package org.dromara.property.controller.xcx;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.property.domain.bo.ServiceWorkOrdersBo;
|
||||
import org.dromara.property.domain.vo.ServiceWorkOrdersVo;
|
||||
import org.dromara.property.service.IServiceWorkOrdersService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【业务管理-工单处理】
|
||||
*
|
||||
* @author mocheng
|
||||
* @since 2025-07-07
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/xcx/workOrders")
|
||||
public class XServiceWorkOrdersController extends BaseController {
|
||||
|
||||
private final IServiceWorkOrdersService serviceWorkOrdersService;
|
||||
|
||||
/**
|
||||
* 小程序新增【工单处理】
|
||||
*/
|
||||
@PostMapping()
|
||||
@SaCheckPermission("xcx:workOrders:add")
|
||||
@Log(title = "【小程序新增工单处理】", businessType = BusinessType.INSERT)
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ServiceWorkOrdersBo bo) {
|
||||
return toAjax(serviceWorkOrdersService.insertOrderByXcx(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序查询【工单处理】
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@SaCheckPermission("xcx:workOrders:query")
|
||||
public R<List<ServiceWorkOrdersVo>> list() {
|
||||
return R.ok(serviceWorkOrdersService.queryMyOrderByXcx());
|
||||
}
|
||||
}
|
@@ -0,0 +1,60 @@
|
||||
package org.dromara.property.controller.xcx;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.excel.utils.ExcelUtil;
|
||||
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.web.core.BaseController;
|
||||
import org.dromara.property.domain.bo.ServiceWorkOrdersTypeBo;
|
||||
import org.dromara.property.domain.vo.ServiceWorkOrdersTypeVo;
|
||||
import org.dromara.property.service.IServiceWorkOrdersTypeService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【工单类型】
|
||||
* 前端访问路由地址为:/property/workOrdersType
|
||||
*
|
||||
* @author mocheng
|
||||
* @since 2025-07-09
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/xcx/workOrdersType")
|
||||
public class XServiceWorkOrdersTypeController extends BaseController {
|
||||
|
||||
private final IServiceWorkOrdersTypeService serviceWorkOrdersTypeService;
|
||||
|
||||
/**
|
||||
* 获取【工单类型】详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("xcx:workOrdersType:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<ServiceWorkOrdersTypeVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(serviceWorkOrdersTypeService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【工单类型】树结构
|
||||
*/
|
||||
@GetMapping("/typeTree")
|
||||
public R<List<ServiceWorkOrdersTypeVo>> typeTree() {
|
||||
return R.ok(serviceWorkOrdersTypeService.typeTree());
|
||||
}
|
||||
}
|
@@ -124,7 +124,7 @@ public class ResidentPersonBo extends BaseEntity {
|
||||
/**
|
||||
* 人员标签类型
|
||||
*/
|
||||
private Integer rosterType = 2;
|
||||
private Integer rosterType;
|
||||
|
||||
/**
|
||||
* 用户角色(1管理员2普通用户)
|
||||
@@ -135,4 +135,9 @@ public class ResidentPersonBo extends BaseEntity {
|
||||
* 是否审核通过(1通过2不通过)
|
||||
*/
|
||||
private Integer isAudit;
|
||||
|
||||
/**
|
||||
* 审核状态(1已处理2待处理)
|
||||
*/
|
||||
private Integer isAuditState;
|
||||
}
|
||||
|
@@ -92,10 +92,17 @@ public class ResidentPerson extends TenantEntity {
|
||||
* 用户角色(1管理员2普通用户)
|
||||
*/
|
||||
private Integer userRoles;
|
||||
|
||||
/**
|
||||
* 是否审核通过(1通过2不通过)
|
||||
*/
|
||||
private Integer isAudit;
|
||||
|
||||
/**
|
||||
* 审核状态(1已处理2待处理)
|
||||
*/
|
||||
private Integer isAuditState;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
@@ -158,5 +158,13 @@ public class ResidentPersonVo implements Serializable {
|
||||
*/
|
||||
private Integer isAudit;
|
||||
|
||||
/**
|
||||
* 审核状态(1已处理2待处理)
|
||||
*/
|
||||
private Integer isAuditState;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
@@ -103,4 +103,20 @@ public interface IServiceWorkOrdersService {
|
||||
* @return 【工单处理】分页列表
|
||||
*/
|
||||
TableDataInfo<MServiceWorkOrdersVo> queryMobilePageList(ServiceWorkOrdersBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* xcx新增报事报修
|
||||
*
|
||||
* @param bo bean
|
||||
* @return Boolean
|
||||
*/
|
||||
Boolean insertOrderByXcx(ServiceWorkOrdersBo bo);
|
||||
|
||||
|
||||
/**
|
||||
* xcx查询本人上报工单
|
||||
*
|
||||
* @return list
|
||||
*/
|
||||
List<ServiceWorkOrdersVo> queryMyOrderByXcx();
|
||||
}
|
||||
|
@@ -19,6 +19,7 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.redis.utils.RedisUtils;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.property.api.model.LoginResidentPerson;
|
||||
import org.dromara.property.domain.*;
|
||||
import org.dromara.property.domain.bo.ServiceWorkOrdersBo;
|
||||
import org.dromara.property.domain.bo.mobile.MServiceWorkOrdersBo;
|
||||
@@ -34,6 +35,7 @@ import org.dromara.property.mapper.ServiceWorkOrdersRecordMapper;
|
||||
import org.dromara.property.mapper.ServiceWorkOrdersTypeMapper;
|
||||
import org.dromara.property.mapper.attendanceMapper.AttendanceUserGroupMapper;
|
||||
import org.dromara.property.service.IServiceWorkOrdersService;
|
||||
import org.dromara.property.service.IServiceWorkOrdersTypeService;
|
||||
import org.dromara.system.api.RemoteUserService;
|
||||
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||
import org.dromara.system.api.model.LoginUser;
|
||||
@@ -64,6 +66,10 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
private RemoteUserService remoteUserService;
|
||||
private final AttendanceUserGroupMapper attendanceUserGroupMapper;
|
||||
|
||||
/******************************xcx**************************************/
|
||||
private final IServiceWorkOrdersTypeService serviceWorkOrdersTypeService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询【工单处理】
|
||||
*
|
||||
@@ -227,7 +233,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
boolean flags = workOrdersRecordMapper.insert(serviceWorkOrdersRecord) > 0;
|
||||
if (flags) {
|
||||
if (serviceWorkOrdersType.getOperationMode().equals(OrderTypeOperationEnum.AUTOMATE_DISPATCH.getValue())) {
|
||||
handleServiceWorkOrder(add,serviceWorkOrdersType);
|
||||
handleServiceWorkOrder(add, serviceWorkOrdersType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -235,7 +241,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
}
|
||||
|
||||
//自动派单
|
||||
private void handleServiceWorkOrder(ServiceWorkOrders serviceWorkOrders,ServiceWorkOrdersType serviceWorkOrdersType) {
|
||||
private void handleServiceWorkOrder(ServiceWorkOrders serviceWorkOrders, ServiceWorkOrdersType serviceWorkOrdersType) {
|
||||
LocalDate today = LocalDate.now();
|
||||
// 1. 获取今日排班人员(优先查缓存,未命中则查询数据库并缓存)
|
||||
List<AttendanceUserGroup> attendanceUserGroups = RedisUtils.getCacheList(DateUtil.today());
|
||||
@@ -246,8 +252,8 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
.eq(AttendanceUserGroup::getDeptId, serviceWorkOrdersType.getDeptId())
|
||||
.orderByAsc(AttendanceUserGroup::getStartDate)
|
||||
);
|
||||
if (CollUtil.isEmpty(attendanceUserGroups)|| attendanceUserGroups.size() != attendanceUserGroupList.size()) {
|
||||
attendanceUserGroups=attendanceUserGroupList;
|
||||
if (CollUtil.isEmpty(attendanceUserGroups) || attendanceUserGroups.size() != attendanceUserGroupList.size()) {
|
||||
attendanceUserGroups = attendanceUserGroupList;
|
||||
Assert.isTrue(CollUtil.isNotEmpty(attendanceUserGroups), "暂无排班人员");
|
||||
// 缓存当天排班数据(假设当天不会变)
|
||||
RedisUtils.setCacheList(DateUtil.today(), attendanceUserGroups);
|
||||
@@ -591,7 +597,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
boolean flags = workOrdersRecordMapper.insert(serviceWorkOrdersRecord) > 0;
|
||||
if (flags) {
|
||||
if (serviceWorkOrdersType.getOperationMode().equals(OrderTypeOperationEnum.AUTOMATE_DISPATCH.getValue())) {
|
||||
handleServiceWorkOrder(add,serviceWorkOrdersType);
|
||||
handleServiceWorkOrder(add, serviceWorkOrdersType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -695,4 +701,64 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
mServiceWorkOrdersVo.setRecordVoList(mServiceWorkOrdersRecordVos);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* xcx新增报事报修
|
||||
*
|
||||
* @param bo bean
|
||||
* @return Boolean
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertOrderByXcx(ServiceWorkOrdersBo bo) {
|
||||
ServiceWorkOrders add = MapstructUtils.convert(bo, ServiceWorkOrders.class);
|
||||
Assert.notNull(add, "数据处理失败");
|
||||
|
||||
ServiceWorkOrdersTypeVo typeVo = serviceWorkOrdersTypeService.queryById(bo.getType());
|
||||
Assert.notNull(typeVo, "工单类型不存在");
|
||||
|
||||
assert add != null;
|
||||
add.setOrderNo("GD" + IdUtil.getSnowflakeNextIdStr());
|
||||
add.setStatus(WorkOrderStatusEnum.CREATE_ORDER.getValue());
|
||||
add.setReportingType(OrderReportingTypeEnum.PHONE_REPORT.getValue());
|
||||
|
||||
LoginResidentPerson person = LoginHelper.getLoginResident();
|
||||
Assert.notNull(person, "用户信息不存在");
|
||||
assert person != null;
|
||||
add.setInitiatorPeople(person.getNickname());
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
ServiceWorkOrdersRecord serviceWorkOrdersRecord = new ServiceWorkOrdersRecord();
|
||||
serviceWorkOrdersRecord.setOrderId(add.getId());
|
||||
serviceWorkOrdersRecord.setStatus(add.getStatus());
|
||||
boolean flags = workOrdersRecordMapper.insert(serviceWorkOrdersRecord) > 0;
|
||||
if (flags) {
|
||||
if (typeVo.getOperationMode().equals(OrderTypeOperationEnum.AUTOMATE_DISPATCH.getValue())) {
|
||||
ServiceWorkOrdersType type = MapstructUtils.convert(typeVo, ServiceWorkOrdersType.class);
|
||||
assert type != null;
|
||||
handleServiceWorkOrder(add, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* xcx查询本人上报工单
|
||||
*
|
||||
* @return list
|
||||
*/
|
||||
@Override
|
||||
public List<ServiceWorkOrdersVo> queryMyOrderByXcx() {
|
||||
LoginResidentPerson person = LoginHelper.getLoginResident();
|
||||
Assert.notNull(person, "用户信息不存在");
|
||||
|
||||
LambdaQueryWrapper<ServiceWorkOrders> qw = new LambdaQueryWrapper<>();
|
||||
assert person != null;
|
||||
qw.like(ServiceWorkOrders::getInitiatorPeople, person.getNickname())
|
||||
.orderByDesc(ServiceWorkOrders::getCreateTime);
|
||||
return baseMapper.selectVoList(qw);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -27,10 +27,7 @@ import org.dromara.property.service.residentService.IResidentPersonService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 入驻员工Service业务层处理
|
||||
@@ -117,16 +114,19 @@ public class ResidentPersonServiceImpl implements IResidentPersonService {
|
||||
LambdaQueryWrapper<ResidentPerson> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(ResidentPerson::getCreateTime)
|
||||
.orderByDesc(ResidentPerson::getUpdateTime);
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUserName()), ResidentPerson::getUserName, bo.getUserName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPhone()), ResidentPerson::getPhone, bo.getPhone());
|
||||
lqw.eq(bo.getGender() != null, ResidentPerson::getGender, bo.getGender());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getImg()), ResidentPerson::getImg, bo.getImg());
|
||||
lqw.eq(bo.getUnitId() != null, ResidentPerson::getUnitId, bo.getUnitId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUnitName()), ResidentPerson::getUnitName, bo.getUnitName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLocathon()), ResidentPerson::getLocathon, bo.getLocathon());
|
||||
lqw.eq(bo.getTime() != null, ResidentPerson::getTime, bo.getTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCarNumber()), ResidentPerson::getCarNumber, bo.getCarNumber());
|
||||
lqw.eq(bo.getState() != null, ResidentPerson::getState, bo.getState());
|
||||
lqw.eq(bo.getUnitId() != null, ResidentPerson::getUnitId, bo.getUnitId());
|
||||
lqw.eq(bo.getGender() != null, ResidentPerson::getGender, bo.getGender());
|
||||
lqw.eq(bo.getIsAudit() != null, ResidentPerson::getIsAudit, bo.getIsAudit());
|
||||
lqw.eq(bo.getIsAuditState() != null, ResidentPerson::getIsAuditState, bo.getIsAuditState());
|
||||
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getImg()), ResidentPerson::getImg, bo.getImg());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPhone()), ResidentPerson::getPhone, bo.getPhone());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLocathon()), ResidentPerson::getLocathon, bo.getLocathon());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUnitName()), ResidentPerson::getUnitName, bo.getUnitName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCarNumber()), ResidentPerson::getCarNumber, bo.getCarNumber());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUserName()), ResidentPerson::getUserName, bo.getUserName());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@@ -148,15 +148,15 @@ public class ResidentPersonServiceImpl implements IResidentPersonService {
|
||||
// 首次入驻新用户权限组默认使用公司权限
|
||||
ResidentUnitVo ruVo = residentUnitService.queryById(bo.getUnitId());
|
||||
// 密码加密,不存明文密码
|
||||
if (Objects.equals(add.getPassword(), "") || add.getPassword() == null){
|
||||
if (Objects.equals(add.getPassword(), "") || add.getPassword() == null) {
|
||||
add.setPassword(BCrypt.hashpw("123456"));
|
||||
}else {
|
||||
} else {
|
||||
add.setPassword(BCrypt.hashpw(add.getPassword()));
|
||||
}
|
||||
//查询该单位下是否有管理员
|
||||
new LambdaQueryWrapper<ResidentPerson>().eq(ResidentPerson::getUnitId, bo.getUnitId())
|
||||
.eq(ResidentPerson::getUserRoles, 1);
|
||||
|
||||
// 添加入驻时间
|
||||
add.setTime(new Date());
|
||||
add.setUnitName(ruVo.getName());
|
||||
add.setAuthGroupId(ruVo.getAuthGroupId());
|
||||
add.setAuthBegDate(ruVo.getAuthBegDate());
|
||||
add.setAuthEndDate(ruVo.getAuthEndDate());
|
||||
|
Reference in New Issue
Block a user