From b7d6f4cbaa6f7dab0fe6277cf88fc1c798287190 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期五, 21 二月 2025 11:55:03 +0800 Subject: [PATCH] 修改报修 --- ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/IndexController.java | 2 +- ruoyi-system/src/main/resources/mapper/system/TItemTypeMapper.xml | 16 ++++++++++++---- ruoyi-system/src/main/java/com/ruoyi/system/service/TItemTypeService.java | 2 +- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TItemTypeServiceImpl.java | 4 ++-- ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TFaultRepairMessageController.java | 12 ++++-------- ruoyi-system/src/main/java/com/ruoyi/system/mapper/TItemTypeMapper.java | 2 +- ruoyi-system/src/main/resources/mapper/system/TFaultRepairMessageMapper.xml | 5 ++++- ruoyi-system/src/main/java/com/ruoyi/system/query/TFaultRepairMessageAppletQuery.java | 2 ++ 8 files changed, 27 insertions(+), 18 deletions(-) diff --git a/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/IndexController.java b/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/IndexController.java index 23e8f91..21ea926 100644 --- a/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/IndexController.java +++ b/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/IndexController.java @@ -267,7 +267,7 @@ * 获取报修管理列表 */ @ApiOperation(value = "管理员-房屋维修分页列表") - @PostMapping(value = "/houstPageList") + @PostMapping(value = "/housePageList") public R<PageInfo<TFaultRepairMessageVO>> pageList(@RequestBody TFaultRepairMessageAppletQuery query) { return R.ok(tFaultRepairMessageService.pageListApplet(query)); } diff --git a/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TFaultRepairMessageController.java b/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TFaultRepairMessageController.java index fae3037..cc86304 100644 --- a/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TFaultRepairMessageController.java +++ b/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TFaultRepairMessageController.java @@ -14,11 +14,7 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.time.LocalDate; import java.util.List; @@ -62,9 +58,9 @@ * 获取维修物品二级结构 */ @ApiOperation(value = "获取维修物品二级结构") - @PostMapping(value = "/getItemList") - public R<List<TItemTypeVO>> getItemList() { - List<TItemTypeVO> itemTypes = itemTypeService.getItemList(); + @GetMapping(value = "/getItemList") + public R<List<TItemTypeVO>> getItemList(@RequestParam(required = false) String itemName) { + List<TItemTypeVO> itemTypes = itemTypeService.getItemList(itemName); List<TItem> items = itemService.list(); itemTypes.forEach(itemType -> { itemType.setItemList(items.stream().filter(item -> itemType.getId().equals(item.getTypeId())).collect(Collectors.toList())); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TItemTypeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TItemTypeMapper.java index 3edc837..7ded449 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TItemTypeMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TItemTypeMapper.java @@ -27,7 +27,7 @@ */ List<TItemType> pageList(@Param("query") TItemTypeQuery query, @Param("pageInfo")PageInfo<TItemType> pageInfo); - List<TItemTypeVO> getItemList(); + List<TItemTypeVO> getItemList(@Param("itemName") String itemName); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/query/TFaultRepairMessageAppletQuery.java b/ruoyi-system/src/main/java/com/ruoyi/system/query/TFaultRepairMessageAppletQuery.java index a7a772c..aa43d32 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/query/TFaultRepairMessageAppletQuery.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/query/TFaultRepairMessageAppletQuery.java @@ -11,4 +11,6 @@ @ApiModelProperty(value = "房屋地址") private String houseAddress; + @ApiModelProperty(value = "处理状态 1=待处理 2=已处理") + private Integer status; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/TItemTypeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/TItemTypeService.java index 14ee3d1..3b8af03 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/TItemTypeService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/TItemTypeService.java @@ -32,5 +32,5 @@ */ PageInfo<TItemType> pageList(TItemTypeQuery query); - List<TItemTypeVO> getItemList(); + List<TItemTypeVO> getItemList(String itemName); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TItemTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TItemTypeServiceImpl.java index d579295..be72660 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TItemTypeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TItemTypeServiceImpl.java @@ -46,7 +46,7 @@ } @Override - public List<TItemTypeVO> getItemList() { - return this.baseMapper.getItemList(); + public List<TItemTypeVO> getItemList(String itemName) { + return this.baseMapper.getItemList(itemName); } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TFaultRepairMessageMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TFaultRepairMessageMapper.xml index f39bab5..217157a 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TFaultRepairMessageMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TFaultRepairMessageMapper.xml @@ -167,7 +167,10 @@ LEFT JOIN t_tenant tnt ON t.tenant_id = tnt.id <where> <if test="query.houseAddress != null and query.houseAddress != ''"> - AND tnt.service_address LIKE CONCAT('%', #{query.houseAddress}, '%') + AND t.service_address LIKE CONCAT('%', #{query.houseAddress}, '%') + </if> + <if test="query.status != null"> + AND t.status = #{query.status} </if> AND t.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} </where> diff --git a/ruoyi-system/src/main/resources/mapper/system/TItemTypeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TItemTypeMapper.xml index 4f0c44e..c92258e 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TItemTypeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TItemTypeMapper.xml @@ -26,11 +26,19 @@ ORDER BY sort_by,create_time DESC </select> <select id="getItemList" resultType="com.ruoyi.system.vo.TItemTypeVO"> - select - <include refid="Base_Column_List"/> + select <include refid="Base_Column_List"></include> from t_item_type - where disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} - ORDER BY sort_by,create_time DESC + where id in ( + select + tit.id + from t_item_type tit + left join t_item ti on tit.id = ti.type_id + where tit.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} + <if test="itemName != null and itemName != ''"> + and ti.item_name like concat('%', #{itemName}, '%') + </if> + GROUP BY tit.id + ORDER BY tit.sort_by,tit.create_time DESC) </select> </mapper> -- Gitblit v1.7.1