From 521cc30f94d812c5b256fe62217f78db6cefd087 Mon Sep 17 00:00:00 2001 From: cst61 Date: Wed, 29 Apr 2026 19:01:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=84=E4=BC=B0=E7=94=B3=E8=AF=B7=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9E=B6=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LbAssessmentApplicationController.java | 77 +++++++++ .../controller/LbPurchaseApplyController.java | 80 +++++++++ .../rj/entity/LbAssessmentApplication.java | 68 ++++++++ .../java/com/rj/entity/LbPurchaseApply.java | 74 ++++++++ .../mapper/LbAssessmentApplicationMapper.java | 9 + .../com/rj/mapper/LbPurchaseApplyMapper.java | 9 + .../ILbAssessmentApplicationService.java | 23 +++ .../rj/service/ILbPurchaseApplyService.java | 25 +++ .../LbAssessmentApplicationServiceImpl.java | 154 +++++++++++++++++ .../impl/LbPurchaseApplyServiceImpl.java | 160 ++++++++++++++++++ 10 files changed, 679 insertions(+) create mode 100644 src/main/java/com/rj/controller/LbAssessmentApplicationController.java create mode 100644 src/main/java/com/rj/controller/LbPurchaseApplyController.java create mode 100644 src/main/java/com/rj/entity/LbAssessmentApplication.java create mode 100644 src/main/java/com/rj/entity/LbPurchaseApply.java create mode 100644 src/main/java/com/rj/mapper/LbAssessmentApplicationMapper.java create mode 100644 src/main/java/com/rj/mapper/LbPurchaseApplyMapper.java create mode 100644 src/main/java/com/rj/service/ILbAssessmentApplicationService.java create mode 100644 src/main/java/com/rj/service/ILbPurchaseApplyService.java create mode 100644 src/main/java/com/rj/service/impl/LbAssessmentApplicationServiceImpl.java create mode 100644 src/main/java/com/rj/service/impl/LbPurchaseApplyServiceImpl.java diff --git a/src/main/java/com/rj/controller/LbAssessmentApplicationController.java b/src/main/java/com/rj/controller/LbAssessmentApplicationController.java new file mode 100644 index 0000000..3efb50c --- /dev/null +++ b/src/main/java/com/rj/controller/LbAssessmentApplicationController.java @@ -0,0 +1,77 @@ +package com.rj.controller; + +import com.rj.entity.LbAssessmentApplication; +import com.rj.service.ILbAssessmentApplicationService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + +@RestController +@RequestMapping("/api/lbAssessmentApplication") +@Tag(name = "申请评估", description = "lb_assessment_application增删改查与分页") +public class LbAssessmentApplicationController { + + @Autowired + private ILbAssessmentApplicationService lbAssessmentApplicationService; + + @PostMapping("/add") + @Operation(summary = "新增") + public ResponseEntity> add( + @Parameter(description = "实体", required = true) @RequestBody LbAssessmentApplication entity) { + Map result = lbAssessmentApplicationService.add(entity); + Boolean success = (Boolean) result.get("success"); + if (success != null && success) { + return ResponseEntity.ok(result); + } + return ResponseEntity.badRequest().body(result); + } + + @PutMapping("/update") + @Operation(summary = "编辑") + public ResponseEntity> update( + @Parameter(description = "实体", required = true) @RequestBody LbAssessmentApplication entity) { + Map result = lbAssessmentApplicationService.update(entity); + Boolean success = (Boolean) result.get("success"); + if (success != null && success) { + return ResponseEntity.ok(result); + } + return ResponseEntity.badRequest().body(result); + } + + @DeleteMapping("/delete/{id}") + @Operation(summary = "删除") + public ResponseEntity> delete( + @Parameter(description = "主键ID(UUID)", required = true) @PathVariable String id) { + Map result = lbAssessmentApplicationService.deleteById(id); + Boolean success = (Boolean) result.get("success"); + if (success != null && success) { + return ResponseEntity.ok(result); + } + return ResponseEntity.badRequest().body(result); + } + + @GetMapping("/list") + @Operation(summary = "分页查询") + public ResponseEntity> list( + @RequestParam(defaultValue = "1") Integer current, + @RequestParam(defaultValue = "10") Integer size, + @RequestParam(required = false) Long tenantId, + @RequestParam(required = false) String applicantName, + @RequestParam(required = false) String applicantPhone, + @RequestParam(required = false) String colleagueName, + @RequestParam(required = false) String teamLeaderName) { + Map result = lbAssessmentApplicationService.pageQuery( + current, size, tenantId, applicantName, applicantPhone, colleagueName, teamLeaderName + ); + Boolean success = (Boolean) result.get("success"); + if (success != null && success) { + return ResponseEntity.ok(result); + } + return ResponseEntity.internalServerError().body(result); + } +} diff --git a/src/main/java/com/rj/controller/LbPurchaseApplyController.java b/src/main/java/com/rj/controller/LbPurchaseApplyController.java new file mode 100644 index 0000000..6bfc41f --- /dev/null +++ b/src/main/java/com/rj/controller/LbPurchaseApplyController.java @@ -0,0 +1,80 @@ +package com.rj.controller; + +import com.rj.entity.LbPurchaseApply; +import com.rj.service.ILbPurchaseApplyService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDate; +import java.util.Map; + +@RestController +@RequestMapping("/api/lbPurchaseApply") +@Tag(name = "进货申请", description = "lb_purchase_apply增删改查与分页") +public class LbPurchaseApplyController { + + @Autowired + private ILbPurchaseApplyService lbPurchaseApplyService; + + @PostMapping("/add") + @Operation(summary = "新增") + public ResponseEntity> add( + @Parameter(description = "实体", required = true) @RequestBody LbPurchaseApply entity) { + Map result = lbPurchaseApplyService.add(entity); + Boolean success = (Boolean) result.get("success"); + if (success != null && success) { + return ResponseEntity.ok(result); + } + return ResponseEntity.badRequest().body(result); + } + + @PutMapping("/update") + @Operation(summary = "编辑") + public ResponseEntity> update( + @Parameter(description = "实体", required = true) @RequestBody LbPurchaseApply entity) { + Map result = lbPurchaseApplyService.update(entity); + Boolean success = (Boolean) result.get("success"); + if (success != null && success) { + return ResponseEntity.ok(result); + } + return ResponseEntity.badRequest().body(result); + } + + @DeleteMapping("/delete/{id}") + @Operation(summary = "删除") + public ResponseEntity> delete( + @Parameter(description = "主键ID", required = true) @PathVariable Long id) { + Map result = lbPurchaseApplyService.deleteById(id); + Boolean success = (Boolean) result.get("success"); + if (success != null && success) { + return ResponseEntity.ok(result); + } + return ResponseEntity.badRequest().body(result); + } + + @GetMapping("/list") + @Operation(summary = "分页查询") + public ResponseEntity> list( + @RequestParam(defaultValue = "1") Integer current, + @RequestParam(defaultValue = "10") Integer size, + @RequestParam(required = false) String tenantId, + @RequestParam(required = false) String applyUser, + @RequestParam(required = false) String applyPhone, + @RequestParam(required = false) String colleagueName, + @RequestParam(required = false) String teamLeader, + @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate applyDate) { + Map result = lbPurchaseApplyService.pageQuery( + current, size, tenantId, applyUser, applyPhone, colleagueName, teamLeader, applyDate + ); + Boolean success = (Boolean) result.get("success"); + if (success != null && success) { + return ResponseEntity.ok(result); + } + return ResponseEntity.internalServerError().body(result); + } +} diff --git a/src/main/java/com/rj/entity/LbAssessmentApplication.java b/src/main/java/com/rj/entity/LbAssessmentApplication.java new file mode 100644 index 0000000..5ff81b7 --- /dev/null +++ b/src/main/java/com/rj/entity/LbAssessmentApplication.java @@ -0,0 +1,68 @@ +package com.rj.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.time.LocalDateTime; + +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("lb_assessment_application") +@Schema(description = "申请评估表") +public class LbAssessmentApplication implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId("id") + @Schema(description = "主键ID(UUID)") + private String id; + + @TableField("tenant_id") + @Schema(description = "租户ID") + private Long tenantId; + + @TableField("applicant_name") + @Schema(description = "申请人") + private String applicantName; + + @TableField("applicant_phone") + @Schema(description = "申请人电话") + private String applicantPhone; + + @TableField("applicant_age") + @Schema(description = "年龄") + private Integer applicantAge; + + @TableField("work_experience") + @Schema(description = "从业经历") + private String workExperience; + + @TableField("colleague_name") + @Schema(description = "同事姓名") + private String colleagueName; + + @TableField("colleague_phone") + @Schema(description = "同事电话") + private String colleaguePhone; + + @TableField("team_leader_name") + @Schema(description = "团队长姓名") + private String teamLeaderName; + + @TableField("application_datetime") + @Schema(description = "申请日期时间") + private LocalDateTime applicationDatetime; + + @TableField("created_at") + @Schema(description = "创建时间") + private LocalDateTime createdAt; + + @TableField("updated_at") + @Schema(description = "修改时间") + private LocalDateTime updatedAt; +} diff --git a/src/main/java/com/rj/entity/LbPurchaseApply.java b/src/main/java/com/rj/entity/LbPurchaseApply.java new file mode 100644 index 0000000..9f3d54b --- /dev/null +++ b/src/main/java/com/rj/entity/LbPurchaseApply.java @@ -0,0 +1,74 @@ +package com.rj.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.time.LocalDate; +import java.time.LocalDateTime; + +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("lb_purchase_apply") +@Schema(description = "进货申请信息表") +public class LbPurchaseApply implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + @Schema(description = "主键ID") + private Long id; + + @TableField("tenant_id") + @Schema(description = "租户id") + private String tenantId; + + @TableField("apply_user") + @Schema(description = "申请人") + private String applyUser; + + @TableField("apply_phone") + @Schema(description = "申请人电话") + private String applyPhone; + + @TableField("try_date") + @Schema(description = "试用日期") + private String tryDate; + + @TableField("age") + @Schema(description = "年龄") + private Integer age; + + @TableField("work_experience") + @Schema(description = "从业经历") + private String workExperience; + + @TableField("colleague_name") + @Schema(description = "同事姓名") + private String colleagueName; + + @TableField("colleague_phone") + @Schema(description = "同事电话") + private String colleaguePhone; + + @TableField("team_leader") + @Schema(description = "团队长") + private String teamLeader; + + @TableField("apply_date") + @Schema(description = "申请日期") + private LocalDate applyDate; + + @TableField("create_time") + @Schema(description = "创建时间") + private LocalDateTime createTime; + + @TableField("update_time") + @Schema(description = "更新时间") + private LocalDateTime updateTime; +} diff --git a/src/main/java/com/rj/mapper/LbAssessmentApplicationMapper.java b/src/main/java/com/rj/mapper/LbAssessmentApplicationMapper.java new file mode 100644 index 0000000..b45a6de --- /dev/null +++ b/src/main/java/com/rj/mapper/LbAssessmentApplicationMapper.java @@ -0,0 +1,9 @@ +package com.rj.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.rj.entity.LbAssessmentApplication; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface LbAssessmentApplicationMapper extends BaseMapper { +} diff --git a/src/main/java/com/rj/mapper/LbPurchaseApplyMapper.java b/src/main/java/com/rj/mapper/LbPurchaseApplyMapper.java new file mode 100644 index 0000000..1d640de --- /dev/null +++ b/src/main/java/com/rj/mapper/LbPurchaseApplyMapper.java @@ -0,0 +1,9 @@ +package com.rj.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.rj.entity.LbPurchaseApply; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface LbPurchaseApplyMapper extends BaseMapper { +} diff --git a/src/main/java/com/rj/service/ILbAssessmentApplicationService.java b/src/main/java/com/rj/service/ILbAssessmentApplicationService.java new file mode 100644 index 0000000..a2874f9 --- /dev/null +++ b/src/main/java/com/rj/service/ILbAssessmentApplicationService.java @@ -0,0 +1,23 @@ +package com.rj.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.rj.entity.LbAssessmentApplication; + +import java.util.Map; + +public interface ILbAssessmentApplicationService extends IService { + + Map add(LbAssessmentApplication entity); + + Map update(LbAssessmentApplication entity); + + Map deleteById(String id); + + Map pageQuery(Integer current, + Integer size, + Long tenantId, + String applicantName, + String applicantPhone, + String colleagueName, + String teamLeaderName); +} diff --git a/src/main/java/com/rj/service/ILbPurchaseApplyService.java b/src/main/java/com/rj/service/ILbPurchaseApplyService.java new file mode 100644 index 0000000..5f58c29 --- /dev/null +++ b/src/main/java/com/rj/service/ILbPurchaseApplyService.java @@ -0,0 +1,25 @@ +package com.rj.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.rj.entity.LbPurchaseApply; + +import java.time.LocalDate; +import java.util.Map; + +public interface ILbPurchaseApplyService extends IService { + + Map add(LbPurchaseApply entity); + + Map update(LbPurchaseApply entity); + + Map deleteById(Long id); + + Map pageQuery(Integer current, + Integer size, + String tenantId, + String applyUser, + String applyPhone, + String colleagueName, + String teamLeader, + LocalDate applyDate); +} diff --git a/src/main/java/com/rj/service/impl/LbAssessmentApplicationServiceImpl.java b/src/main/java/com/rj/service/impl/LbAssessmentApplicationServiceImpl.java new file mode 100644 index 0000000..47ba31a --- /dev/null +++ b/src/main/java/com/rj/service/impl/LbAssessmentApplicationServiceImpl.java @@ -0,0 +1,154 @@ +package com.rj.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.rj.entity.LbAssessmentApplication; +import com.rj.mapper.LbAssessmentApplicationMapper; +import com.rj.service.ILbAssessmentApplicationService; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +@Service +public class LbAssessmentApplicationServiceImpl + extends ServiceImpl + implements ILbAssessmentApplicationService { + + @Override + public Map add(LbAssessmentApplication entity) { + Map result = new HashMap<>(); + try { + if (entity.getTenantId() == null) { + result.put("success", false); + result.put("message", "tenantId不能为空"); + return result; + } + if (entity.getApplicantName() == null || entity.getApplicantName().trim().isEmpty()) { + result.put("success", false); + result.put("message", "applicantName不能为空"); + return result; + } + if (entity.getApplicantPhone() == null || entity.getApplicantPhone().trim().isEmpty()) { + result.put("success", false); + result.put("message", "applicantPhone不能为空"); + return result; + } + + if (entity.getId() == null || entity.getId().trim().isEmpty()) { + entity.setId(UUID.randomUUID().toString()); + } + LocalDateTime now = LocalDateTime.now(); + if (entity.getCreatedAt() == null) { + entity.setCreatedAt(now); + } + entity.setUpdatedAt(now); + + boolean ok = this.save(entity); + result.put("success", ok); + result.put("message", ok ? "新增成功" : "新增失败"); + if (ok) { + result.put("data", entity); + } + return result; + } catch (Exception e) { + result.put("success", false); + result.put("message", "新增异常:" + e.getMessage()); + return result; + } + } + + @Override + public Map update(LbAssessmentApplication entity) { + Map result = new HashMap<>(); + try { + if (entity.getId() == null || entity.getId().trim().isEmpty()) { + result.put("success", false); + result.put("message", "id不能为空"); + return result; + } + entity.setUpdatedAt(LocalDateTime.now()); + boolean ok = this.updateById(entity); + result.put("success", ok); + result.put("message", ok ? "编辑成功" : "编辑失败"); + if (ok) { + result.put("data", this.getById(entity.getId())); + } + return result; + } catch (Exception e) { + result.put("success", false); + result.put("message", "编辑异常:" + e.getMessage()); + return result; + } + } + + @Override + public Map deleteById(String id) { + Map result = new HashMap<>(); + try { + boolean ok = this.removeById(id); + result.put("success", ok); + result.put("message", ok ? "删除成功" : "删除失败"); + return result; + } catch (Exception e) { + result.put("success", false); + result.put("message", "删除异常:" + e.getMessage()); + return result; + } + } + + @Override + public Map pageQuery(Integer current, + Integer size, + Long tenantId, + String applicantName, + String applicantPhone, + String colleagueName, + String teamLeaderName) { + Map result = new HashMap<>(); + try { + if (current == null || current < 1) { + current = 1; + } + if (size == null || size < 1) { + size = 10; + } + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (tenantId != null) { + queryWrapper.eq(LbAssessmentApplication::getTenantId, tenantId); + } + if (applicantName != null && !applicantName.trim().isEmpty()) { + queryWrapper.like(LbAssessmentApplication::getApplicantName, applicantName.trim()); + } + if (applicantPhone != null && !applicantPhone.trim().isEmpty()) { + queryWrapper.like(LbAssessmentApplication::getApplicantPhone, applicantPhone.trim()); + } + if (colleagueName != null && !colleagueName.trim().isEmpty()) { + queryWrapper.like(LbAssessmentApplication::getColleagueName, colleagueName.trim()); + } + if (teamLeaderName != null && !teamLeaderName.trim().isEmpty()) { + queryWrapper.like(LbAssessmentApplication::getTeamLeaderName, teamLeaderName.trim()); + } + queryWrapper.orderByDesc(LbAssessmentApplication::getUpdatedAt) + .orderByDesc(LbAssessmentApplication::getCreatedAt); + + Page page = this.page(new Page<>(current, size), queryWrapper); + result.put("success", true); + result.put("message", "查询成功"); + result.put("data", page.getRecords()); + result.put("total", page.getTotal()); + result.put("current", page.getCurrent()); + result.put("size", page.getSize()); + result.put("pages", page.getPages()); + return result; + } catch (Exception e) { + result.put("success", false); + result.put("message", "查询异常:" + e.getMessage()); + return result; + } + } +} diff --git a/src/main/java/com/rj/service/impl/LbPurchaseApplyServiceImpl.java b/src/main/java/com/rj/service/impl/LbPurchaseApplyServiceImpl.java new file mode 100644 index 0000000..01dab48 --- /dev/null +++ b/src/main/java/com/rj/service/impl/LbPurchaseApplyServiceImpl.java @@ -0,0 +1,160 @@ +package com.rj.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.rj.entity.LbPurchaseApply; +import com.rj.mapper.LbPurchaseApplyMapper; +import com.rj.service.ILbPurchaseApplyService; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.Map; + +@Service +public class LbPurchaseApplyServiceImpl + extends ServiceImpl + implements ILbPurchaseApplyService { + + @Override + public Map add(LbPurchaseApply entity) { + Map result = new HashMap<>(); + try { + if (entity.getTenantId() == null || entity.getTenantId().trim().isEmpty()) { + result.put("success", false); + result.put("message", "tenantId不能为空"); + return result; + } + if (entity.getApplyUser() == null || entity.getApplyUser().trim().isEmpty()) { + result.put("success", false); + result.put("message", "applyUser不能为空"); + return result; + } + if (entity.getApplyPhone() == null || entity.getApplyPhone().trim().isEmpty()) { + result.put("success", false); + result.put("message", "applyPhone不能为空"); + return result; + } + if (entity.getApplyDate() == null) { + result.put("success", false); + result.put("message", "applyDate不能为空"); + return result; + } + + LocalDateTime now = LocalDateTime.now(); + if (entity.getCreateTime() == null) { + entity.setCreateTime(now); + } + entity.setUpdateTime(now); + + boolean ok = this.save(entity); + result.put("success", ok); + result.put("message", ok ? "新增成功" : "新增失败"); + if (ok) { + result.put("data", entity); + } + return result; + } catch (Exception e) { + result.put("success", false); + result.put("message", "新增异常:" + e.getMessage()); + return result; + } + } + + @Override + public Map update(LbPurchaseApply entity) { + Map result = new HashMap<>(); + try { + if (entity.getId() == null) { + result.put("success", false); + result.put("message", "id不能为空"); + return result; + } + entity.setUpdateTime(LocalDateTime.now()); + boolean ok = this.updateById(entity); + result.put("success", ok); + result.put("message", ok ? "编辑成功" : "编辑失败"); + if (ok) { + result.put("data", this.getById(entity.getId())); + } + return result; + } catch (Exception e) { + result.put("success", false); + result.put("message", "编辑异常:" + e.getMessage()); + return result; + } + } + + @Override + public Map deleteById(Long id) { + Map result = new HashMap<>(); + try { + boolean ok = this.removeById(id); + result.put("success", ok); + result.put("message", ok ? "删除成功" : "删除失败"); + return result; + } catch (Exception e) { + result.put("success", false); + result.put("message", "删除异常:" + e.getMessage()); + return result; + } + } + + @Override + public Map pageQuery(Integer current, + Integer size, + String tenantId, + String applyUser, + String applyPhone, + String colleagueName, + String teamLeader, + LocalDate applyDate) { + Map result = new HashMap<>(); + try { + if (current == null || current < 1) { + current = 1; + } + if (size == null || size < 1) { + size = 10; + } + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (tenantId != null && !tenantId.trim().isEmpty()) { + queryWrapper.eq(LbPurchaseApply::getTenantId, tenantId.trim()); + } + if (applyUser != null && !applyUser.trim().isEmpty()) { + queryWrapper.like(LbPurchaseApply::getApplyUser, applyUser.trim()); + } + if (applyPhone != null && !applyPhone.trim().isEmpty()) { + queryWrapper.like(LbPurchaseApply::getApplyPhone, applyPhone.trim()); + } + if (colleagueName != null && !colleagueName.trim().isEmpty()) { + queryWrapper.like(LbPurchaseApply::getColleagueName, colleagueName.trim()); + } + if (teamLeader != null && !teamLeader.trim().isEmpty()) { + queryWrapper.like(LbPurchaseApply::getTeamLeader, teamLeader.trim()); + } + if (applyDate != null) { + queryWrapper.eq(LbPurchaseApply::getApplyDate, applyDate); + } + queryWrapper.orderByDesc(LbPurchaseApply::getUpdateTime) + .orderByDesc(LbPurchaseApply::getCreateTime); + + Page page = this.page(new Page<>(current, size), queryWrapper); + result.put("success", true); + result.put("message", "查询成功"); + result.put("data", page.getRecords()); + result.put("total", page.getTotal()); + result.put("current", page.getCurrent()); + result.put("size", page.getSize()); + result.put("pages", page.getPages()); + return result; + } catch (Exception e) { + result.put("success", false); + result.put("message", "查询异常:" + e.getMessage()); + return result; + } + } +}