liu 1 year ago
parent
commit
6fc3f3d840

+ 1 - 1
src/main/java/com/template/AutoCode.java

@@ -56,7 +56,7 @@ public class AutoCode {
         mpg.setPackageInfo(pc);
         //4、策略配置
         StrategyConfig strategy = new StrategyConfig();
-        strategy.setInclude("house_order_bill"); // 设置要映射的表名
+        strategy.setInclude("total_pass_word"); // 设置要映射的表名
         strategy.setNaming(NamingStrategy.underline_to_camel);//下划线转驼峰
         strategy.setColumnNaming(NamingStrategy.underline_to_camel);//下划线转驼峰
         strategy.setEntityLombokModel(true); // 自动lombok;

+ 25 - 0
src/main/java/com/template/api/TotalPassWordControllerAPI.java

@@ -0,0 +1,25 @@
+package com.template.api;
+
+import com.template.model.dto.TotalCardDto;
+import com.template.model.dto.TotalPassWordDto;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("/auto/total-pass-word")
+public interface TotalPassWordControllerAPI {
+
+    @PostMapping("/saveEmployeeTotalPassWord")
+    @ApiOperation(value = "添加员工总卡", notes = "添加员工总卡", httpMethod = "PSOT")
+    CommonResult saveEmployeeTotalPassWord(@RequestBody TotalPassWordDto dto);
+
+    @GetMapping("/deleteEmployeeTotalPassWord")
+    @ApiOperation(value = "删除员工总卡", notes = "删除员工总卡", httpMethod = "GET")
+    CommonResult deleteEmployeeTotalPassWord(@RequestParam Integer id);
+
+
+    @GetMapping("/listEmployeeTotalPassWord")
+    @ApiOperation(value = "员工总卡展示", notes = "员工总卡展示", httpMethod = "GET")
+    CommonResult listEmployeeTotalPassWord(@RequestParam Integer page,@RequestParam Integer size,String employeeName,Integer buildingId,String startTime,String endTime);
+
+}

+ 45 - 8
src/main/java/com/template/controller/HouseOrderController.java

@@ -248,6 +248,12 @@ public class HouseOrderController implements HouseOrderAPI {
                 if (!(time.isAfter(start) && time.isBefore(end) && time2.isAfter(end) && time2.isBefore(end2))) {
                     return CommonResult.fail("不支持跨天预定");
                 }
+
+                if (ObjectUtils.isEmpty(establishOrderDto.getIdentityType())||ObjectUtils.isEmpty(establishOrderDto.getReason())) {
+                    return CommonResult.fail("身份类型和原因不能为空");
+                }
+
+
             }
         }
 
