From 3ba3c7e42eeeb919a18311b2c4c88dcba984fbce Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Thu, 10 Oct 2024 09:14:20 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/iocoder/yudao/common/MessageSend.java | 20 ++++++++++++++++++ .../iocoder/yudao/common/dto/MessageDTO.java | 21 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/common/MessageSend.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/common/dto/MessageDTO.java diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/MessageSend.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/MessageSend.java new file mode 100644 index 00000000..6792d8c3 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/MessageSend.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.common; + +import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * 用于发送消息 + * + * @author 小李 + * @date 17:15 2024/10/9 +**/ +@Component +public class MessageSend { + + @Resource + private NotifyMessageSendApi messageSendApi; + +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/dto/MessageDTO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/dto/MessageDTO.java new file mode 100644 index 00000000..b0c9e67a --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/dto/MessageDTO.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.common.dto; + +import lombok.Data; + +/** + * 用于发消息 + * + * @author 小李 + * @date 17:34 2024/10/9 +**/ +@Data +public class MessageDTO { + + /** 接收方id 来自system_users */ + private Long userId; + + /** 使用的模板code */ + private String templateCode; + + +} From de124e1fbc929478170e31a34e95f7d43db77a3f Mon Sep 17 00:00:00 2001 From: lzttt <1803073139@qq.com> Date: Thu, 10 Oct 2024 09:59:38 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B7=A5=E4=BA=BA?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=8F=8A=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/mapper/RepairWorkerMapper.java | 11 ++++++++- .../base/service/RepairRecordsService.java | 2 ++ .../impl/RepairRecordsServiceImpl.java | 2 +- .../service/impl/RepairWorkerServiceImpl.java | 24 ++++++++++++------- .../mapper/base/RepairWorkerMapper.xml | 13 +++++++++- 5 files changed, 41 insertions(+), 11 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/mapper/RepairWorkerMapper.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/mapper/RepairWorkerMapper.java index 9ab4ea7a..980d8c6b 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/mapper/RepairWorkerMapper.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/mapper/RepairWorkerMapper.java @@ -9,6 +9,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 * @@ -26,4 +28,11 @@ public interface RepairWorkerMapper extends BaseMapper { **/ IPage queryListPage(@Param("entity") RepairWorkerPageReqVO entity, Page page); -} \ No newline at end of file + /** + * 获取所有维修工人的id + * @return List 维修工人id列表 + * @author lzt + * @date 2024年10月10日 + **/ + List getAllWorkerIds(); +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairRecordsService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairRecordsService.java index 5eeee7e5..3f308cbe 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairRecordsService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairRecordsService.java @@ -57,4 +57,6 @@ public interface RepairRecordsService extends IService { */ List queryAllRepairRecords(RepairRecordsPageReqVO pageReqVO); + + } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairRecordsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairRecordsServiceImpl.java index 967b0b36..99a13819 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairRecordsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairRecordsServiceImpl.java @@ -62,7 +62,7 @@ public class RepairRecordsServiceImpl extends ServiceImpl queryAllRepairRecords(RepairRecordsPageReqVO pageReqVO) { 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 595a1b3f..26ae84be 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 @@ -36,20 +36,28 @@ public class RepairWorkerServiceImpl extends ServiceImpl userList) { if (CollectionUtil.isNotEmpty(userList)){ + //获取已有的维修工人ID列表 + List existingWorkerIds = workerMapper.getAllWorkerIds(); + List saveList = new ArrayList<>(); userList.forEach(item -> { - RepairWorker worker = new RepairWorker(); - worker.setUserId(item.getId()); - worker.setUserName(item.getNickname()); - saveList.add(worker); + if (!existingWorkerIds.contains(item.getId())) { + RepairWorker worker = new RepairWorker(); + worker.setUserId(item.getId()); + worker.setUserName(item.getNickname()); + saveList.add(worker); + } }); - saveBatch(saveList); + + if (!saveList.isEmpty()) { + saveBatch(saveList); + } } } @@ -84,4 +92,4 @@ public class RepairWorkerServiceImpl extends ServiceImpl - \ No newline at end of file + + + + + From c6470ac0787418f2daec2dfbf8c7c47d510309c1 Mon Sep 17 00:00:00 2001 From: lzttt <1803073139@qq.com> Date: Thu, 10 Oct 2024 11:29:29 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=8C=82=E8=B4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 数据库设计/蓝安集团一体化平台.pdma.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/数据库设计/蓝安集团一体化平台.pdma.json b/数据库设计/蓝安集团一体化平台.pdma.json index 11c9a81c..6a65d220 100644 --- a/数据库设计/蓝安集团一体化平台.pdma.json +++ b/数据库设计/蓝安集团一体化平台.pdma.json @@ -4,7 +4,7 @@ "avatar": "", "version": "4.9.2", "createdTime": "2024-10-9 10:34:15", - "updatedTime": "2024-10-9 17:32:50", + "updatedTime": "2024-10-10 10:48:48", "dbConns": [], "profile": { "default": { @@ -683,7 +683,7 @@ "optionsFetcher": "" } }, - "menuWidth": "266px" + "menuWidth": "298px" }, "entities": [ { From 9a4ff242d642293e0737e70591f248b18f403074 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Thu, 10 Oct 2024 11:48:15 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/iocoder/yudao/common/MessageSend.java | 20 ------------------ .../iocoder/yudao/common/dto/MessageDTO.java | 21 ------------------- .../rescue/utils/RedissonDelayQueue.java | 5 ----- 3 files changed, 46 deletions(-) delete mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/common/MessageSend.java delete mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/common/dto/MessageDTO.java diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/MessageSend.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/MessageSend.java deleted file mode 100644 index 6792d8c3..00000000 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/MessageSend.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.iocoder.yudao.common; - -import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * 用于发送消息 - * - * @author 小李 - * @date 17:15 2024/10/9 -**/ -@Component -public class MessageSend { - - @Resource - private NotifyMessageSendApi messageSendApi; - -} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/dto/MessageDTO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/dto/MessageDTO.java deleted file mode 100644 index b0c9e67a..00000000 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/dto/MessageDTO.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.iocoder.yudao.common.dto; - -import lombok.Data; - -/** - * 用于发消息 - * - * @author 小李 - * @date 17:34 2024/10/9 -**/ -@Data -public class MessageDTO { - - /** 接收方id 来自system_users */ - private Long userId; - - /** 使用的模板code */ - private String templateCode; - - -} diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/utils/RedissonDelayQueue.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/utils/RedissonDelayQueue.java index 0f31807a..4cf692c9 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/utils/RedissonDelayQueue.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/utils/RedissonDelayQueue.java @@ -1,18 +1,13 @@ package cn.iocoder.yudao.module.rescue.utils; -import cn.hutool.extra.spring.SpringUtil; import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; import cn.iocoder.yudao.module.appBase.domain.SysAnnouncement; import cn.iocoder.yudao.module.appBase.service.ISysAnnouncementService; import cn.iocoder.yudao.module.constant.UserConstants; import cn.iocoder.yudao.module.rescue.dto.TaskDto; import cn.iocoder.yudao.module.system.api.permission.PermissionApi; -import cn.iocoder.yudao.module.system.api.permission.RoleApi; -import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; -import cn.iocoder.yudao.module.system.service.permission.PermissionService; import cn.iocoder.yudao.module.system.service.permission.RoleService; -import cn.iocoder.yudao.module.system.service.user.AdminUserService; import com.alibaba.fastjson.JSON; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; From cc8c9e3ea8c2e813d44dcac7fe0857154271fb1c Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Thu, 10 Oct 2024 12:02:32 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/iocoder/yudao/common/MessageSend.java | 51 +++++++++++++++++++ .../iocoder/yudao/common/dto/MessageDTO.java | 24 +++++++++ 2 files changed, 75 insertions(+) create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/common/MessageSend.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/common/dto/MessageDTO.java diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/common/MessageSend.java b/dl-module-base/src/main/java/cn/iocoder/yudao/common/MessageSend.java new file mode 100644 index 00000000..deb65978 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/common/MessageSend.java @@ -0,0 +1,51 @@ +package cn.iocoder.yudao.common; + +import cn.hutool.core.collection.CollectionUtil; +import cn.iocoder.yudao.common.dto.MessageDTO; +import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi; +import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; + +/** + * 用于发送消息 + * + * @author 小李 + * @date 17:15 2024/10/9 + **/ +@Component +public class MessageSend { + + @Resource + private NotifyMessageSendApi messageSendApi; + + /** + * 通用消息发送 + * + * @param messageDTO 消息对象 + * @author 小李 + * @date 9:58 2024/10/10 + **/ + public void send(MessageDTO messageDTO) { + // 设置参数 + Map map = new HashMap<>(); + for (int i = 1; i <= messageDTO.getParamList().size(); i++) { + map.put("key" + i, messageDTO.getParamList().get(i - 1)); + } + if (CollectionUtil.isEmpty(messageDTO.getUserIds())){ + throw exception0(500, "没有接收人"); + } + messageDTO.getUserIds().forEach(id -> { + messageSendApi.sendSingleMessageToAdmin( + new NotifySendSingleToUserReqDTO() + .setUserId(id) + .setTemplateCode(messageDTO.getTemplateCode()) + .setTemplateParams(map)); + }); + } +} diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/common/dto/MessageDTO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/common/dto/MessageDTO.java new file mode 100644 index 00000000..c1ccb675 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/common/dto/MessageDTO.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.common.dto; + +import lombok.Data; + +import java.util.List; + +/** + * 用于发消息 + * + * @author 小李 + * @date 17:34 2024/10/9 + **/ +@Data +public class MessageDTO { + + /** 接收方ids 来自system_users */ + private List userIds; + + /** 模板枚举 */ + private String templateCode; + + /** 参数列表 */ + private List paramList; +} From aa1d5a202c119488b66a3a4b25cf209c617b2f38 Mon Sep 17 00:00:00 2001 From: lzttt <1803073139@qq.com> Date: Thu, 10 Oct 2024 16:14:50 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=8F=AF=E6=8C=82=E8=B4=A6=EF=BC=88=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iocoder/yudao/module/custom/entity/CustomerMain.java | 7 ++++++- .../main/resources/mapper/custom/CustomerMainMapper.xml | 5 ++++- .../base/controller/admin/RepairRecordsController.java | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CustomerMain.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CustomerMain.java index 417179ba..e5279f05 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CustomerMain.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CustomerMain.java @@ -106,4 +106,9 @@ public class CustomerMain extends TenantBaseDO { */ private String memberLevelId; -} \ No newline at end of file + /** + * 是否挂账 + */ + private String isHangAccount; + +} diff --git a/dl-module-base/src/main/resources/mapper/custom/CustomerMainMapper.xml b/dl-module-base/src/main/resources/mapper/custom/CustomerMainMapper.xml index f7010d02..80311869 100644 --- a/dl-module-base/src/main/resources/mapper/custom/CustomerMainMapper.xml +++ b/dl-module-base/src/main/resources/mapper/custom/CustomerMainMapper.xml @@ -34,6 +34,7 @@ main.near_do_time AS nearDoTime, main.near_do_content AS nearDoContent, main.inviter AS inviter, + main.is_hang_account AS isHangAccount, main.inviter_type AS inviterType, main.status AS status, group_concat(item.ser_content) AS serContents, @@ -102,6 +103,8 @@ main.near_do_content AS nearDoContent, main.inviter AS inviter, main.inviter_type AS inviterType, + main.member_level_id AS memberLevelId, + main.is_hang_account AS isHangAccount, main.STATUS AS STATUS, group_concat( item.ser_content ) AS serContents, memberLevel.NAME AS levelName, @@ -131,4 +134,4 @@ where bcc.deleted = '0' and bcc.car_id = #{carId} - \ No newline at end of file + diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairRecordsController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairRecordsController.java index 4ce74ca3..51ad4323 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairRecordsController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairRecordsController.java @@ -61,7 +61,7 @@ public class RepairRecordsController { /** * 维修工查询维修记录 - * @param pageReqVO 维修工分页查询条件 + * @param pageReqVO * */ @GetMapping("/page") From 26e5fedf4bb7c15c49bdb366572ceec65b270029 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Thu, 10 Oct 2024 16:42:06 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=85=AC=E5=91=8A-?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/notice/controller/admin/DlBaseNoticeController.java | 2 +- .../cn/iocoder/yudao/module/notice/entity/DlBaseNotice.java | 3 ++- yudao-server/src/main/resources/application.yaml | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/controller/admin/DlBaseNoticeController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/controller/admin/DlBaseNoticeController.java index 767afdef..ecaade36 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/controller/admin/DlBaseNoticeController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/controller/admin/DlBaseNoticeController.java @@ -75,7 +75,7 @@ public class DlBaseNoticeController { return CommonResult.ok(); } - @GetMapping("get") + @GetMapping("/get") @Operation(summary = "平台通用信息公告 查询 按服务") public CommonResult getNoticeById(@RequestParam("id") String id) { return success(dlBaseNoticeService.getById(id)); diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/entity/DlBaseNotice.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/entity/DlBaseNotice.java index 7afcb0c2..1d19eb53 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/entity/DlBaseNotice.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/entity/DlBaseNotice.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.notice.entity; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; @@ -16,7 +17,7 @@ import lombok.EqualsAndHashCode; @TableName(value ="dl_base_notice") @Data @EqualsAndHashCode(callSuper = true) -public class DlBaseNotice extends TenantBaseDO { +public class DlBaseNotice extends BaseDO { /** * 公告ID */ diff --git a/yudao-server/src/main/resources/application.yaml b/yudao-server/src/main/resources/application.yaml index 5abc9474..232d9df4 100644 --- a/yudao-server/src/main/resources/application.yaml +++ b/yudao-server/src/main/resources/application.yaml @@ -296,6 +296,7 @@ yudao: - /admin-api/rescue/driverLogin - /admin-api/rescuePayApi/payNotify - /admin-api/payApi/payNotify + - /admin-api/base/notice/** ignore-tables: - system_tenant @@ -342,6 +343,7 @@ yudao: - tmp_report_data_1 - tmp_report_data_income - system_users + - dl_base_notice ignore-caches: - permission_menu_ids - oauth_client