From 3740ebe43743673b44554f6281fa97604e6fc500 Mon Sep 17 00:00:00 2001 From: haozq <1611483981@qq.com> Date: Sat, 16 Nov 2024 14:36:52 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/controller/ExportController.java | 2 +- .../controller/PlanApplicationController.java | 11 ++- .../plan/entity/PlanDataDetailBean.java | 92 +------------------ .../plan/mapper/PlanApplicationMapper.java | 2 +- .../plan/service/PlanApplicationService.java | 9 +- .../service/PlanApplicationServiceImp.java | 17 +++- .../mappers/plan/PlanApplicationMapper.xml | 14 ++- 7 files changed, 49 insertions(+), 98 deletions(-) diff --git a/src/main/java/com/bonus/gzgqj/business/plan/controller/ExportController.java b/src/main/java/com/bonus/gzgqj/business/plan/controller/ExportController.java index e8532f0..955d4f8 100644 --- a/src/main/java/com/bonus/gzgqj/business/plan/controller/ExportController.java +++ b/src/main/java/com/bonus/gzgqj/business/plan/controller/ExportController.java @@ -86,7 +86,7 @@ public class ExportController { * @param o */ @PostMapping("exportDetail") - public void exportDetail(HttpServletRequest request, HttpServletResponse response,@RequestBody PlanApplyBean o) { + public void exportDetail(HttpServletRequest request, HttpServletResponse response,@RequestBody PlanDataDetailBean o) { try { List results = planService.getDetailsList(o); final int[] num = {1}; diff --git a/src/main/java/com/bonus/gzgqj/business/plan/controller/PlanApplicationController.java b/src/main/java/com/bonus/gzgqj/business/plan/controller/PlanApplicationController.java index da1fa41..1d6d5fd 100644 --- a/src/main/java/com/bonus/gzgqj/business/plan/controller/PlanApplicationController.java +++ b/src/main/java/com/bonus/gzgqj/business/plan/controller/PlanApplicationController.java @@ -110,7 +110,14 @@ public class PlanApplicationController { public ServerResponse getPlanDetails(EncryptedReq dto) { return service.getPlanDetails(dto.getData()); } - + @GetMapping("getPlanDetailsList") + @DecryptAndVerify(decryptedClass = PlanDataDetailBean.class) + public PageInfo getPlanDetailsList(EncryptedReq dto) { + PageHelper.startPage(dto.getPageNum(),dto.getPageSize()); + List list = service.getPlanDetailsList(dto.getData());; + PageInfo pageInfo = new PageInfo<>(list); + return pageInfo; + } @PostMapping("export") public void export(HttpServletRequest request, HttpServletResponse response,PlanApplyBean o) { @@ -138,7 +145,7 @@ public class PlanApplicationController { @PostMapping("exportDetail") - public void exportDetail(HttpServletRequest request, HttpServletResponse response,PlanApplyBean o) { + public void exportDetail(HttpServletRequest request, HttpServletResponse response,PlanDataDetailBean o) { try { List results = service.getDetailsList(o); ExportParams exportParams = new ExportParams("机具明细", "机具明细", ExcelType.XSSF); diff --git a/src/main/java/com/bonus/gzgqj/business/plan/entity/PlanDataDetailBean.java b/src/main/java/com/bonus/gzgqj/business/plan/entity/PlanDataDetailBean.java index f7989cb..1189088 100644 --- a/src/main/java/com/bonus/gzgqj/business/plan/entity/PlanDataDetailBean.java +++ b/src/main/java/com/bonus/gzgqj/business/plan/entity/PlanDataDetailBean.java @@ -19,6 +19,8 @@ public class PlanDataDetailBean { private int xh; private String applyId; + + private String id; /** * 类型 @@ -60,98 +62,12 @@ public class PlanDataDetailBean { * 规格id */ private String moduleId; - - - - - public String getApplyId() { - return applyId; - } - public void setApplyId(String applyId) { - this.applyId = applyId; - } + private String name; + private String model; - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - public String getTypeName() { - return typeName; - } - - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - - public String getModule() { - return module; - } - - - public void setModule(String module) { - this.module = module; - } - - - public String getUnit() { - return unit; - } - - - public void setUnit(String unit) { - this.unit = unit; - } - - - public int getNeedNum() { - return needNum; - } - - - public void setNeedNum(int needNum) { - this.needNum = needNum; - } - - - public String getTimes() { - return times; - } - - - public void setTimes(String times) { - this.times = times; - } - - - public String getRemarks() { - return remarks; - } - - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - - public String getModuleId() { - return moduleId; - } - - - public void setModuleId(String moduleId) { - this.moduleId = moduleId; - } diff --git a/src/main/java/com/bonus/gzgqj/business/plan/mapper/PlanApplicationMapper.java b/src/main/java/com/bonus/gzgqj/business/plan/mapper/PlanApplicationMapper.java index 888a078..19425c2 100644 --- a/src/main/java/com/bonus/gzgqj/business/plan/mapper/PlanApplicationMapper.java +++ b/src/main/java/com/bonus/gzgqj/business/plan/mapper/PlanApplicationMapper.java @@ -55,7 +55,7 @@ public interface PlanApplicationMapper { * @param o * @return */ - List getDetailsList(PlanApplyBean o); + List getDetailsList(PlanDataDetailBean o); /** * 删除详情数据 * @param o diff --git a/src/main/java/com/bonus/gzgqj/business/plan/service/PlanApplicationService.java b/src/main/java/com/bonus/gzgqj/business/plan/service/PlanApplicationService.java index ac907fe..d1b5b2a 100644 --- a/src/main/java/com/bonus/gzgqj/business/plan/service/PlanApplicationService.java +++ b/src/main/java/com/bonus/gzgqj/business/plan/service/PlanApplicationService.java @@ -41,7 +41,7 @@ public interface PlanApplicationService { * @param o * @return */ - List getDetailsList(PlanApplyBean o); + List getDetailsList(PlanDataDetailBean o); /** * 修改审核记录 * @param o @@ -64,4 +64,11 @@ public interface PlanApplicationService { * @return */ List getTypeList(PlanDevBean data); + + /** + * 分页查询详情 + * @param data + * @return + */ + List getPlanDetailsList(PlanDataDetailBean data); } diff --git a/src/main/java/com/bonus/gzgqj/business/plan/service/PlanApplicationServiceImp.java b/src/main/java/com/bonus/gzgqj/business/plan/service/PlanApplicationServiceImp.java index 2c39fbf..111693e 100644 --- a/src/main/java/com/bonus/gzgqj/business/plan/service/PlanApplicationServiceImp.java +++ b/src/main/java/com/bonus/gzgqj/business/plan/service/PlanApplicationServiceImp.java @@ -168,9 +168,7 @@ public class PlanApplicationServiceImp implements PlanApplicationService { try { PlanApplyBean vo=dao.getPlanDetailsbyId(o); List auditList=dao.getAuditList(o); - List details=dao.getDetailsList(o); vo.setAuditList(auditList); - vo.setDetails(details); return ServerResponse.createSuccess(vo); }catch (Exception e) { log.error(e.toString(), e); @@ -178,13 +176,25 @@ public class PlanApplicationServiceImp implements PlanApplicationService { return ServerResponse.createSuccess(new PlanDevBean()); } + @Override + public List getPlanDetailsList(PlanDataDetailBean data) { + List details=new ArrayList<>(); + try { + + details=dao.getDetailsList(data); + return details; + }catch (Exception e) { + log.error(e.toString(), e); + } + return new ArrayList(); + } /** * 获取数据详情 */ @Override - public List getDetailsList(PlanApplyBean o) { + public List getDetailsList(PlanDataDetailBean o) { List details=dao.getDetailsList(o); return details; } @@ -231,4 +241,5 @@ public class PlanApplicationServiceImp implements PlanApplicationService { } + } diff --git a/src/main/resources/mappers/plan/PlanApplicationMapper.xml b/src/main/resources/mappers/plan/PlanApplicationMapper.xml index b01118b..64d49d4 100644 --- a/src/main/resources/mappers/plan/PlanApplicationMapper.xml +++ b/src/main/resources/mappers/plan/PlanApplicationMapper.xml @@ -151,13 +151,23 @@ ORDER BY tpr.audit_time DESC - select id,apply_id applyId,model_id moduleId, need_num needNum,need_day times, remark remarks,type,name typeName, module,unit from t_plan_details - where apply_id=#{id} ORDER BY id asc + where apply_id=#{id} + + and type like concat('%',#{type},'%') + + + and name like concat('%',#{name},'%') + + + and module like concat('%',#{model},'%') + + ORDER BY id asc