@@ -417,6 +423,9 @@ public class HouseOrderController implements HouseOrderAPI {
 //      订单渠道  订单渠道(1:线上,2:线下)
         houseOrder.setOrderChannel("1");
 
+        houseOrder.setIdentityType(establishOrderDto.getIdentityType());
+        houseOrder.setReason(establishOrderDto.getReason());
+
         houseOrderService.save(houseOrder);
         houseNumberStateService.saveBatch(houseNumberStates);
 //            houseNumberService.updateBatchById(houseNumbers);
@@ -1654,8 +1663,10 @@ public class HouseOrderController implements HouseOrderAPI {
         headerRow.createCell(19).setCellValue("支付时间");
         headerRow.createCell(20).setCellValue("退款时间");
         headerRow.createCell(21).setCellValue("取消时间");
-        headerRow.createCell(22).setCellValue("来源");
-        headerRow.createCell(23).setCellValue("来源详情");
+        headerRow.createCell(22).setCellValue("身份类型");
+        headerRow.createCell(23).setCellValue("原因");
+        headerRow.createCell(24).setCellValue("来源");
+        headerRow.createCell(25).setCellValue("来源详情");
 
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         if (ObjectUtils.isNotEmpty(vos) && vos.size() > 0) {
@@ -1778,17 +1789,43 @@ public class HouseOrderController implements HouseOrderAPI {
                 } else {
                     dataRow1.createCell(21).setCellValue(sdf.format(cancelTime));
                 }
+                Integer identityType = vo.getIdentityType();
+                String identityName= "";
+                if (ObjectUtils.isNotEmpty(identityType)) {
+                    if (identityType==0) {
+                        identityName = "学生";
+                    } else if (identityType==1) {
+                        identityName = "学生家长";
+                    }else if (identityType==2) {
+                        identityName = "朋友";
+                    }else if (identityType==3) {
+                        identityName = "老师";
+                    }
+                    dataRow1.createCell(22).setCellValue(identityName);
+                }
+
+                Integer reason = vo.getReason();
+                String reasonName= "";
+                if (ObjectUtils.isNotEmpty(reason)) {
+                    if (reason==0) {
+                        reasonName = "探视";
+                    } else if (reason==1) {
+                        reasonName = "交流";
+                    }
+                    dataRow1.createCell(23).setCellValue(reasonName);
+                }
+
                 String[] arr=(vo.getSourceId()==null?"":vo.getSourceId()).split(",");
                 ArrayList<String> idList = new ArrayList<String>(Arrays.asList(arr)) ;
                 if(!StringUtils.hasText(vo.getSource())){
-                    dataRow1.createCell(22).setCellValue("自费");
-                    dataRow1.createCell(23).setCellValue("");
+                    dataRow1.createCell(24).setCellValue("自费");
+                    dataRow1.createCell(25).setCellValue("");
                 }else if ("1".equals(vo.getSource())){
                     vo.setSource("课表");
                     List<ClassSchedule> schedules=new ArrayList<>(classScheduleService.listByIds(idList));
                     String data = schedules.stream().peek((ClassSchedule u) -> u.setJsxm("姓名:"+u.getJsxm()+ ";工号:" + u.getJsgh() + ";课表日期:" + u.getDateTime() + ";备注:" + u.getRemark()+";")).map(ClassSchedule::getJsxm).collect(Collectors.joining("\r\n"));
-                    dataRow1.createCell(22).setCellValue("课表");
-                    dataRow1.createCell(23).setCellValue(data);
+                    dataRow1.createCell(24).setCellValue("课表");
+                    dataRow1.createCell(25).setCellValue(data);
                 } else if ("2".equals(vo.getSource())){
                     vo.setSource("流程");
                     List<ApplicationProcedureTemporaryVo> applicationProcedureTemporaries= new ArrayList<>();
@@ -1800,8 +1837,8 @@ public class HouseOrderController implements HouseOrderAPI {
                     String data = applicationProcedureTemporaries.stream().peek((ApplicationProcedureTemporaryVo u) ->
                             u.setUsersName("申请人姓名:"+u.getUsersName()+ ";申请人部门" + u.getOrgName() + ";房间数量:" + u.getHouseCount()
                                     + ";开始时间:" + u.getStartTime()+";结束时间"+u.getEndTime()+";审核状态:"+u.getStatus()+"(0:已拒绝,1:待审批,2:处理中,3:已同意);")).map(ApplicationProcedureTemporaryVo::getUsersName).collect(Collectors.joining("\r\n"));
-                    dataRow1.createCell(22).setCellValue("流程");
-                    dataRow1.createCell(23).setCellValue(data);
+                    dataRow1.createCell(24).setCellValue("流程");
+                    dataRow1.createCell(25).setCellValue(data);
                 }
             }
         }

+ 8 - 0
src/main/java/com/template/controller/LoginController.java

@@ -921,6 +921,11 @@ public class LoginController implements LoginControllerAPI {
                 functionPointVo15.setFunctionPoint("NFC设置");
                 functionPointVo15.setStatus(1);
                 vos8.add(functionPointVo15);
+
+                FunctionPointVo functionPointVo16 = new FunctionPointVo();
+                functionPointVo15.setFunctionPoint("下发管理员密码");
+                functionPointVo15.setStatus(1);
+                vos8.add(functionPointVo16);
             } else {
                 FunctionPointVo functionPointVo4 = ifContains(doorLockManagement, "4");
                 functionPointVo4.setFunctionPoint("查看界面");
@@ -955,6 +960,9 @@ public class LoginController implements LoginControllerAPI {
                 functionPointVo15.setFunctionPoint("NFC设置");
                 vos8.add(functionPointVo15);
 
+                FunctionPointVo functionPointVo16 = ifContains(doorLockManagement, "16");
+                functionPointVo15.setFunctionPoint("下发管理员密码");
+                vos8.add(functionPointVo16);
             }
 
             menuBarVo8.setFunctionPoints(vos8);

+ 240 - 0
src/main/java/com/template/controller/TotalPassWordController.java

@@ -0,0 +1,240 @@
+package com.template.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.template.api.TotalPassWordControllerAPI;
+import com.template.common.utils.PasswordChecker;
+import com.template.model.dto.KeyCardDto;
+import com.template.model.dto.KeyPassWordDto;
+import com.template.model.dto.TotalPassWordDto;
+import com.template.model.pojo.*;
+import com.template.model.result.CommonResult;
+import com.template.model.result.PageUtils;
+import com.template.model.vo.TotalCardPageVo;
+import com.template.model.vo.TotalPassWordPageVo;
+import com.template.services.*;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2025-05-09
+ */
+@RestController
+public class TotalPassWordController implements TotalPassWordControllerAPI {
+
+    @Autowired
+    TotalPassWordService totalPassWordService;
+
+    @Autowired
+    UnlockingEmployeeService unlockingEmployeeService;
+
+    @Autowired
+    PasswordIssController passwordIssController;
+
+    @Autowired
+    BuildingService buildingService;
+
+    @Autowired
+    HouseNumberService houseNumberService;
+
+    @Autowired
+    HouseLockService houseLockService;
+
+    @Autowired
+    EmployeeUsersService employeeUsersService;
+
+    @Autowired
+    OperatingRecordService operatingRecordService;
+
+    @Autowired
+    AdminService adminService;
+
+    @Override
+    public CommonResult saveEmployeeTotalPassWord(TotalPassWordDto totalPassWordDto) {
+        Integer adminId = totalPassWordDto.getAdminId();
+
+        Admin admin = adminService.getById(adminId);
+        if (ObjectUtils.isEmpty(admin)) {
+            return CommonResult.fail("该管理员不存在");
+        }
+
+        //        监测密码是否符合要求
+        String passWord = totalPassWordDto.getPassWord();
+        if (!PasswordChecker.isValidPassword(passWord)) {
+            return CommonResult.fail("密码长度的一半不能是连续升序、倒序、一样的数字");
+        }
+
+        Integer buildingId = totalPassWordDto.getBuildingId();
+        Integer employeeUsersId = totalPassWordDto.getEmployeeUsersId();
+//        先判断是否已添加总卡
+        LambdaQueryWrapper<TotalPassWord> wrapperTc = new LambdaQueryWrapper<>();
+        wrapperTc.eq(TotalPassWord::getBuildingId, buildingId)
+                .eq(TotalPassWord::getEmployeeUsersId, employeeUsersId);
+        TotalPassWord totalPassWord = totalPassWordService.getOne(wrapperTc);
+        if (ObjectUtils.isNotEmpty(totalPassWord)) {
+            return CommonResult.fail("已存在该总密码");
+        }
+
+
+//        判断是否有该员工
+        EmployeeUsers employeeUsers = employeeUsersService.getById(employeeUsersId);
+        if (ObjectUtils.isEmpty(employeeUsers)) {
+            return CommonResult.fail("无该员工");
+        }
+
+//        获取该楼栋下的房间
+        LambdaQueryWrapper<HouseNumber> wrapperHn = new LambdaQueryWrapper<>();
+        wrapperHn.eq(HouseNumber::getBuildingId, buildingId);
+        List<HouseNumber> houseNumberList = houseNumberService.list(wrapperHn);
+        if (houseNumberList.size() == 0) {
+            return CommonResult.fail("该楼栋下无房间");
+        }
+        ArrayList<Integer> houseNumberIds = new ArrayList<>();
+        for (HouseNumber houseNumber : houseNumberList) {
+            houseNumberIds.add(houseNumber.getId());
+        }
+
+        LambdaQueryWrapper<HouseLock> wrapperHl = new LambdaQueryWrapper<>();
+        wrapperHl.in(HouseLock::getHouseNumberId, houseNumberIds);
+        List<HouseLock> houseLockList = houseLockService.list(wrapperHl);
+        if (houseLockList.size() == 0) {
+            return CommonResult.fail("该楼栋下无门锁设备");
+        }
+
+        //        添加总密码
+
+        for (HouseLock houseLock : houseLockList) {
+            Integer houseNumberId = houseLock.getHouseNumberId();
+            HouseNumber houseNumber = houseNumberService.getById(houseNumberId);
+
+            KeyPassWordDto dto = new KeyPassWordDto();
+            dto.setEquipmentType(houseLock.getEquipmentType());
+            dto.setPassWord(totalPassWordDto.getPassWord());
+            dto.setStartTime(totalPassWordDto.getStartTime());
+            dto.setEndTime(totalPassWordDto.getEndTime());
+            dto.setHouseNumberId(houseLock.getHouseNumberId() + "");
+            dto.setAdminId(totalPassWordDto.getAdminId() + "");
+            dto.setType(4);
+
+            UnlockingAdmin unlockingAdmin = null;
+            UnlockingEmployee unlockingEmployee = new UnlockingEmployee();
+            /**
+             * 缺少人的名字和
+             */
+            try {
+                unlockingAdmin = passwordIssController.savePassWord(dto);
+                if (ObjectUtils.isEmpty(unlockingAdmin)) {
+                    return CommonResult.fail("房间:"+houseNumber.getRoomNumber() +",密码已存在,请更换");
+                }
+
+                unlockingAdmin.setName(employeeUsers.getUserName());
+                unlockingAdmin.setPhone(employeeUsers.getPhone());
+                BeanUtils.copyProperties(unlockingAdmin, unlockingEmployee);
+                unlockingEmployeeService.save(unlockingEmployee);
+            } catch (Exception e) {
+                e.printStackTrace();
+                if (ObjectUtils.isNotEmpty(unlockingAdmin)) {
+//            删除锁
+                    passwordIssController.deleteLockUser(unlockingAdmin.getLuid(), unlockingAdmin.getLockUserId());
+                }
+                return CommonResult.fail(e.getMessage());
+            }
+
+
+
+//        添加操作记录
+
+            OperatingRecord operatingRecord = new OperatingRecord();
+
+            operatingRecord.setHouseNumberId(houseLock.getHouseNumberId());
+            operatingRecord.setRoomNumber(houseNumber.getRoomNumber());
+            operatingRecord.setOperatorName(admin.getName());
+            DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            operatingRecord.setDataTime(LocalDateTime.now().format(dateTimeFormatter1));
+            operatingRecord.setContent("姓名:" + employeeUsers.getUserName());
+            operatingRecord.setType("添加密码钥匙");
+            operatingRecordService.save(operatingRecord);
+
+        }
+
+        TotalPassWord totalPassWord1 = new TotalPassWord();
+        BeanUtils.copyProperties(totalPassWordDto, totalPassWord1);
+        totalPassWordService.save(totalPassWord1);
+        return CommonResult.ok();
+    }
+
+    @Override
+    public CommonResult deleteEmployeeTotalPassWord(Integer id) {
+        TotalPassWord totalPassWord = totalPassWordService.getById(id);
+
+        if (ObjectUtils.isEmpty(totalPassWord)) {
+            return CommonResult.fail("无该总卡");
+        }
+
+        //        判断是否有该员工
+        EmployeeUsers employeeUsers = employeeUsersService.getById(totalPassWord.getEmployeeUsersId());
+        if (ObjectUtils.isEmpty(employeeUsers)) {
+            return CommonResult.fail("无该员工");
+        }
+
+
+        Integer buildingId = totalPassWord.getBuildingId();
+
+        //        获取该楼栋下的房间
+        LambdaQueryWrapper<HouseNumber> wrapperHn = new LambdaQueryWrapper<>();
+        wrapperHn.eq(HouseNumber::getBuildingId, buildingId);
+        List<HouseNumber> houseNumberList = houseNumberService.list(wrapperHn);
+        if (houseNumberList.size() == 0) {
+            return CommonResult.fail("该楼栋下无房间");
+        }
+        ArrayList<Integer> houseNumberIds = new ArrayList<>();
+        for (HouseNumber houseNumber : houseNumberList) {
+            houseNumberIds.add(houseNumber.getId());
+        }
+
+//        查询所有需要删除的锁
+        LambdaQueryWrapper<UnlockingEmployee> wrapperUe = new LambdaQueryWrapper<>();
+        wrapperUe.eq(UnlockingEmployee::getName, employeeUsers.getUserName())
+                .eq(UnlockingEmployee::getPhone, employeeUsers.getPhone())
+                .in(UnlockingEmployee::getHouseNumberId, houseNumberIds)
+                .eq(UnlockingEmployee::getStartTime, totalPassWord.getStartTime())
+                .eq(UnlockingEmployee::getEndTime, totalPassWord.getEndTime())
+                .eq(UnlockingEmployee::getLockStatus, 1);
+
+        List<UnlockingEmployee> list = unlockingEmployeeService.list(wrapperUe);
+
+
+        for (UnlockingEmployee unlockingEmployee : list) {
+            System.out.println("删除用户id:"+unlockingEmployee.getId());
+            String luid = unlockingEmployee.getLuid();
+            String lockUserId = unlockingEmployee.getLockUserId();
+            passwordIssController.deleteLockUser(luid, lockUserId);
+            unlockingEmployeeService.removeById(unlockingEmployee.getId());
+        }
+
+        totalPassWordService.removeById(id);
+        return CommonResult.ok();
+
+    }
+
+    @Override
+    public CommonResult listEmployeeTotalPassWord(Integer page, Integer size, String employeeName, Integer buildingId, String startTime, String endTime) {
+        PageUtils<TotalPassWordPageVo> pageUtils = totalPassWordService.totalPassWordPage(page, size, employeeName, buildingId, startTime, endTime);
+        return CommonResult.ok(pageUtils);
+    }
+}
+

+ 1 - 1
src/main/java/com/template/controller/UnlockingEmployeeController.java

@@ -79,7 +79,7 @@ public class UnlockingEmployeeController implements UnlockingEmployeeControllerA
         }
 
         EmployeeUsers byId = employeeUsersService.getById(keyPassWordDto.getUsersId());
-        if (ObjectUtils.isEmpty(admin)) {
+        if (ObjectUtils.isEmpty(byId)) {
             return CommonResult.fail("添加的用户不存在");
         }
 

+ 23 - 0
src/main/java/com/template/mapper/TotalPassWordMapper.java

@@ -0,0 +1,23 @@
+package com.template.mapper;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.template.model.pojo.TotalPassWord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.template.model.vo.TotalPassWordPageVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2025-05-09
+ */
+@Mapper
+public interface TotalPassWordMapper extends BaseMapper<TotalPassWord> {
+
+    IPage<TotalPassWordPageVo> totalPassWordPage(Page<TotalPassWordPageVo> pageVo, @Param("employeeName") String employeeName, @Param("buildingId") Integer buildingId, @Param("startTime") String startTime, @Param("endTime") String endTime);
+}

+ 7 - 0
src/main/java/com/template/model/dto/EstablishOrderDto.java

@@ -1,5 +1,6 @@
 package com.template.model.dto;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.math.BigDecimal;
@@ -29,4 +30,10 @@ public class EstablishOrderDto {
     //来源id拼接字符串 id,id,id,xxx
     private String sourceId;
 
+    @ApiModelProperty(value = "身份类型 0.学生,1.学生家长,2.朋友,3.老师")
+    private Integer identityType ;
+
+    @ApiModelProperty(value = "原因 0.探视,1.交流")
+    private Integer reason ;
+
 }

+ 26 - 0
src/main/java/com/template/model/dto/TotalPassWordDto.java

@@ -0,0 +1,26 @@
+package com.template.model.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class TotalPassWordDto {
+    private Integer adminId;
+
+    @ApiModelProperty(value = "员工id")
+    private Integer employeeUsersId;
+
+    @ApiModelProperty(value = "楼栋单元id")
+    private Integer buildingId;
+
+    @ApiModelProperty(value = "密码")
+    private String passWord;
+
+    @ApiModelProperty(value = "开始时间")
+    private String startTime;
+
+    @ApiModelProperty(value = "结束时间")
+    private String endTime;
+}

+ 6 - 0
src/main/java/com/template/model/pojo/HouseOrder.java

@@ -148,6 +148,12 @@ public class HouseOrder implements Serializable {
     @ApiModelProperty(value = "账单日期")
     private String dateBill;
 
+    @ApiModelProperty(value = "身份类型 0.学生,1.学生家长,2.朋友,3.老师")
+    private Integer identityType;
+
+    @ApiModelProperty(value = "原因 0.探视,1.交流")
+    private Integer reason;
+
     @ApiModelProperty(value = "创建时间")
     @TableField(fill = FieldFill.INSERT)
     private String createTime;

+ 1 - 1
src/main/java/com/template/model/pojo/PermissionSetting.java

@@ -65,7 +65,7 @@ public class PermissionSetting implements Serializable {
     @ApiModelProperty(value = "黑名单管理 0.全部 1.移出,2.查看")
     private String blacklistManagement;
 
-    @ApiModelProperty(value = "门锁管理 0.全部 1.添加,2.编辑,3.删除,4.查询,5.导出,6.导入,7.批量重置密码,8.重置密码,9.添加总卡,10.禁用门锁,11.钥匙管理,12.消息列表,13.远程开锁,14.解绑设备")
+    @ApiModelProperty(value = "门锁管理 0.全部 1.添加,2.编辑,3.删除,4.查询,5.导出,6.导入,7.批量重置密码,8.重置密码,9.添加总卡,10.禁用门锁,11.钥匙管理,12.消息列表,13.远程开锁,14.解绑设备,15:NFC设置,16:设置管理员密码")
     private String doorLockManagement;
 
     @ApiModelProperty(value = "水电管理 0.全部 1.添加,2.编辑,3.删除,4.查询,5.导出,6.导入")

+ 73 - 0
src/main/java/com/template/model/pojo/TotalPassWord.java

@@ -0,0 +1,73 @@
+package com.template.model.pojo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.Version;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ceshi
+ * @since 2025-05-09
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="TotalPassWord对象", description="")
+public class TotalPassWord implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "员工id")
+    private Integer employeeUsersId;
+
+    @ApiModelProperty(value = "楼栋单元id")
+    private Integer buildingId;
+
+    @ApiModelProperty(value = "密码")
+    private String passWord;
+
+    @ApiModelProperty(value = "开始时间")
+    private String startTime;
+
+    @ApiModelProperty(value = "结束时间")
+    private String endTime;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private String createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateTime;
+
+    @ApiModelProperty(value = "创建人员")
+    @TableField(fill = FieldFill.INSERT)
+    private String createUser;
+
+    @ApiModelProperty(value = "更新人员")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateUser;
+
+    @ApiModelProperty(value = "逻辑删除 未删除:0;删除:1")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleted;
+
+
+}

+ 6 - 0
src/main/java/com/template/model/vo/HouseOrderPageListVo.java

@@ -91,4 +91,10 @@ public class HouseOrderPageListVo {
     @ApiModelProperty(value = "流程列表")
     private List<ApplicationProcedureTemporary> applicationProcedureTemporaries;
 
+    @ApiModelProperty(value = "身份类型 0.学生,1.学生家长,2.朋友,3.老师")
+    private Integer identityType ;
+
+    @ApiModelProperty(value = "原因 0.探视,1.交流")
+    private Integer reason ;
+
 }

+ 6 - 0
src/main/java/com/template/model/vo/QueryExportVo.java

@@ -71,4 +71,10 @@ public class QueryExportVo {
 
     @ApiModelProperty(value = "来源id")
     private String sourceId;
+
+    @ApiModelProperty(value = "身份类型 0.学生,1.学生家长,2.朋友,3.老师")
+    private Integer identityType;
+
+    @ApiModelProperty(value = "原因 0.探视,1.交流")
+    private Integer reason;
 }

+ 38 - 0
src/main/java/com/template/model/vo/TotalPassWordPageVo.java

@@ -0,0 +1,38 @@
+package com.template.model.vo;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class TotalPassWordPageVo {
+    private Integer id;
+
+    @ApiModelProperty(value = "员工id")
+    private Integer employeeUsersId;
+
+    @ApiModelProperty(value = "员工名称")
+    private String employeeUsersName;
+
+    @ApiModelProperty(value = "楼栋单元id")
+    private Integer buildingId;
+
+    @ApiModelProperty(value = "楼栋")
+    private String building;
+
+    @ApiModelProperty(value = "单元")
+    private String element;
+
+    @ApiModelProperty(value = "房卡特殊编码")
+    private String passWord;
+
+    @ApiModelProperty(value = "开始时间")
+    private String startTime;
+
+    @ApiModelProperty(value = "结束时间")
+    private String endTime;
+
+    @ApiModelProperty(value = "创建时间")
+    private String createTime;
+}

+ 19 - 0
src/main/java/com/template/services/TotalPassWordService.java

@@ -0,0 +1,19 @@
+package com.template.services;
+
+import com.template.model.pojo.TotalPassWord;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.template.model.result.PageUtils;
+import com.template.model.vo.TotalPassWordPageVo;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author ceshi
+ * @since 2025-05-09
+ */
+public interface TotalPassWordService extends IService<TotalPassWord> {
+
+    PageUtils<TotalPassWordPageVo> totalPassWordPage(Integer page, Integer size, String employeeName, Integer buildingId, String startTime, String endTime);
+}

+ 35 - 0
src/main/java/com/template/services/impl/TotalPassWordServiceImpl.java

@@ -0,0 +1,35 @@
+package com.template.services.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.template.model.pojo.TotalPassWord;
+import com.template.mapper.TotalPassWordMapper;
+import com.template.model.result.PageUtils;
+import com.template.model.vo.TotalCardPageVo;
+import com.template.model.vo.TotalPassWordPageVo;
+import com.template.services.TotalPassWordService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author ceshi
+ * @since 2025-05-09
+ */
+@Service
+public class TotalPassWordServiceImpl extends ServiceImpl<TotalPassWordMapper, TotalPassWord> implements TotalPassWordService {
+
+    @Autowired
+    TotalPassWordMapper totalPassWordMapper;
+
+    @Override
+    public PageUtils<TotalPassWordPageVo> totalPassWordPage(Integer page, Integer size, String employeeName, Integer buildingId, String startTime, String endTime) {
+        Page<TotalPassWordPageVo> pageVo = new Page<>(page,size);
+        IPage<TotalPassWordPageVo> result=totalPassWordMapper.totalPassWordPage(pageVo,employeeName,buildingId,startTime,endTime);
+        return new PageUtils(result);
+    }
+}

+ 6 - 2
src/main/resources/mapper/template/HouseOrderMapper.xml

@@ -36,7 +36,9 @@
         ho.give_back as giveBack,
         ho.remark,
         ho.source as source,
-        ho.source_id as sourceId
+        ho.source_id as sourceId,
+        ho.identity_type as identityType,
+        ho.reason
         FROM
         `house_order` ho
         LEFT JOIN house_number hn ON hn.id = ho.house_number_id
@@ -149,7 +151,9 @@
         ho.refund_time as refundTime,
         ho.cancel_time as cancelTime,
         ho.source as source,
-        ho.source_id as sourceId
+        ho.source_id as sourceId,
+        ho.identity_type as identityType,
+        ho.reason
         FROM
         `house_order` ho
         LEFT JOIN house_number hn ON hn.id = ho.house_number_id

+ 38 - 0
src/main/resources/mapper/template/TotalPassWordMapper.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.template.mapper.TotalPassWordMapper">
+
+    <select id="totalPassWordPage" resultType="com.template.model.vo.TotalPassWordPageVo">
+        SELECT
+        tc.id,
+        tc.employee_users_id as employeeUsersId,
+        eu.user_name as employeeUsersName,
+        tc.building_id as buildingId,
+        b.building,
+        b.element,
+        tc.pass_word as passWord,
+        tc.start_time as startTime,
+        tc.end_time as endTime,
+        tc.create_time as createTime
+        FROM
+        `total_pass_word` tc
+        LEFT JOIN employee_users eu ON tc.employee_users_id = eu.id
+        AND eu.deleted = 0
+        LEFT JOIN building b ON tc.building_id = b.id
+        AND b.deleted = 0
+        WHERE
+        tc.deleted = 0
+        <if test="employeeName != null and employeeName != ''">
+            AND eu.user_name LIKE '%' #{employeeName} '%'
+        </if>
+
+        <if test="buildingId != null and buildingId != ''">
+            AND tc.building_id = #{buildingId}
+        </if>
+
+        <if test="startTime != null and startTime != '' and endTime != null and endTime != ''  ">
+            AND #{endTime} >= tc.create_time
+            AND tc.create_time >= #{startTime}
+        </if>
+    </select>
+</mapper>