From b0df9941d936be22f665c1abdf08608ee3fd8ae1 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Fri, 18 Oct 2024 16:37:31 +0800 Subject: [PATCH 1/6] 1 --- .../src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java index 04c9fa5d..442558c7 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java @@ -64,7 +64,7 @@ public enum RecordTypeEnum { * @param code code * @return cn.iocoder.yudao.common.SystemEnum **/ - public static RecordTypeEnum getRepairRole(String code) { + public static RecordTypeEnum getEnumByCode(String code) { for (RecordTypeEnum thisEnum : RecordTypeEnum.values()) { if (thisEnum.getCode().equalsIgnoreCase(code)) { // 找到对应的枚举 From 88e5379ea2bf82a02a85ea51c492ff6c54ee64f2 Mon Sep 17 00:00:00 2001 From: PQZ Date: Fri, 18 Oct 2024 16:50:38 +0800 Subject: [PATCH 2/6] 111 --- .../iocoder/yudao/common/BaseConstants.java | 2 + .../base/service/RepairWorkerService.java | 9 +++ .../service/impl/RepairWorkerServiceImpl.java | 55 +++++++++++++++++-- .../impl/DlRepairTicketsServiceImpl.java | 1 + 4 files changed, 61 insertions(+), 6 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java b/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java index 564a4167..f104692e 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java @@ -55,6 +55,8 @@ public class BaseConstants { public static final Integer BATCH_SIZE = 100; /**资质临期通知模板*/ public static final String QUALS_INTERIM_PERIOD = "quals_interim_period"; + /**站内信模版*/ + public static final String TICKET_EMPLOY = "ticket_employ"; /**资质过期通知模板*/ public static final String QUALS_EXPIRED = "quals_expired"; /** 资产临期通知模板 */ diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairWorkerService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairWorkerService.java index 730e7e3d..c267c455 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairWorkerService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairWorkerService.java @@ -69,6 +69,15 @@ public interface RepairWorkerService extends IService { **/ List listByTicketId(String ticketId); + /** + * 向指定用户发送消息 + * @author PQZ + * @date 16:27 2024/10/18 + * @param userId 用户id + * @param text 消息通知内容 + **/ + void sentMessage(Long userId,String text); + /** * 通过班组长的id查该班组的员工 * diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairWorkerServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairWorkerServiceImpl.java index c06edd16..3fc5a4dd 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairWorkerServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairWorkerServiceImpl.java @@ -2,13 +2,18 @@ package cn.iocoder.yudao.module.base.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.module.app.controller.admin.NotifyMessageSocket; import cn.iocoder.yudao.module.base.entity.RepairWorker; import cn.iocoder.yudao.module.base.mapper.RepairWorkerMapper; import cn.iocoder.yudao.module.base.service.RepairWorkerService; import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO; import cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO; import cn.iocoder.yudao.module.base.vo.RepairWorkerSaveReqVO; +import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi; +import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO; +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; import cn.iocoder.yudao.module.system.api.user.dto.UserDTO; import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem; import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService; @@ -16,14 +21,18 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.io.IOException; import java.util.*; import java.util.stream.Collectors; +import static cn.iocoder.yudao.common.BaseConstants.TICKET_EMPLOY; + /** * 维修工人 Service 实现类 * @@ -39,6 +48,12 @@ public class RepairWorkerServiceImpl extends ServiceImpl userList) { - if (CollectionUtil.isNotEmpty(userList)){ + if (CollectionUtil.isNotEmpty(userList)) { //获取已有的维修工人ID列表 List existingWorkerIds = workerMapper.getAllWorkerIds(); @@ -98,18 +113,18 @@ public class RepairWorkerServiceImpl extends ServiceImpl queryListPage(RepairWorkerPageReqVO pageReqVO, Page page) { - return workerMapper.queryListPage(pageReqVO,page); + return workerMapper.queryListPage(pageReqVO, page); } /** * 通过工单ID查到工单ID中所选择的员工信息 * + * @param ticketId 工单ID * @author 小李 * @date 15:53 2024/10/14 - * @param ticketId 工单ID **/ @Override - public List listByTicketId(String ticketId){ + public List listByTicketId(String ticketId) { // 查工单的项目信息 List titems = dlRepairTitemService.list(new LambdaQueryWrapper() .and(item -> { @@ -122,6 +137,34 @@ public class RepairWorkerServiceImpl extends ServiceImpl templateParams = new HashMap<>(); + // 发送模版内容 + templateParams.put("text", text); + // 发送站内信 + sendApi.sendSingleMessageToAdmin(new NotifySendSingleToUserReqDTO() + .setUserId(userId) + .setTemplateCode(TICKET_EMPLOY).setTemplateParams(templateParams)); + //发送语音提醒 + notifyMessageSocket.sendMessage(text, loginUser.getTenantId().toString(), userId.toString()); + } catch (IOException e) { + e.printStackTrace(); + } + } + /** * 通过班组长的id查该班组的员工 * @@ -129,7 +172,7 @@ public class RepairWorkerServiceImpl extends ServiceImpl listByLeads(){ + public List listByLeads() { // 取班组长的记录 RepairWorker worker = baseMapper.selectOne(new LambdaQueryWrapper().eq(RepairWorker::getUserId, SecurityFrameworkUtils.getLoginUserId())); // 根据班组长的工种查所有该工程的工人 @@ -149,7 +192,7 @@ public class RepairWorkerServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper() - .eq(RepairWorker::getUserId,userId); + .eq(RepairWorker::getUserId, userId); List list = this.list(queryWrapper); return !list.isEmpty() && "1".equals(list.get(0).getIsLeads()); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java index 9cdd4c24..d322a4c4 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java @@ -509,6 +509,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl Date: Fri, 18 Oct 2024 16:52:30 +0800 Subject: [PATCH 3/6] 1 --- .../iocoder/yudao/common/BaseConstants.java | 15 --------------- .../iocoder/yudao/common/RecordTypeEnum.java | 6 +++++- .../impl/DlRepairTicketsServiceImpl.java | 19 +++++++++++++------ 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java b/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java index 564a4167..24281f66 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java @@ -105,21 +105,6 @@ public class BaseConstants { /**维修记录*/ public static final String REPAIR_RECORD_TYPE_RECORD = "record"; - /**创建工单*/ - public static final String REPAIR_RECORD_TYPE_CJGD = "cjgd"; - /**指派施工*/ - public static final String REPAIR_RECORD_TYPE_ZPSG = "zpsg"; - /**领料*/ - public static final String REPAIR_RECORD_TYPE_LL = "ll"; - /**退料*/ - public static final String REPAIR_RECORD_TYPE_TL = "tl"; - /**施工完成(自检)*/ - public static final String REPAIR_RECORD_TYPE_SGWCZJ = "sgwczj"; - /**总检*/ - public static final String REPAIR_RECORD_TYPE_ZJ = "zj"; - /**结束工单*/ - public static final String REPAIR_RECORD_TYPE_JSGD = "jsgd"; - } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java index 442558c7..00ce000f 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java @@ -46,7 +46,11 @@ public enum RecordTypeEnum { /** * 施工中 */ - SGZ("sgz","施工中"); + SGZ("sgz","施工中"), + /** + * 接单 + */ + jd("jd","接单"); /** * code diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java index 9cdd4c24..cd677d1b 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java @@ -3,12 +3,10 @@ package cn.iocoder.yudao.module.tickets.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; -import cn.iocoder.yudao.common.RepairErrorCodeConstants; -import cn.iocoder.yudao.common.RepairRoleEnum; -import cn.iocoder.yudao.common.TicketsStatusEnum; -import cn.iocoder.yudao.common.TicketsWorkStatusEnum; +import cn.iocoder.yudao.common.*; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.base.entity.RepairWorker; +import cn.iocoder.yudao.module.base.service.RepairRecordsService; import cn.iocoder.yudao.module.base.service.RepairWorkerService; import cn.iocoder.yudao.module.booking.entity.DlRepairBooking; import cn.iocoder.yudao.module.booking.service.DlRepairBookingService; @@ -52,6 +50,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.deepoove.poi.XWPFTemplate; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; @@ -135,6 +134,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl() - .set(DlRepairTickets::getTicketsWorkStatus, "02") + .set(DlRepairTickets::getTicketsWorkStatus, TicketsWorkStatusEnum.RECEIVED) .and(item -> { item.eq(DlRepairTickets::getId, id) - .eq(DlRepairTickets::getTicketsWorkStatus, "01"); + .eq(DlRepairTickets::getTicketsWorkStatus, TicketsWorkStatusEnum.WAITING_RECEIVING); })); if (update != 1){ throw exception0(500, "工单已被其他人接单了"); } + //最后记录操作日志--接单 + repairRecordsService.saveRepairRecord(id,null, RecordTypeEnum.jd.getCode(), "接单",null); } /** @@ -509,6 +514,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl Date: Fri, 18 Oct 2024 17:11:58 +0800 Subject: [PATCH 4/6] =?UTF-8?q?app=E6=96=B0=E5=BB=BA=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E8=B5=B0=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/RepairProjectController.java | 9 +++++ .../project/mapper/RepairProjectMapper.java | 8 ++++ .../project/service/RepairProjectService.java | 8 ++++ .../impl/RepairProjectServiceImpl.java | 38 +++++++++++++++++++ .../module/project/vo/RepairProjectAppvo.java | 13 +++++++ .../mapper/project/RepairProjectMapper.xml | 12 ++++++ 6 files changed, 88 insertions(+) create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairProjectAppvo.java diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java index c2874b70..db435e3d 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java @@ -128,4 +128,13 @@ public class RepairProjectController { List list = repairProjectService.list(new LambdaQueryWrapper().eq(RepairProject::getName, name)); return success(list.stream().max(Comparator.comparing(RepairProject::getCreateTime)).orElse(null)); } + + /** + * 获取维修项目和分类 + * @return + */ + @GetMapping("/getRepairProjectAndCateGory") + public CommonResult getRepairProjectAndCateGory(){ + return success(repairProjectService.getRepairProjectAndCateGory()); + } } \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/mapper/RepairProjectMapper.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/mapper/RepairProjectMapper.java index a35fbe10..d57ec2f0 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/mapper/RepairProjectMapper.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/mapper/RepairProjectMapper.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.project.mapper; import cn.iocoder.yudao.module.project.entity.RepairProject; +import cn.iocoder.yudao.module.project.vo.RepairProjectAppvo; import cn.iocoder.yudao.module.project.vo.RepairProjectPageReqVO; import cn.iocoder.yudao.module.project.vo.RepairProjectRespVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -9,6 +10,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 维修项目 Mapper * @@ -28,4 +31,9 @@ public interface RepairProjectMapper extends BaseMapper { **/ IPage selectListPage(@Param("entity") RepairProjectPageReqVO pageReqVO, Page page); + /** + * 查询维修项目和维修项目分类信息 + * @return + */ + List selectProjectAndCateGory(); } \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/RepairProjectService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/RepairProjectService.java index bc23ab89..9cb2a453 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/RepairProjectService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/RepairProjectService.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.project.service; import cn.iocoder.yudao.module.project.entity.RepairProject; +import cn.iocoder.yudao.module.project.vo.RepairProjectAppvo; import cn.iocoder.yudao.module.project.vo.RepairProjectPageReqVO; import cn.iocoder.yudao.module.project.vo.RepairProjectRespVO; import cn.iocoder.yudao.module.project.vo.RepairProjectSaveReqVO; @@ -9,6 +10,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * 维修项目 Service 接口 * @@ -56,4 +59,9 @@ public interface RepairProjectService extends IService { IPage queryListPage(RepairProjectPageReqVO pageReqVO, Page page); + /** + * 查询服务分类和维修项目列表 + * @return + */ + List getRepairProjectAndCateGory(); } \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/impl/RepairProjectServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/impl/RepairProjectServiceImpl.java index 7fdd8dfe..10afa53e 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/impl/RepairProjectServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/impl/RepairProjectServiceImpl.java @@ -1,9 +1,13 @@ package cn.iocoder.yudao.module.project.service.impl; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.module.project.entity.RepairProject; import cn.iocoder.yudao.module.project.mapper.RepairProjectMapper; import cn.iocoder.yudao.module.project.service.RepairProjectService; +import cn.iocoder.yudao.module.project.vo.RepairProjectAppvo; import cn.iocoder.yudao.module.project.vo.RepairProjectPageReqVO; import cn.iocoder.yudao.module.project.vo.RepairProjectRespVO; import cn.iocoder.yudao.module.project.vo.RepairProjectSaveReqVO; @@ -14,6 +18,9 @@ import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; /** * 维修项目 Service 实现类 @@ -82,5 +89,36 @@ public class RepairProjectServiceImpl extends ServiceImpl getRepairProjectAndCateGory() { + List repairProjectAppvos = repairProjectMapper.selectProjectAndCateGory(); + // 提取并去重 typeId + List uniqueTypeIds = repairProjectAppvos.stream() + .map(RepairProjectAppvo::getTypeId) + .distinct() + .collect(Collectors.toList()); + List list = new ArrayList<>(); + for (String uniqueTypeId : uniqueTypeIds) { + RepairProjectAppvo repairProjectAppvo = new RepairProjectAppvo(); + repairProjectAppvo.setTypeId(uniqueTypeId); + if (ObjectUtil.isNotEmpty(uniqueTypeId)) { + List filteredList = repairProjectAppvos.stream() + .filter(appvo -> uniqueTypeId.equals(appvo.getTypeId())) + .collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(filteredList)) { + repairProjectAppvo.setTypeName(filteredList.get(0).getTypeName()); + repairProjectAppvo.setGroupList(BeanUtil.copyToList(filteredList, RepairProject.class)); + } + } + list.add(repairProjectAppvo); + } + return list; + } + } \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairProjectAppvo.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairProjectAppvo.java new file mode 100644 index 00000000..66128b3e --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairProjectAppvo.java @@ -0,0 +1,13 @@ +package cn.iocoder.yudao.module.project.vo; + +import cn.iocoder.yudao.module.project.entity.RepairProject; +import lombok.Data; + +import java.util.List; + +@Data +public class RepairProjectAppvo extends RepairProject{ + private String typeName; + private String typeId; + private List groupList; +} diff --git a/dl-module-repair/src/main/resources/mapper/project/RepairProjectMapper.xml b/dl-module-repair/src/main/resources/mapper/project/RepairProjectMapper.xml index e2314d79..bb2dca22 100644 --- a/dl-module-repair/src/main/resources/mapper/project/RepairProjectMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/project/RepairProjectMapper.xml @@ -33,4 +33,16 @@ ORDER BY drp.create_time DESC + \ No newline at end of file From 524a66e6f1162f4bb96fcb721578f02a05266e1f Mon Sep 17 00:00:00 2001 From: Vinjor Date: Fri, 18 Oct 2024 17:48:29 +0800 Subject: [PATCH 5/6] 1 --- .../src/main/java/cn/iocoder/yudao/common/RepairCons.java | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java new file mode 100644 index 00000000..8a5a45c4 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java @@ -0,0 +1,2 @@ +package cn.iocoder.yudao.common;public class RepairCons { +} From 457c896ce815d9dac73d4132d81641bf2c24d296 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Fri, 18 Oct 2024 17:50:45 +0800 Subject: [PATCH 6/6] 1 --- .../cn/iocoder/yudao/common/RepairCons.java | 14 +++- .../admin/DlRepairTicketsController.java | 6 ++ .../tickets/mapper/DlRepairTicketsMapper.java | 10 ++- .../impl/DlRepairTicketsServiceImpl.java | 6 +- .../tickets/vo/DlRepairTicketsReqVO.java | 2 + .../mapper/tickets/DlRepairTicketsMapper.xml | 64 ++++++++++++++++--- 6 files changed, 91 insertions(+), 11 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java index 8a5a45c4..d0b8f61c 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java @@ -1,2 +1,14 @@ -package cn.iocoder.yudao.common;public class RepairCons { +package cn.iocoder.yudao.common; + +/** + * 维修系统常量 + * @author vinjor-M + * @date 17:44 2024/10/18 +**/ +public class RepairCons { + + /**工单-待处理*/ + public static final String TICKETS_WAITING = "waiting"; + /**工单-所有*/ + public static final String TICKETS_ALL = "all"; } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java index 659d5ad0..3ac7c5d2 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.tickets.controller.admin; +import cn.iocoder.yudao.common.RepairCons; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets; import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService; @@ -9,6 +10,7 @@ import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO; import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; +import org.apache.commons.lang3.StringUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -171,6 +173,10 @@ public class DlRepairTicketsController { @RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize){ Page page = new Page<>(pageNo, pageSize); + if(StringUtils.isEmpty(repairTicketsReqVO.getSelectType())){ + //查询类型为空,默认查待处理的 + repairTicketsReqVO.setSelectType(RepairCons.TICKETS_WAITING); + } return success(dlRepairTicketsService.getPageType(repairTicketsReqVO, page)); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java index 23dec322..4a53a9f2 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java @@ -27,13 +27,21 @@ public interface DlRepairTicketsMapper extends BaseMapper { IPage getTicketsPage(@Param("map") DlRepairTicketsReqVO repairTicketsReqVO, Page page); /** - * 分类查询工单分页 + * 分类查询工单分页----待处理的 * * @author 小李 * @date 16:26 2024/10/12 * @param repairTicketsReqVO 查询对象 **/ IPage getPageType(@Param("map") DlRepairTicketsReqVO repairTicketsReqVO, Page page); + /** + * 分类查询工单分页----所有记录 + * + * @author 小李 + * @date 16:26 2024/10/12 + * @param repairTicketsReqVO 查询对象 + **/ + IPage getPageTypeAll(@Param("map") DlRepairTicketsReqVO repairTicketsReqVO, Page page); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java index 1c55d600..1b7b3aa4 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java @@ -421,7 +421,11 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl userIds; + /** 查询类型(waiting 待处理的 | all 所有数据) */ + private String selectType; } diff --git a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml index 8272a711..3a2694cd 100644 --- a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml @@ -203,17 +203,65 @@ and drt.is_finish = #{map.isFinish} - and ( - - find_in_set(#{item}, drti.repair_ids) > 0 + and (drt.tickets_status = '05') + and (drt.now_repair_id in + + #{item} ) - - and (drt.now_repair_id in - - #{item} - + order by drt.create_time desc + + +