From 6303fc2162387b72bfb630189f60098951bb1b87 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 14 Oct 2021 14:51:18 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/org/CustomerGridDao.xml | 8 +++++--- .../main/resources/mapper/org/StatsCustomerAgencyDao.xml | 8 +++++--- .../src/main/resources/mapper/user/UserDao.xml | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml index b4935ce00c..52264cd938 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml @@ -134,9 +134,11 @@ WHERE del_flag = '0' AND customer_id = #{customerId} - - #{gridId} - + + + #{gridId} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml index 85bcc8e4cf..68cab60dd6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -212,9 +212,11 @@ WHERE del_flag = '0' AND customer_id = #{customerId} - - #{agencyId} - + + + #{agencyId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index f71bb10cca..e048aadd1d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -1005,9 +1005,11 @@ AND gsr.del_flag = '0' AND gsr.role_name = '网格员' AND cs.customer_id = #{customerId} - - #{staffId} - + + + #{staffId} + + From f9860426b9efeeb1e074c8e7e4bf02bc9f3111ba Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 14 Oct 2021 15:23:40 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=B7=A1=E6=9F=A5=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E7=94=9F=E4=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UserPatrolRecordController.java | 39 +++++++ .../opendata/dao/StaffPatrolDetailDao.java | 33 ++++++ .../opendata/dao/UserPatrolRecordDao.java | 33 ++++++ .../entity/StaffPatrolDetailEntity.java | 53 +++++++++ .../entity/UserPatrolRecordEntity.java | 106 ++++++++++++++++++ .../service/StaffPatrolDetailService.java | 32 ++++++ .../service/UserPatrolRecordService.java | 32 ++++++ .../impl/StaffPatrolDetailServiceImpl.java | 37 ++++++ .../impl/UserPatrolRecordServiceImpl.java | 38 +++++++ .../resources/mapper/StaffPatrolDetailDao.xml | 20 ++++ .../resources/mapper/UserPatrolRecordDao.xml | 30 +++++ 11 files changed, 453 insertions(+) create mode 100644 epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/UserPatrolRecordController.java create mode 100644 epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/StaffPatrolDetailDao.java create mode 100644 epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/UserPatrolRecordDao.java create mode 100644 epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/StaffPatrolDetailEntity.java create mode 100644 epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/UserPatrolRecordEntity.java create mode 100644 epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/StaffPatrolDetailService.java create mode 100644 epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/UserPatrolRecordService.java create mode 100644 epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/StaffPatrolDetailServiceImpl.java create mode 100644 epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java create mode 100644 epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/StaffPatrolDetailDao.xml create mode 100644 epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/UserPatrolRecordDao.xml diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/UserPatrolRecordController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/UserPatrolRecordController.java new file mode 100644 index 0000000000..db95af4fe2 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/UserPatrolRecordController.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.opendata.controller; + +import com.epmet.opendata.service.UserPatrolRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 用户巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@RestController +@RequestMapping("userpatrolrecord") +public class UserPatrolRecordController { + + @Autowired + private UserPatrolRecordService userPatrolRecordService; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/StaffPatrolDetailDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/StaffPatrolDetailDao.java new file mode 100644 index 0000000000..4e9616a59e --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/StaffPatrolDetailDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.entity.StaffPatrolDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Mapper +public interface StaffPatrolDetailDao extends BaseDao { + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/UserPatrolRecordDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/UserPatrolRecordDao.java new file mode 100644 index 0000000000..7c40b093a3 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/UserPatrolRecordDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.entity.UserPatrolRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Mapper +public interface UserPatrolRecordDao extends BaseDao { + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/StaffPatrolDetailEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/StaffPatrolDetailEntity.java new file mode 100644 index 0000000000..83a7e684a5 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/StaffPatrolDetailEntity.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_patrol_detail") +public class StaffPatrolDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * staff_patrol_record.ID + */ + private String staffPatrolRecId; + + /** + * 路线 + */ + private String route; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/UserPatrolRecordEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/UserPatrolRecordEntity.java new file mode 100644 index 0000000000..21b02c6c98 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/UserPatrolRecordEntity.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_patrol_record") +public class UserPatrolRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格id + */ + private String grid; + + /** + * 网格所有上级id + */ + private String gridPids; + + /** + * 用户id + */ + private String staffId; + + /** + * 工作人员所属组织id=网格所属的组织id + */ + private String agencyId; + + /** + * 巡查开始时间 + */ + private Date patrolStartTime; + + /** + * 巡查结束时间 + */ + private Date patrolEndTime; + + /** + * 实际结束时间 + */ + private Date actrualEndTime; + + /** + * 巡查开始地点 + */ + private String startLocation; + + /** + * 巡查结束地点 + */ + private String endLocation; + + /** + * 本次巡查总耗时,单位秒 + */ + private Integer totalTime; + + /** + * 巡查距离,单位米 + */ + private Integer distance; + + /** + * 正在巡查中:patrolling;结束:end + */ + private String status; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/StaffPatrolDetailService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/StaffPatrolDetailService.java new file mode 100644 index 0000000000..e37d8627b0 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/StaffPatrolDetailService.java @@ -0,0 +1,32 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.opendata.entity.StaffPatrolDetailEntity; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +public interface StaffPatrolDetailService extends BaseService { + + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/UserPatrolRecordService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/UserPatrolRecordService.java new file mode 100644 index 0000000000..82a95295a9 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/UserPatrolRecordService.java @@ -0,0 +1,32 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.opendata.entity.UserPatrolRecordEntity; + +/** + * 用户巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +public interface UserPatrolRecordService extends BaseService { + + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/StaffPatrolDetailServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/StaffPatrolDetailServiceImpl.java new file mode 100644 index 0000000000..bb9bbfc89d --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/StaffPatrolDetailServiceImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.opendata.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.opendata.dao.StaffPatrolDetailDao; +import com.epmet.opendata.entity.StaffPatrolDetailEntity; +import com.epmet.opendata.service.StaffPatrolDetailService; +import org.springframework.stereotype.Service; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Service +public class StaffPatrolDetailServiceImpl extends BaseServiceImpl implements StaffPatrolDetailService { + + + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java new file mode 100644 index 0000000000..746c8c0adf --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.opendata.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.opendata.dao.UserPatrolRecordDao; +import com.epmet.opendata.entity.UserPatrolRecordEntity; +import com.epmet.opendata.service.UserPatrolRecordService; +import org.springframework.stereotype.Service; + + +/** + * 用户巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Service +public class UserPatrolRecordServiceImpl extends BaseServiceImpl implements UserPatrolRecordService { + + + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/StaffPatrolDetailDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/StaffPatrolDetailDao.xml new file mode 100644 index 0000000000..a486773599 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/StaffPatrolDetailDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/UserPatrolRecordDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/UserPatrolRecordDao.xml new file mode 100644 index 0000000000..c7daa03b43 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/UserPatrolRecordDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 176cd44ef74d84604c96e6e6c11d01c3cbbfc5f8 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 14 Oct 2021 15:24:59 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=B7=A1=E6=9F=A5=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E7=94=9F=E4=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/StaffPatrolDetailDao.xml | 6 +++--- .../src/main/resources/mapper/UserPatrolRecordDao.xml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/StaffPatrolDetailDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/StaffPatrolDetailDao.xml index a486773599..151eb902c0 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/StaffPatrolDetailDao.xml +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/StaffPatrolDetailDao.xml @@ -1,9 +1,9 @@ - + - + @@ -17,4 +17,4 @@ - \ No newline at end of file + diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/UserPatrolRecordDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/UserPatrolRecordDao.xml index c7daa03b43..750e9f177b 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/UserPatrolRecordDao.xml +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/UserPatrolRecordDao.xml @@ -1,9 +1,9 @@ - + - + @@ -27,4 +27,4 @@ - \ No newline at end of file + From 1f7f58198edc0c16d3c13fbd8a00010283ce15dd Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 14 Oct 2021 16:18:29 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=B7=A1=E6=9F=A5=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF=20=E5=88=B0mq?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rocketmq/constants/TopicConstants.java | 9 +++-- .../rocketmq/messages/StaffPatrolMQMsg.java | 28 +++++++++++++++ .../com/epmet/constant/SystemMessageType.java | 10 ++++++ .../java/com/epmet/send/SendMqMsgUtil.java | 32 ++++++++++++++++- .../impl/SystemMessageServiceImpl.java | 5 ++- .../impl/StaffPatrolRecordServiceImpl.java | 36 +++++++++++++------ 6 files changed, 106 insertions(+), 14 deletions(-) create mode 100644 epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/StaffPatrolMQMsg.java diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java index 927fa19198..d28b19396d 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java @@ -30,12 +30,17 @@ public interface TopicConstants { String POINT = "point"; /** - * 组织信息变更 + * 组织信息 */ String ORG = "org"; /** - * 工作人员信息变更 + * 工作人员 */ String STAFF = "staff"; + + /** + * 巡查 + */ + String PATROL = "patrol"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/StaffPatrolMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/StaffPatrolMQMsg.java new file mode 100644 index 0000000000..f8221d7c76 --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/StaffPatrolMQMsg.java @@ -0,0 +1,28 @@ +package com.epmet.commons.rocketmq.messages; + +import lombok.Data; + +/** + * 用户巡查消息体 + * @author liujianjun + */ +@Data +public class StaffPatrolMQMsg { + /** + * 客户Id + */ + private String customerId; + + /** + * 巡查记录id + */ + private String patrolId; + + /** + * 操作类型 + * SystemMessageType.USER_PATROL_START + * SystemMessageTypSTOP + */ + private String actionType; + +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java index e1c59f003e..9e502bd6ca 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java @@ -65,4 +65,14 @@ public interface SystemMessageType { */ String STAFF_CHANGE = "staff_change"; + /** + * 用户开始巡查 + */ + String USER_PATROL_START = "user_patrol_start"; + + /** + * 用户结束巡查 + */ + String USER_PATROL_STOP = "user_patrol_stop"; + } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java index 4c7241decd..32674d49f6 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java @@ -1,9 +1,10 @@ package com.epmet.send; import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg; import com.epmet.commons.rocketmq.messages.PointRuleChangedMQMsg; import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg; -import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg; +import com.epmet.commons.rocketmq.messages.StaffPatrolMQMsg; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.SystemMessageType; @@ -128,4 +129,33 @@ public class SendMqMsgUtil { } + /** + * @Description 发送巡查相关消息 + * @return + * @author wxz + * @date 2021.06.21 12:46 + */ + public boolean sendPatrolMqMsg(StaffPatrolMQMsg msg) { + try { + SystemMsgFormDTO msgForm = new SystemMsgFormDTO(); + msgForm.setMessageType(msg.getActionType()); + msgForm.setContent(msg); + Result sendMsgResult = null; + log.info("sendPatrolMqMsg param:{}",msgForm); + int retryTime = 0; + do { + sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgForm); + } while ((sendMsgResult == null || !sendMsgResult.success()) && retryTime++ < NumConstant.TWO); + + if (sendMsgResult != null && sendMsgResult.success()) { + return true; + } + log.error("发送(巡查相关)系统消息到message服务失败:{},msg:{}", JSON.toJSONString(sendMsgResult), JSON.toJSONString(msgForm)); + } catch (Exception e) { + log.error("sendMqMsg exception", e); + } + return false; + + } + } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java index f7aacf297c..c85480be6d 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java @@ -2,7 +2,6 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; import com.epmet.auth.constants.AuthOperationConstants; -import com.epmet.auth.constants.AuthOperationEnum; import com.epmet.commons.rocketmq.constants.TopicConstants; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; @@ -91,6 +90,10 @@ public class SystemMessageServiceImpl implements SystemMessageService { case SystemMessageType.STAFF_CHANGE: topic = TopicConstants.STAFF; break; + case SystemMessageType.USER_PATROL_START: + case SystemMessageType.USER_PATROL_STOP: + topic = TopicConstants.PATROL; + break; } return topic; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java index 12255c1153..b46f4a6eae 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java @@ -3,15 +3,16 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.rocketmq.messages.StaffPatrolMQMsg; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; -import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.PatrolConstant; +import com.epmet.constant.SystemMessageType; import com.epmet.dao.CustomerStaffDao; import com.epmet.dao.StaffPatrolDetailDao; import com.epmet.dao.StaffPatrolRecordDao; @@ -23,9 +24,10 @@ import com.epmet.dto.result.*; import com.epmet.entity.StaffPatrolDetailEntity; import com.epmet.entity.StaffPatrolRecordEntity; import com.epmet.entity.StatsStaffPatrolRecordDailyEntity; -import com.epmet.feign.GovOrgFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovProjectOpenFeignClient; +import com.epmet.send.SendMqMsgUtil; import com.epmet.service.StaffPatrolDetailService; import com.epmet.service.StaffPatrolRecordService; import com.epmet.util.DimIdGenerator; @@ -40,7 +42,6 @@ import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.Objects; import java.util.stream.Collectors; /** @@ -55,25 +56,20 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImplsendPatrolMsg(e, SystemMessageType.USER_PATROL_STOP)); + } /**