From 3c8cf5c06315fb6a6672479a561572b22429202c Mon Sep 17 00:00:00 2001 From: zhizhi wu <2377881365@qq.com> Date: Fri, 29 May 2020 16:42:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccsens/health/service/WeiXinService.java | 3 +- .../ccsens/ht/bean/po/HtPatientPersional.java | 46 +- .../ht/bean/po/HtPatientPersionalExample.java | 210 +++- .../mapper_raw/HtPatientPersionalMapper.xml | 85 +- .../com/ccsens/tall/aspect/RobotAspect.java | 16 +- .../tall/bean/dto/ProjectMessageDto.java | 57 ++ .../ccsens/tall/bean/po/SysMessageSend.java | 150 +++ .../tall/bean/po/SysMessageSendExample.java | 921 ++++++++++++++++++ .../com/ccsens/tall/bean/po/SysOperation.java | 106 ++ .../tall/bean/po/SysOperationExample.java | 681 +++++++++++++ .../tall/bean/po/SysOperationMessage.java | 117 +++ .../bean/po/SysOperationMessageExample.java | 761 +++++++++++++++ .../com/ccsens/tall/bean/vo/MessageVo.java | 207 ++++ .../ccsens/tall/bean/vo/ProjectMessageVo.java | 46 + .../ccsens/tall/persist/dao/ProMemberDao.java | 6 + .../tall/persist/dao/SysMessageSendDao.java | 32 + .../tall/persist/dao/SysOperationDao.java | 34 + .../persist/mapper/SysMessageSendMapper.java | 30 + .../persist/mapper/SysOperationMapper.java | 30 + .../mapper/SysOperationMessageMapper.java | 30 + .../com/ccsens/tall/service/AsyncService.java | 7 + .../ccsens/tall/service/IAsyncService.java | 10 + .../tall/service/IProjectMessageService.java | 55 ++ .../ccsens/tall/service/IRobotService.java | 9 +- .../tall/service/ProTaskDetailService.java | 2 + .../tall/service/ProjectMessageService.java | 270 +++++ .../com/ccsens/tall/service/RobotService.java | 126 ++- .../tall/service/TaskDeliverService.java | 10 +- .../tall/service/TaskSubTimeService.java | 6 + .../java/com/ccsens/tall/util/RobotUtil.java | 31 +- .../tall/web/ProjectMessageController.java | 74 ++ .../resources/mapper_dao/ProMemberDao.xml | 8 + .../mapper_dao/SysMessageSendDao.xml | 40 + .../resources/mapper_dao/SysOperationDao.xml | 58 ++ .../main/resources/mapper_dao/SysUserDao.xml | 1 + .../mapper_raw/SysMessageSendMapper.xml | 323 ++++++ .../mapper_raw/SysOperationMapper.xml | 259 +++++ .../mapper_raw/SysOperationMessageMapper.xml | 275 ++++++ .../java/com/ccsens/util/WebConstant.java | 39 + .../util/bean/message/common/InMessage.java | 38 + .../ccsens/util/config/RabbitMQConfig.java | 4 + .../java/com/ccsens/util/wx/WxRobotUtil.java | 6 +- 42 files changed, 5097 insertions(+), 122 deletions(-) create mode 100644 tall/src/main/java/com/ccsens/tall/bean/dto/ProjectMessageDto.java create mode 100644 tall/src/main/java/com/ccsens/tall/bean/po/SysMessageSend.java create mode 100644 tall/src/main/java/com/ccsens/tall/bean/po/SysMessageSendExample.java create mode 100644 tall/src/main/java/com/ccsens/tall/bean/po/SysOperation.java create mode 100644 tall/src/main/java/com/ccsens/tall/bean/po/SysOperationExample.java create mode 100644 tall/src/main/java/com/ccsens/tall/bean/po/SysOperationMessage.java create mode 100644 tall/src/main/java/com/ccsens/tall/bean/po/SysOperationMessageExample.java create mode 100644 tall/src/main/java/com/ccsens/tall/bean/vo/MessageVo.java create mode 100644 tall/src/main/java/com/ccsens/tall/bean/vo/ProjectMessageVo.java create mode 100644 tall/src/main/java/com/ccsens/tall/persist/dao/SysMessageSendDao.java create mode 100644 tall/src/main/java/com/ccsens/tall/persist/dao/SysOperationDao.java create mode 100644 tall/src/main/java/com/ccsens/tall/persist/mapper/SysMessageSendMapper.java create mode 100644 tall/src/main/java/com/ccsens/tall/persist/mapper/SysOperationMapper.java create mode 100644 tall/src/main/java/com/ccsens/tall/persist/mapper/SysOperationMessageMapper.java create mode 100644 tall/src/main/java/com/ccsens/tall/service/IProjectMessageService.java create mode 100644 tall/src/main/java/com/ccsens/tall/service/ProjectMessageService.java create mode 100644 tall/src/main/java/com/ccsens/tall/web/ProjectMessageController.java create mode 100644 tall/src/main/resources/mapper_dao/SysMessageSendDao.xml create mode 100644 tall/src/main/resources/mapper_dao/SysOperationDao.xml create mode 100644 tall/src/main/resources/mapper_raw/SysMessageSendMapper.xml create mode 100644 tall/src/main/resources/mapper_raw/SysOperationMapper.xml create mode 100644 tall/src/main/resources/mapper_raw/SysOperationMessageMapper.xml diff --git a/health/src/main/java/com/ccsens/health/service/WeiXinService.java b/health/src/main/java/com/ccsens/health/service/WeiXinService.java index 73f7b473..8d9be9da 100644 --- a/health/src/main/java/com/ccsens/health/service/WeiXinService.java +++ b/health/src/main/java/com/ccsens/health/service/WeiXinService.java @@ -273,10 +273,11 @@ public class WeiXinService implements IWeiXinService { * @param departments */ private void insertBatchDepartment(List departments) { - TransactionStatus status = TransactionUtil.getTransactionStatus(transactionManager); + int size = departments.size(); int once = 100; for (int i = 0; i < size; i+=once) { + TransactionStatus status = TransactionUtil.getTransactionStatus(transactionManager); int end = i+once > size ? size : i+once; try { departmentDao.insertBatch(departments.subList(i, end)); diff --git a/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersional.java b/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersional.java index 24308198..6587fc53 100644 --- a/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersional.java +++ b/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersional.java @@ -22,7 +22,7 @@ public class HtPatientPersional implements Serializable { private Integer drinkYear; - private Byte drinkType; + private String drinkType; private Integer drinkAmount; @@ -30,7 +30,7 @@ public class HtPatientPersional implements Serializable { private Integer teaCoffeeYear; - private Byte teaCoffeeType; + private String teaCoffeeType; private Byte teaCoffeeFrequency; @@ -38,7 +38,7 @@ public class HtPatientPersional implements Serializable { private Integer teaCoffeeQuitYear; - private Byte dietaryHabit; + private String dietaryHabit; private Byte workoutTime; @@ -56,6 +56,10 @@ public class HtPatientPersional implements Serializable { private Long recorder; + private Byte drinkQuit; + + private Integer drinkQuitYear; + private static final long serialVersionUID = 1L; public Long getId() { @@ -130,12 +134,12 @@ public class HtPatientPersional implements Serializable { this.drinkYear = drinkYear; } - public Byte getDrinkType() { + public String getDrinkType() { return drinkType; } - public void setDrinkType(Byte drinkType) { - this.drinkType = drinkType; + public void setDrinkType(String drinkType) { + this.drinkType = drinkType == null ? null : drinkType.trim(); } public Integer getDrinkAmount() { @@ -162,12 +166,12 @@ public class HtPatientPersional implements Serializable { this.teaCoffeeYear = teaCoffeeYear; } - public Byte getTeaCoffeeType() { + public String getTeaCoffeeType() { return teaCoffeeType; } - public void setTeaCoffeeType(Byte teaCoffeeType) { - this.teaCoffeeType = teaCoffeeType; + public void setTeaCoffeeType(String teaCoffeeType) { + this.teaCoffeeType = teaCoffeeType == null ? null : teaCoffeeType.trim(); } public Byte getTeaCoffeeFrequency() { @@ -194,12 +198,12 @@ public class HtPatientPersional implements Serializable { this.teaCoffeeQuitYear = teaCoffeeQuitYear; } - public Byte getDietaryHabit() { + public String getDietaryHabit() { return dietaryHabit; } - public void setDietaryHabit(Byte dietaryHabit) { - this.dietaryHabit = dietaryHabit; + public void setDietaryHabit(String dietaryHabit) { + this.dietaryHabit = dietaryHabit == null ? null : dietaryHabit.trim(); } public Byte getWorkoutTime() { @@ -266,6 +270,22 @@ public class HtPatientPersional implements Serializable { this.recorder = recorder; } + public Byte getDrinkQuit() { + return drinkQuit; + } + + public void setDrinkQuit(Byte drinkQuit) { + this.drinkQuit = drinkQuit; + } + + public Integer getDrinkQuitYear() { + return drinkQuitYear; + } + + public void setDrinkQuitYear(Integer drinkQuitYear) { + this.drinkQuitYear = drinkQuitYear; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -298,6 +318,8 @@ public class HtPatientPersional implements Serializable { sb.append(", updateTime=").append(updateTime); sb.append(", isDel=").append(isDel); sb.append(", recorder=").append(recorder); + sb.append(", drinkQuit=").append(drinkQuit); + sb.append(", drinkQuitYear=").append(drinkQuitYear); sb.append("]"); return sb.toString(); } diff --git a/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersionalExample.java b/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersionalExample.java index f5f696eb..2947d5a8 100644 --- a/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersionalExample.java +++ b/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersionalExample.java @@ -655,52 +655,62 @@ public class HtPatientPersionalExample { return (Criteria) this; } - public Criteria andDrinkTypeEqualTo(Byte value) { + public Criteria andDrinkTypeEqualTo(String value) { addCriterion("drink_type =", value, "drinkType"); return (Criteria) this; } - public Criteria andDrinkTypeNotEqualTo(Byte value) { + public Criteria andDrinkTypeNotEqualTo(String value) { addCriterion("drink_type <>", value, "drinkType"); return (Criteria) this; } - public Criteria andDrinkTypeGreaterThan(Byte value) { + public Criteria andDrinkTypeGreaterThan(String value) { addCriterion("drink_type >", value, "drinkType"); return (Criteria) this; } - public Criteria andDrinkTypeGreaterThanOrEqualTo(Byte value) { + public Criteria andDrinkTypeGreaterThanOrEqualTo(String value) { addCriterion("drink_type >=", value, "drinkType"); return (Criteria) this; } - public Criteria andDrinkTypeLessThan(Byte value) { + public Criteria andDrinkTypeLessThan(String value) { addCriterion("drink_type <", value, "drinkType"); return (Criteria) this; } - public Criteria andDrinkTypeLessThanOrEqualTo(Byte value) { + public Criteria andDrinkTypeLessThanOrEqualTo(String value) { addCriterion("drink_type <=", value, "drinkType"); return (Criteria) this; } - public Criteria andDrinkTypeIn(List values) { + public Criteria andDrinkTypeLike(String value) { + addCriterion("drink_type like", value, "drinkType"); + return (Criteria) this; + } + + public Criteria andDrinkTypeNotLike(String value) { + addCriterion("drink_type not like", value, "drinkType"); + return (Criteria) this; + } + + public Criteria andDrinkTypeIn(List values) { addCriterion("drink_type in", values, "drinkType"); return (Criteria) this; } - public Criteria andDrinkTypeNotIn(List values) { + public Criteria andDrinkTypeNotIn(List values) { addCriterion("drink_type not in", values, "drinkType"); return (Criteria) this; } - public Criteria andDrinkTypeBetween(Byte value1, Byte value2) { + public Criteria andDrinkTypeBetween(String value1, String value2) { addCriterion("drink_type between", value1, value2, "drinkType"); return (Criteria) this; } - public Criteria andDrinkTypeNotBetween(Byte value1, Byte value2) { + public Criteria andDrinkTypeNotBetween(String value1, String value2) { addCriterion("drink_type not between", value1, value2, "drinkType"); return (Criteria) this; } @@ -895,52 +905,62 @@ public class HtPatientPersionalExample { return (Criteria) this; } - public Criteria andTeaCoffeeTypeEqualTo(Byte value) { + public Criteria andTeaCoffeeTypeEqualTo(String value) { addCriterion("tea_coffee_type =", value, "teaCoffeeType"); return (Criteria) this; } - public Criteria andTeaCoffeeTypeNotEqualTo(Byte value) { + public Criteria andTeaCoffeeTypeNotEqualTo(String value) { addCriterion("tea_coffee_type <>", value, "teaCoffeeType"); return (Criteria) this; } - public Criteria andTeaCoffeeTypeGreaterThan(Byte value) { + public Criteria andTeaCoffeeTypeGreaterThan(String value) { addCriterion("tea_coffee_type >", value, "teaCoffeeType"); return (Criteria) this; } - public Criteria andTeaCoffeeTypeGreaterThanOrEqualTo(Byte value) { + public Criteria andTeaCoffeeTypeGreaterThanOrEqualTo(String value) { addCriterion("tea_coffee_type >=", value, "teaCoffeeType"); return (Criteria) this; } - public Criteria andTeaCoffeeTypeLessThan(Byte value) { + public Criteria andTeaCoffeeTypeLessThan(String value) { addCriterion("tea_coffee_type <", value, "teaCoffeeType"); return (Criteria) this; } - public Criteria andTeaCoffeeTypeLessThanOrEqualTo(Byte value) { + public Criteria andTeaCoffeeTypeLessThanOrEqualTo(String value) { addCriterion("tea_coffee_type <=", value, "teaCoffeeType"); return (Criteria) this; } - public Criteria andTeaCoffeeTypeIn(List values) { + public Criteria andTeaCoffeeTypeLike(String value) { + addCriterion("tea_coffee_type like", value, "teaCoffeeType"); + return (Criteria) this; + } + + public Criteria andTeaCoffeeTypeNotLike(String value) { + addCriterion("tea_coffee_type not like", value, "teaCoffeeType"); + return (Criteria) this; + } + + public Criteria andTeaCoffeeTypeIn(List values) { addCriterion("tea_coffee_type in", values, "teaCoffeeType"); return (Criteria) this; } - public Criteria andTeaCoffeeTypeNotIn(List values) { + public Criteria andTeaCoffeeTypeNotIn(List values) { addCriterion("tea_coffee_type not in", values, "teaCoffeeType"); return (Criteria) this; } - public Criteria andTeaCoffeeTypeBetween(Byte value1, Byte value2) { + public Criteria andTeaCoffeeTypeBetween(String value1, String value2) { addCriterion("tea_coffee_type between", value1, value2, "teaCoffeeType"); return (Criteria) this; } - public Criteria andTeaCoffeeTypeNotBetween(Byte value1, Byte value2) { + public Criteria andTeaCoffeeTypeNotBetween(String value1, String value2) { addCriterion("tea_coffee_type not between", value1, value2, "teaCoffeeType"); return (Criteria) this; } @@ -1135,52 +1155,62 @@ public class HtPatientPersionalExample { return (Criteria) this; } - public Criteria andDietaryHabitEqualTo(Byte value) { + public Criteria andDietaryHabitEqualTo(String value) { addCriterion("dietary_habit =", value, "dietaryHabit"); return (Criteria) this; } - public Criteria andDietaryHabitNotEqualTo(Byte value) { + public Criteria andDietaryHabitNotEqualTo(String value) { addCriterion("dietary_habit <>", value, "dietaryHabit"); return (Criteria) this; } - public Criteria andDietaryHabitGreaterThan(Byte value) { + public Criteria andDietaryHabitGreaterThan(String value) { addCriterion("dietary_habit >", value, "dietaryHabit"); return (Criteria) this; } - public Criteria andDietaryHabitGreaterThanOrEqualTo(Byte value) { + public Criteria andDietaryHabitGreaterThanOrEqualTo(String value) { addCriterion("dietary_habit >=", value, "dietaryHabit"); return (Criteria) this; } - public Criteria andDietaryHabitLessThan(Byte value) { + public Criteria andDietaryHabitLessThan(String value) { addCriterion("dietary_habit <", value, "dietaryHabit"); return (Criteria) this; } - public Criteria andDietaryHabitLessThanOrEqualTo(Byte value) { + public Criteria andDietaryHabitLessThanOrEqualTo(String value) { addCriterion("dietary_habit <=", value, "dietaryHabit"); return (Criteria) this; } - public Criteria andDietaryHabitIn(List values) { + public Criteria andDietaryHabitLike(String value) { + addCriterion("dietary_habit like", value, "dietaryHabit"); + return (Criteria) this; + } + + public Criteria andDietaryHabitNotLike(String value) { + addCriterion("dietary_habit not like", value, "dietaryHabit"); + return (Criteria) this; + } + + public Criteria andDietaryHabitIn(List values) { addCriterion("dietary_habit in", values, "dietaryHabit"); return (Criteria) this; } - public Criteria andDietaryHabitNotIn(List values) { + public Criteria andDietaryHabitNotIn(List values) { addCriterion("dietary_habit not in", values, "dietaryHabit"); return (Criteria) this; } - public Criteria andDietaryHabitBetween(Byte value1, Byte value2) { + public Criteria andDietaryHabitBetween(String value1, String value2) { addCriterion("dietary_habit between", value1, value2, "dietaryHabit"); return (Criteria) this; } - public Criteria andDietaryHabitNotBetween(Byte value1, Byte value2) { + public Criteria andDietaryHabitNotBetween(String value1, String value2) { addCriterion("dietary_habit not between", value1, value2, "dietaryHabit"); return (Criteria) this; } @@ -1674,6 +1704,126 @@ public class HtPatientPersionalExample { addCriterion("recorder not between", value1, value2, "recorder"); return (Criteria) this; } + + public Criteria andDrinkQuitIsNull() { + addCriterion("drink_quit is null"); + return (Criteria) this; + } + + public Criteria andDrinkQuitIsNotNull() { + addCriterion("drink_quit is not null"); + return (Criteria) this; + } + + public Criteria andDrinkQuitEqualTo(Byte value) { + addCriterion("drink_quit =", value, "drinkQuit"); + return (Criteria) this; + } + + public Criteria andDrinkQuitNotEqualTo(Byte value) { + addCriterion("drink_quit <>", value, "drinkQuit"); + return (Criteria) this; + } + + public Criteria andDrinkQuitGreaterThan(Byte value) { + addCriterion("drink_quit >", value, "drinkQuit"); + return (Criteria) this; + } + + public Criteria andDrinkQuitGreaterThanOrEqualTo(Byte value) { + addCriterion("drink_quit >=", value, "drinkQuit"); + return (Criteria) this; + } + + public Criteria andDrinkQuitLessThan(Byte value) { + addCriterion("drink_quit <", value, "drinkQuit"); + return (Criteria) this; + } + + public Criteria andDrinkQuitLessThanOrEqualTo(Byte value) { + addCriterion("drink_quit <=", value, "drinkQuit"); + return (Criteria) this; + } + + public Criteria andDrinkQuitIn(List values) { + addCriterion("drink_quit in", values, "drinkQuit"); + return (Criteria) this; + } + + public Criteria andDrinkQuitNotIn(List values) { + addCriterion("drink_quit not in", values, "drinkQuit"); + return (Criteria) this; + } + + public Criteria andDrinkQuitBetween(Byte value1, Byte value2) { + addCriterion("drink_quit between", value1, value2, "drinkQuit"); + return (Criteria) this; + } + + public Criteria andDrinkQuitNotBetween(Byte value1, Byte value2) { + addCriterion("drink_quit not between", value1, value2, "drinkQuit"); + return (Criteria) this; + } + + public Criteria andDrinkQuitYearIsNull() { + addCriterion("drink_quit_year is null"); + return (Criteria) this; + } + + public Criteria andDrinkQuitYearIsNotNull() { + addCriterion("drink_quit_year is not null"); + return (Criteria) this; + } + + public Criteria andDrinkQuitYearEqualTo(Integer value) { + addCriterion("drink_quit_year =", value, "drinkQuitYear"); + return (Criteria) this; + } + + public Criteria andDrinkQuitYearNotEqualTo(Integer value) { + addCriterion("drink_quit_year <>", value, "drinkQuitYear"); + return (Criteria) this; + } + + public Criteria andDrinkQuitYearGreaterThan(Integer value) { + addCriterion("drink_quit_year >", value, "drinkQuitYear"); + return (Criteria) this; + } + + public Criteria andDrinkQuitYearGreaterThanOrEqualTo(Integer value) { + addCriterion("drink_quit_year >=", value, "drinkQuitYear"); + return (Criteria) this; + } + + public Criteria andDrinkQuitYearLessThan(Integer value) { + addCriterion("drink_quit_year <", value, "drinkQuitYear"); + return (Criteria) this; + } + + public Criteria andDrinkQuitYearLessThanOrEqualTo(Integer value) { + addCriterion("drink_quit_year <=", value, "drinkQuitYear"); + return (Criteria) this; + } + + public Criteria andDrinkQuitYearIn(List values) { + addCriterion("drink_quit_year in", values, "drinkQuitYear"); + return (Criteria) this; + } + + public Criteria andDrinkQuitYearNotIn(List values) { + addCriterion("drink_quit_year not in", values, "drinkQuitYear"); + return (Criteria) this; + } + + public Criteria andDrinkQuitYearBetween(Integer value1, Integer value2) { + addCriterion("drink_quit_year between", value1, value2, "drinkQuitYear"); + return (Criteria) this; + } + + public Criteria andDrinkQuitYearNotBetween(Integer value1, Integer value2) { + addCriterion("drink_quit_year not between", value1, value2, "drinkQuitYear"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/ht/src/main/resources/mapper_raw/HtPatientPersionalMapper.xml b/ht/src/main/resources/mapper_raw/HtPatientPersionalMapper.xml index 5463ac95..7667aff0 100644 --- a/ht/src/main/resources/mapper_raw/HtPatientPersionalMapper.xml +++ b/ht/src/main/resources/mapper_raw/HtPatientPersionalMapper.xml @@ -11,15 +11,15 @@ - + - + - + @@ -28,6 +28,8 @@ + + @@ -91,7 +93,8 @@ id, patient_id, smoking_history, smoking_year, smoking_amount, smoking_quit, smoking_quit_year, drink_history, drink_year, drink_type, drink_amount, tea_coffee_history, tea_coffee_year, tea_coffee_type, tea_coffee_frequency, tea_coffee_quit, tea_coffee_quit_year, dietary_habit, - workout_time, sleep_time, snore, remark, create_time, update_time, is_del, recorder + workout_time, sleep_time, snore, remark, create_time, update_time, is_del, recorder, + drink_quit, drink_quit_year @@ -343,7 +360,7 @@ drink_year = #{record.drinkYear,jdbcType=INTEGER}, - drink_type = #{record.drinkType,jdbcType=TINYINT}, + drink_type = #{record.drinkType,jdbcType=VARCHAR}, drink_amount = #{record.drinkAmount,jdbcType=INTEGER}, @@ -355,7 +372,7 @@ tea_coffee_year = #{record.teaCoffeeYear,jdbcType=INTEGER}, - tea_coffee_type = #{record.teaCoffeeType,jdbcType=TINYINT}, + tea_coffee_type = #{record.teaCoffeeType,jdbcType=VARCHAR}, tea_coffee_frequency = #{record.teaCoffeeFrequency,jdbcType=TINYINT}, @@ -367,7 +384,7 @@ tea_coffee_quit_year = #{record.teaCoffeeQuitYear,jdbcType=INTEGER}, - dietary_habit = #{record.dietaryHabit,jdbcType=TINYINT}, + dietary_habit = #{record.dietaryHabit,jdbcType=VARCHAR}, workout_time = #{record.workoutTime,jdbcType=TINYINT}, @@ -393,6 +410,12 @@ recorder = #{record.recorder,jdbcType=BIGINT}, + + drink_quit = #{record.drinkQuit,jdbcType=TINYINT}, + + + drink_quit_year = #{record.drinkQuitYear,jdbcType=INTEGER}, + @@ -409,15 +432,15 @@ smoking_quit_year = #{record.smokingQuitYear,jdbcType=INTEGER}, drink_history = #{record.drinkHistory,jdbcType=TINYINT}, drink_year = #{record.drinkYear,jdbcType=INTEGER}, - drink_type = #{record.drinkType,jdbcType=TINYINT}, + drink_type = #{record.drinkType,jdbcType=VARCHAR}, drink_amount = #{record.drinkAmount,jdbcType=INTEGER}, tea_coffee_history = #{record.teaCoffeeHistory,jdbcType=TINYINT}, tea_coffee_year = #{record.teaCoffeeYear,jdbcType=INTEGER}, - tea_coffee_type = #{record.teaCoffeeType,jdbcType=TINYINT}, + tea_coffee_type = #{record.teaCoffeeType,jdbcType=VARCHAR}, tea_coffee_frequency = #{record.teaCoffeeFrequency,jdbcType=TINYINT}, tea_coffee_quit = #{record.teaCoffeeQuit,jdbcType=TINYINT}, tea_coffee_quit_year = #{record.teaCoffeeQuitYear,jdbcType=INTEGER}, - dietary_habit = #{record.dietaryHabit,jdbcType=TINYINT}, + dietary_habit = #{record.dietaryHabit,jdbcType=VARCHAR}, workout_time = #{record.workoutTime,jdbcType=TINYINT}, sleep_time = #{record.sleepTime,jdbcType=INTEGER}, snore = #{record.snore,jdbcType=TINYINT}, @@ -425,7 +448,9 @@ create_time = #{record.createTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP}, is_del = #{record.isDel,jdbcType=TINYINT}, - recorder = #{record.recorder,jdbcType=BIGINT} + recorder = #{record.recorder,jdbcType=BIGINT}, + drink_quit = #{record.drinkQuit,jdbcType=TINYINT}, + drink_quit_year = #{record.drinkQuitYear,jdbcType=INTEGER} @@ -458,7 +483,7 @@ drink_year = #{drinkYear,jdbcType=INTEGER}, - drink_type = #{drinkType,jdbcType=TINYINT}, + drink_type = #{drinkType,jdbcType=VARCHAR}, drink_amount = #{drinkAmount,jdbcType=INTEGER}, @@ -470,7 +495,7 @@ tea_coffee_year = #{teaCoffeeYear,jdbcType=INTEGER}, - tea_coffee_type = #{teaCoffeeType,jdbcType=TINYINT}, + tea_coffee_type = #{teaCoffeeType,jdbcType=VARCHAR}, tea_coffee_frequency = #{teaCoffeeFrequency,jdbcType=TINYINT}, @@ -482,7 +507,7 @@ tea_coffee_quit_year = #{teaCoffeeQuitYear,jdbcType=INTEGER}, - dietary_habit = #{dietaryHabit,jdbcType=TINYINT}, + dietary_habit = #{dietaryHabit,jdbcType=VARCHAR}, workout_time = #{workoutTime,jdbcType=TINYINT}, @@ -508,6 +533,12 @@ recorder = #{recorder,jdbcType=BIGINT}, + + drink_quit = #{drinkQuit,jdbcType=TINYINT}, + + + drink_quit_year = #{drinkQuitYear,jdbcType=INTEGER}, + where id = #{id,jdbcType=BIGINT} @@ -521,15 +552,15 @@ smoking_quit_year = #{smokingQuitYear,jdbcType=INTEGER}, drink_history = #{drinkHistory,jdbcType=TINYINT}, drink_year = #{drinkYear,jdbcType=INTEGER}, - drink_type = #{drinkType,jdbcType=TINYINT}, + drink_type = #{drinkType,jdbcType=VARCHAR}, drink_amount = #{drinkAmount,jdbcType=INTEGER}, tea_coffee_history = #{teaCoffeeHistory,jdbcType=TINYINT}, tea_coffee_year = #{teaCoffeeYear,jdbcType=INTEGER}, - tea_coffee_type = #{teaCoffeeType,jdbcType=TINYINT}, + tea_coffee_type = #{teaCoffeeType,jdbcType=VARCHAR}, tea_coffee_frequency = #{teaCoffeeFrequency,jdbcType=TINYINT}, tea_coffee_quit = #{teaCoffeeQuit,jdbcType=TINYINT}, tea_coffee_quit_year = #{teaCoffeeQuitYear,jdbcType=INTEGER}, - dietary_habit = #{dietaryHabit,jdbcType=TINYINT}, + dietary_habit = #{dietaryHabit,jdbcType=VARCHAR}, workout_time = #{workoutTime,jdbcType=TINYINT}, sleep_time = #{sleepTime,jdbcType=INTEGER}, snore = #{snore,jdbcType=TINYINT}, @@ -537,7 +568,9 @@ create_time = #{createTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP}, is_del = #{isDel,jdbcType=TINYINT}, - recorder = #{recorder,jdbcType=BIGINT} + recorder = #{recorder,jdbcType=BIGINT}, + drink_quit = #{drinkQuit,jdbcType=TINYINT}, + drink_quit_year = #{drinkQuitYear,jdbcType=INTEGER} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/tall/src/main/java/com/ccsens/tall/aspect/RobotAspect.java b/tall/src/main/java/com/ccsens/tall/aspect/RobotAspect.java index 73dea104..4a33e63f 100644 --- a/tall/src/main/java/com/ccsens/tall/aspect/RobotAspect.java +++ b/tall/src/main/java/com/ccsens/tall/aspect/RobotAspect.java @@ -1,19 +1,16 @@ package com.ccsens.tall.aspect; -import com.ccsens.cloudutil.annotation.MustLogin; +import com.ccsens.tall.bean.vo.MessageVo; import com.ccsens.tall.service.IAsyncService; import com.ccsens.tall.service.IRobotService; -import com.ccsens.tall.service.RobotService; import com.ccsens.tall.util.RobotUtil; import com.ccsens.util.annotation.OperateType; import lombok.extern.slf4j.Slf4j; import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.Signature; import org.aspectj.lang.annotation.*; import org.aspectj.lang.reflect.MethodSignature; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Lazy; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; @@ -30,6 +27,7 @@ public class RobotAspect { @Resource private IAsyncService asyncService; + @Pointcut("@annotation(com.ccsens.util.annotation.OperateType)") public void robotAdvice(){ @@ -43,9 +41,15 @@ public class RobotAspect { Method targetMethod = methodSignature.getMethod(); OperateType operateType = targetMethod.getAnnotation(OperateType.class); //2.获取发送参数 - RobotUtil.Message message = RobotUtil.get(); + RobotUtil.Message message = RobotUtil.getRobotMessage(); + MessageVo.Inform inform = RobotUtil.getInform(); + // 3.机器人通知 asyncService.sendRobotMessage(operateType,message); - + // 4.ws和公众号通知 + asyncService.sendMessage(operateType, inform); + //删除线程 + RobotUtil.delRobotMessage(); + RobotUtil.delInform(); } } diff --git a/tall/src/main/java/com/ccsens/tall/bean/dto/ProjectMessageDto.java b/tall/src/main/java/com/ccsens/tall/bean/dto/ProjectMessageDto.java new file mode 100644 index 00000000..0ce25af9 --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/bean/dto/ProjectMessageDto.java @@ -0,0 +1,57 @@ +package com.ccsens.tall.bean.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; + +/** + * @description: + * @author: whj + * @time: 2020/5/28 17:34 + */ +@ApiModel("消息通知相关请求参数") +public class ProjectMessageDto { + + @Data + @ApiModel("查询未读消息数") + public static class UnreadNum{ + @NotNull + @ApiModelProperty("发送类型 0:ws,1:微信公众号") + private Byte sendType; + } + + @Data + @ApiModel("查询未读消息") + public static class Query{ + @NotNull + @ApiModelProperty("发送类型 0:ws,1:微信公众号") + private Byte sendType; + @ApiModelProperty("第几页") + @Min(value = 1) + private int pageNum = 1; + @ApiModelProperty("每页多少条") + @Min(value = 1) + @Max(value=100) + private int pageSize = 10; + } + + @Data + @ApiModel("查询未读消息") + public static class MarkRead{ + @NotNull(message="发送消息ID不能为空") + @ApiModelProperty("发送消息ID") + private Long id; + } + + @Data + @ApiModel("查询未读消息") + public static class MarkAllRead{ + @NotNull + @ApiModelProperty("消息发送类型 0:ws,1:微信公众号") + private Byte sendType; + } +} diff --git a/tall/src/main/java/com/ccsens/tall/bean/po/SysMessageSend.java b/tall/src/main/java/com/ccsens/tall/bean/po/SysMessageSend.java new file mode 100644 index 00000000..47919afd --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/bean/po/SysMessageSend.java @@ -0,0 +1,150 @@ +package com.ccsens.tall.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class SysMessageSend implements Serializable { + private Long id; + + private Long operationId; + + private Long receiverId; + + private Byte sendType; + + private Byte sendStatus; + + private Byte readStatus; + + private Byte initRead; + + private Long sendTime; + + private Byte complete; + + private Date createdAt; + + private Date updatedAt; + + private Byte recStatus; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getOperationId() { + return operationId; + } + + public void setOperationId(Long operationId) { + this.operationId = operationId; + } + + public Long getReceiverId() { + return receiverId; + } + + public void setReceiverId(Long receiverId) { + this.receiverId = receiverId; + } + + public Byte getSendType() { + return sendType; + } + + public void setSendType(Byte sendType) { + this.sendType = sendType; + } + + public Byte getSendStatus() { + return sendStatus; + } + + public void setSendStatus(Byte sendStatus) { + this.sendStatus = sendStatus; + } + + public Byte getReadStatus() { + return readStatus; + } + + public void setReadStatus(Byte readStatus) { + this.readStatus = readStatus; + } + + public Byte getInitRead() { + return initRead; + } + + public void setInitRead(Byte initRead) { + this.initRead = initRead; + } + + public Long getSendTime() { + return sendTime; + } + + public void setSendTime(Long sendTime) { + this.sendTime = sendTime; + } + + public Byte getComplete() { + return complete; + } + + public void setComplete(Byte complete) { + this.complete = complete; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + + public Byte getRecStatus() { + return recStatus; + } + + public void setRecStatus(Byte recStatus) { + this.recStatus = recStatus; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", operationId=").append(operationId); + sb.append(", receiverId=").append(receiverId); + sb.append(", sendType=").append(sendType); + sb.append(", sendStatus=").append(sendStatus); + sb.append(", readStatus=").append(readStatus); + sb.append(", initRead=").append(initRead); + sb.append(", sendTime=").append(sendTime); + sb.append(", complete=").append(complete); + sb.append(", createdAt=").append(createdAt); + sb.append(", updatedAt=").append(updatedAt); + sb.append(", recStatus=").append(recStatus); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/tall/src/main/java/com/ccsens/tall/bean/po/SysMessageSendExample.java b/tall/src/main/java/com/ccsens/tall/bean/po/SysMessageSendExample.java new file mode 100644 index 00000000..0d57d3cc --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/bean/po/SysMessageSendExample.java @@ -0,0 +1,921 @@ +package com.ccsens.tall.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SysMessageSendExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SysMessageSendExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andOperationIdIsNull() { + addCriterion("operation_id is null"); + return (Criteria) this; + } + + public Criteria andOperationIdIsNotNull() { + addCriterion("operation_id is not null"); + return (Criteria) this; + } + + public Criteria andOperationIdEqualTo(Long value) { + addCriterion("operation_id =", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdNotEqualTo(Long value) { + addCriterion("operation_id <>", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdGreaterThan(Long value) { + addCriterion("operation_id >", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdGreaterThanOrEqualTo(Long value) { + addCriterion("operation_id >=", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdLessThan(Long value) { + addCriterion("operation_id <", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdLessThanOrEqualTo(Long value) { + addCriterion("operation_id <=", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdIn(List values) { + addCriterion("operation_id in", values, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdNotIn(List values) { + addCriterion("operation_id not in", values, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdBetween(Long value1, Long value2) { + addCriterion("operation_id between", value1, value2, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdNotBetween(Long value1, Long value2) { + addCriterion("operation_id not between", value1, value2, "operationId"); + return (Criteria) this; + } + + public Criteria andReceiverIdIsNull() { + addCriterion("receiver_id is null"); + return (Criteria) this; + } + + public Criteria andReceiverIdIsNotNull() { + addCriterion("receiver_id is not null"); + return (Criteria) this; + } + + public Criteria andReceiverIdEqualTo(Long value) { + addCriterion("receiver_id =", value, "receiverId"); + return (Criteria) this; + } + + public Criteria andReceiverIdNotEqualTo(Long value) { + addCriterion("receiver_id <>", value, "receiverId"); + return (Criteria) this; + } + + public Criteria andReceiverIdGreaterThan(Long value) { + addCriterion("receiver_id >", value, "receiverId"); + return (Criteria) this; + } + + public Criteria andReceiverIdGreaterThanOrEqualTo(Long value) { + addCriterion("receiver_id >=", value, "receiverId"); + return (Criteria) this; + } + + public Criteria andReceiverIdLessThan(Long value) { + addCriterion("receiver_id <", value, "receiverId"); + return (Criteria) this; + } + + public Criteria andReceiverIdLessThanOrEqualTo(Long value) { + addCriterion("receiver_id <=", value, "receiverId"); + return (Criteria) this; + } + + public Criteria andReceiverIdIn(List values) { + addCriterion("receiver_id in", values, "receiverId"); + return (Criteria) this; + } + + public Criteria andReceiverIdNotIn(List values) { + addCriterion("receiver_id not in", values, "receiverId"); + return (Criteria) this; + } + + public Criteria andReceiverIdBetween(Long value1, Long value2) { + addCriterion("receiver_id between", value1, value2, "receiverId"); + return (Criteria) this; + } + + public Criteria andReceiverIdNotBetween(Long value1, Long value2) { + addCriterion("receiver_id not between", value1, value2, "receiverId"); + return (Criteria) this; + } + + public Criteria andSendTypeIsNull() { + addCriterion("send_type is null"); + return (Criteria) this; + } + + public Criteria andSendTypeIsNotNull() { + addCriterion("send_type is not null"); + return (Criteria) this; + } + + public Criteria andSendTypeEqualTo(Byte value) { + addCriterion("send_type =", value, "sendType"); + return (Criteria) this; + } + + public Criteria andSendTypeNotEqualTo(Byte value) { + addCriterion("send_type <>", value, "sendType"); + return (Criteria) this; + } + + public Criteria andSendTypeGreaterThan(Byte value) { + addCriterion("send_type >", value, "sendType"); + return (Criteria) this; + } + + public Criteria andSendTypeGreaterThanOrEqualTo(Byte value) { + addCriterion("send_type >=", value, "sendType"); + return (Criteria) this; + } + + public Criteria andSendTypeLessThan(Byte value) { + addCriterion("send_type <", value, "sendType"); + return (Criteria) this; + } + + public Criteria andSendTypeLessThanOrEqualTo(Byte value) { + addCriterion("send_type <=", value, "sendType"); + return (Criteria) this; + } + + public Criteria andSendTypeIn(List values) { + addCriterion("send_type in", values, "sendType"); + return (Criteria) this; + } + + public Criteria andSendTypeNotIn(List values) { + addCriterion("send_type not in", values, "sendType"); + return (Criteria) this; + } + + public Criteria andSendTypeBetween(Byte value1, Byte value2) { + addCriterion("send_type between", value1, value2, "sendType"); + return (Criteria) this; + } + + public Criteria andSendTypeNotBetween(Byte value1, Byte value2) { + addCriterion("send_type not between", value1, value2, "sendType"); + return (Criteria) this; + } + + public Criteria andSendStatusIsNull() { + addCriterion("send_status is null"); + return (Criteria) this; + } + + public Criteria andSendStatusIsNotNull() { + addCriterion("send_status is not null"); + return (Criteria) this; + } + + public Criteria andSendStatusEqualTo(Byte value) { + addCriterion("send_status =", value, "sendStatus"); + return (Criteria) this; + } + + public Criteria andSendStatusNotEqualTo(Byte value) { + addCriterion("send_status <>", value, "sendStatus"); + return (Criteria) this; + } + + public Criteria andSendStatusGreaterThan(Byte value) { + addCriterion("send_status >", value, "sendStatus"); + return (Criteria) this; + } + + public Criteria andSendStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("send_status >=", value, "sendStatus"); + return (Criteria) this; + } + + public Criteria andSendStatusLessThan(Byte value) { + addCriterion("send_status <", value, "sendStatus"); + return (Criteria) this; + } + + public Criteria andSendStatusLessThanOrEqualTo(Byte value) { + addCriterion("send_status <=", value, "sendStatus"); + return (Criteria) this; + } + + public Criteria andSendStatusIn(List values) { + addCriterion("send_status in", values, "sendStatus"); + return (Criteria) this; + } + + public Criteria andSendStatusNotIn(List values) { + addCriterion("send_status not in", values, "sendStatus"); + return (Criteria) this; + } + + public Criteria andSendStatusBetween(Byte value1, Byte value2) { + addCriterion("send_status between", value1, value2, "sendStatus"); + return (Criteria) this; + } + + public Criteria andSendStatusNotBetween(Byte value1, Byte value2) { + addCriterion("send_status not between", value1, value2, "sendStatus"); + return (Criteria) this; + } + + public Criteria andReadStatusIsNull() { + addCriterion("read_status is null"); + return (Criteria) this; + } + + public Criteria andReadStatusIsNotNull() { + addCriterion("read_status is not null"); + return (Criteria) this; + } + + public Criteria andReadStatusEqualTo(Byte value) { + addCriterion("read_status =", value, "readStatus"); + return (Criteria) this; + } + + public Criteria andReadStatusNotEqualTo(Byte value) { + addCriterion("read_status <>", value, "readStatus"); + return (Criteria) this; + } + + public Criteria andReadStatusGreaterThan(Byte value) { + addCriterion("read_status >", value, "readStatus"); + return (Criteria) this; + } + + public Criteria andReadStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("read_status >=", value, "readStatus"); + return (Criteria) this; + } + + public Criteria andReadStatusLessThan(Byte value) { + addCriterion("read_status <", value, "readStatus"); + return (Criteria) this; + } + + public Criteria andReadStatusLessThanOrEqualTo(Byte value) { + addCriterion("read_status <=", value, "readStatus"); + return (Criteria) this; + } + + public Criteria andReadStatusIn(List values) { + addCriterion("read_status in", values, "readStatus"); + return (Criteria) this; + } + + public Criteria andReadStatusNotIn(List values) { + addCriterion("read_status not in", values, "readStatus"); + return (Criteria) this; + } + + public Criteria andReadStatusBetween(Byte value1, Byte value2) { + addCriterion("read_status between", value1, value2, "readStatus"); + return (Criteria) this; + } + + public Criteria andReadStatusNotBetween(Byte value1, Byte value2) { + addCriterion("read_status not between", value1, value2, "readStatus"); + return (Criteria) this; + } + + public Criteria andInitReadIsNull() { + addCriterion("init_read is null"); + return (Criteria) this; + } + + public Criteria andInitReadIsNotNull() { + addCriterion("init_read is not null"); + return (Criteria) this; + } + + public Criteria andInitReadEqualTo(Byte value) { + addCriterion("init_read =", value, "initRead"); + return (Criteria) this; + } + + public Criteria andInitReadNotEqualTo(Byte value) { + addCriterion("init_read <>", value, "initRead"); + return (Criteria) this; + } + + public Criteria andInitReadGreaterThan(Byte value) { + addCriterion("init_read >", value, "initRead"); + return (Criteria) this; + } + + public Criteria andInitReadGreaterThanOrEqualTo(Byte value) { + addCriterion("init_read >=", value, "initRead"); + return (Criteria) this; + } + + public Criteria andInitReadLessThan(Byte value) { + addCriterion("init_read <", value, "initRead"); + return (Criteria) this; + } + + public Criteria andInitReadLessThanOrEqualTo(Byte value) { + addCriterion("init_read <=", value, "initRead"); + return (Criteria) this; + } + + public Criteria andInitReadIn(List values) { + addCriterion("init_read in", values, "initRead"); + return (Criteria) this; + } + + public Criteria andInitReadNotIn(List values) { + addCriterion("init_read not in", values, "initRead"); + return (Criteria) this; + } + + public Criteria andInitReadBetween(Byte value1, Byte value2) { + addCriterion("init_read between", value1, value2, "initRead"); + return (Criteria) this; + } + + public Criteria andInitReadNotBetween(Byte value1, Byte value2) { + addCriterion("init_read not between", value1, value2, "initRead"); + return (Criteria) this; + } + + public Criteria andSendTimeIsNull() { + addCriterion("send_time is null"); + return (Criteria) this; + } + + public Criteria andSendTimeIsNotNull() { + addCriterion("send_time is not null"); + return (Criteria) this; + } + + public Criteria andSendTimeEqualTo(Long value) { + addCriterion("send_time =", value, "sendTime"); + return (Criteria) this; + } + + public Criteria andSendTimeNotEqualTo(Long value) { + addCriterion("send_time <>", value, "sendTime"); + return (Criteria) this; + } + + public Criteria andSendTimeGreaterThan(Long value) { + addCriterion("send_time >", value, "sendTime"); + return (Criteria) this; + } + + public Criteria andSendTimeGreaterThanOrEqualTo(Long value) { + addCriterion("send_time >=", value, "sendTime"); + return (Criteria) this; + } + + public Criteria andSendTimeLessThan(Long value) { + addCriterion("send_time <", value, "sendTime"); + return (Criteria) this; + } + + public Criteria andSendTimeLessThanOrEqualTo(Long value) { + addCriterion("send_time <=", value, "sendTime"); + return (Criteria) this; + } + + public Criteria andSendTimeIn(List values) { + addCriterion("send_time in", values, "sendTime"); + return (Criteria) this; + } + + public Criteria andSendTimeNotIn(List values) { + addCriterion("send_time not in", values, "sendTime"); + return (Criteria) this; + } + + public Criteria andSendTimeBetween(Long value1, Long value2) { + addCriterion("send_time between", value1, value2, "sendTime"); + return (Criteria) this; + } + + public Criteria andSendTimeNotBetween(Long value1, Long value2) { + addCriterion("send_time not between", value1, value2, "sendTime"); + return (Criteria) this; + } + + public Criteria andCompleteIsNull() { + addCriterion("complete is null"); + return (Criteria) this; + } + + public Criteria andCompleteIsNotNull() { + addCriterion("complete is not null"); + return (Criteria) this; + } + + public Criteria andCompleteEqualTo(Byte value) { + addCriterion("complete =", value, "complete"); + return (Criteria) this; + } + + public Criteria andCompleteNotEqualTo(Byte value) { + addCriterion("complete <>", value, "complete"); + return (Criteria) this; + } + + public Criteria andCompleteGreaterThan(Byte value) { + addCriterion("complete >", value, "complete"); + return (Criteria) this; + } + + public Criteria andCompleteGreaterThanOrEqualTo(Byte value) { + addCriterion("complete >=", value, "complete"); + return (Criteria) this; + } + + public Criteria andCompleteLessThan(Byte value) { + addCriterion("complete <", value, "complete"); + return (Criteria) this; + } + + public Criteria andCompleteLessThanOrEqualTo(Byte value) { + addCriterion("complete <=", value, "complete"); + return (Criteria) this; + } + + public Criteria andCompleteIn(List values) { + addCriterion("complete in", values, "complete"); + return (Criteria) this; + } + + public Criteria andCompleteNotIn(List values) { + addCriterion("complete not in", values, "complete"); + return (Criteria) this; + } + + public Criteria andCompleteBetween(Byte value1, Byte value2) { + addCriterion("complete between", value1, value2, "complete"); + return (Criteria) this; + } + + public Criteria andCompleteNotBetween(Byte value1, Byte value2) { + addCriterion("complete not between", value1, value2, "complete"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Date value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Date value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Date value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Date value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Date value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Date value1, Date value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Date value1, Date value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNull() { + addCriterion("updated_at is null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNotNull() { + addCriterion("updated_at is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtEqualTo(Date value) { + addCriterion("updated_at =", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotEqualTo(Date value) { + addCriterion("updated_at <>", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThan(Date value) { + addCriterion("updated_at >", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("updated_at >=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThan(Date value) { + addCriterion("updated_at <", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { + addCriterion("updated_at <=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIn(List values) { + addCriterion("updated_at in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotIn(List values) { + addCriterion("updated_at not in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtBetween(Date value1, Date value2) { + addCriterion("updated_at between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { + addCriterion("updated_at not between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNull() { + addCriterion("rec_status is null"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNotNull() { + addCriterion("rec_status is not null"); + return (Criteria) this; + } + + public Criteria andRecStatusEqualTo(Byte value) { + addCriterion("rec_status =", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotEqualTo(Byte value) { + addCriterion("rec_status <>", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThan(Byte value) { + addCriterion("rec_status >", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("rec_status >=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThan(Byte value) { + addCriterion("rec_status <", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThanOrEqualTo(Byte value) { + addCriterion("rec_status <=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusIn(List values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List values) { + addCriterion("rec_status not in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusBetween(Byte value1, Byte value2) { + addCriterion("rec_status between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { + addCriterion("rec_status not between", value1, value2, "recStatus"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/tall/src/main/java/com/ccsens/tall/bean/po/SysOperation.java b/tall/src/main/java/com/ccsens/tall/bean/po/SysOperation.java new file mode 100644 index 00000000..5a9bca1c --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/bean/po/SysOperation.java @@ -0,0 +1,106 @@ +package com.ccsens.tall.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class SysOperation implements Serializable { + private Long id; + + private Long operatorId; + + private Long projectId; + + private Byte operateType; + + private Long operationTime; + + private Date createdAt; + + private Date updatedAt; + + private Byte recStatus; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getOperatorId() { + return operatorId; + } + + public void setOperatorId(Long operatorId) { + this.operatorId = operatorId; + } + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + public Byte getOperateType() { + return operateType; + } + + public void setOperateType(Byte operateType) { + this.operateType = operateType; + } + + public Long getOperationTime() { + return operationTime; + } + + public void setOperationTime(Long operationTime) { + this.operationTime = operationTime; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + + public Byte getRecStatus() { + return recStatus; + } + + public void setRecStatus(Byte recStatus) { + this.recStatus = recStatus; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", operatorId=").append(operatorId); + sb.append(", projectId=").append(projectId); + sb.append(", operateType=").append(operateType); + sb.append(", operationTime=").append(operationTime); + sb.append(", createdAt=").append(createdAt); + sb.append(", updatedAt=").append(updatedAt); + sb.append(", recStatus=").append(recStatus); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/tall/src/main/java/com/ccsens/tall/bean/po/SysOperationExample.java b/tall/src/main/java/com/ccsens/tall/bean/po/SysOperationExample.java new file mode 100644 index 00000000..d37f5397 --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/bean/po/SysOperationExample.java @@ -0,0 +1,681 @@ +package com.ccsens.tall.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SysOperationExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SysOperationExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andOperatorIdIsNull() { + addCriterion("operator_id is null"); + return (Criteria) this; + } + + public Criteria andOperatorIdIsNotNull() { + addCriterion("operator_id is not null"); + return (Criteria) this; + } + + public Criteria andOperatorIdEqualTo(Long value) { + addCriterion("operator_id =", value, "operatorId"); + return (Criteria) this; + } + + public Criteria andOperatorIdNotEqualTo(Long value) { + addCriterion("operator_id <>", value, "operatorId"); + return (Criteria) this; + } + + public Criteria andOperatorIdGreaterThan(Long value) { + addCriterion("operator_id >", value, "operatorId"); + return (Criteria) this; + } + + public Criteria andOperatorIdGreaterThanOrEqualTo(Long value) { + addCriterion("operator_id >=", value, "operatorId"); + return (Criteria) this; + } + + public Criteria andOperatorIdLessThan(Long value) { + addCriterion("operator_id <", value, "operatorId"); + return (Criteria) this; + } + + public Criteria andOperatorIdLessThanOrEqualTo(Long value) { + addCriterion("operator_id <=", value, "operatorId"); + return (Criteria) this; + } + + public Criteria andOperatorIdIn(List values) { + addCriterion("operator_id in", values, "operatorId"); + return (Criteria) this; + } + + public Criteria andOperatorIdNotIn(List values) { + addCriterion("operator_id not in", values, "operatorId"); + return (Criteria) this; + } + + public Criteria andOperatorIdBetween(Long value1, Long value2) { + addCriterion("operator_id between", value1, value2, "operatorId"); + return (Criteria) this; + } + + public Criteria andOperatorIdNotBetween(Long value1, Long value2) { + addCriterion("operator_id not between", value1, value2, "operatorId"); + return (Criteria) this; + } + + public Criteria andProjectIdIsNull() { + addCriterion("project_id is null"); + return (Criteria) this; + } + + public Criteria andProjectIdIsNotNull() { + addCriterion("project_id is not null"); + return (Criteria) this; + } + + public Criteria andProjectIdEqualTo(Long value) { + addCriterion("project_id =", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotEqualTo(Long value) { + addCriterion("project_id <>", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdGreaterThan(Long value) { + addCriterion("project_id >", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdGreaterThanOrEqualTo(Long value) { + addCriterion("project_id >=", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLessThan(Long value) { + addCriterion("project_id <", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLessThanOrEqualTo(Long value) { + addCriterion("project_id <=", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdIn(List values) { + addCriterion("project_id in", values, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotIn(List values) { + addCriterion("project_id not in", values, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdBetween(Long value1, Long value2) { + addCriterion("project_id between", value1, value2, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotBetween(Long value1, Long value2) { + addCriterion("project_id not between", value1, value2, "projectId"); + return (Criteria) this; + } + + public Criteria andOperateTypeIsNull() { + addCriterion("operate_type is null"); + return (Criteria) this; + } + + public Criteria andOperateTypeIsNotNull() { + addCriterion("operate_type is not null"); + return (Criteria) this; + } + + public Criteria andOperateTypeEqualTo(Byte value) { + addCriterion("operate_type =", value, "operateType"); + return (Criteria) this; + } + + public Criteria andOperateTypeNotEqualTo(Byte value) { + addCriterion("operate_type <>", value, "operateType"); + return (Criteria) this; + } + + public Criteria andOperateTypeGreaterThan(Byte value) { + addCriterion("operate_type >", value, "operateType"); + return (Criteria) this; + } + + public Criteria andOperateTypeGreaterThanOrEqualTo(Byte value) { + addCriterion("operate_type >=", value, "operateType"); + return (Criteria) this; + } + + public Criteria andOperateTypeLessThan(Byte value) { + addCriterion("operate_type <", value, "operateType"); + return (Criteria) this; + } + + public Criteria andOperateTypeLessThanOrEqualTo(Byte value) { + addCriterion("operate_type <=", value, "operateType"); + return (Criteria) this; + } + + public Criteria andOperateTypeIn(List values) { + addCriterion("operate_type in", values, "operateType"); + return (Criteria) this; + } + + public Criteria andOperateTypeNotIn(List values) { + addCriterion("operate_type not in", values, "operateType"); + return (Criteria) this; + } + + public Criteria andOperateTypeBetween(Byte value1, Byte value2) { + addCriterion("operate_type between", value1, value2, "operateType"); + return (Criteria) this; + } + + public Criteria andOperateTypeNotBetween(Byte value1, Byte value2) { + addCriterion("operate_type not between", value1, value2, "operateType"); + return (Criteria) this; + } + + public Criteria andOperationTimeIsNull() { + addCriterion("operation_time is null"); + return (Criteria) this; + } + + public Criteria andOperationTimeIsNotNull() { + addCriterion("operation_time is not null"); + return (Criteria) this; + } + + public Criteria andOperationTimeEqualTo(Long value) { + addCriterion("operation_time =", value, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeNotEqualTo(Long value) { + addCriterion("operation_time <>", value, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeGreaterThan(Long value) { + addCriterion("operation_time >", value, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeGreaterThanOrEqualTo(Long value) { + addCriterion("operation_time >=", value, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeLessThan(Long value) { + addCriterion("operation_time <", value, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeLessThanOrEqualTo(Long value) { + addCriterion("operation_time <=", value, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeIn(List values) { + addCriterion("operation_time in", values, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeNotIn(List values) { + addCriterion("operation_time not in", values, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeBetween(Long value1, Long value2) { + addCriterion("operation_time between", value1, value2, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeNotBetween(Long value1, Long value2) { + addCriterion("operation_time not between", value1, value2, "operationTime"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Date value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Date value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Date value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Date value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Date value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Date value1, Date value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Date value1, Date value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNull() { + addCriterion("updated_at is null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNotNull() { + addCriterion("updated_at is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtEqualTo(Date value) { + addCriterion("updated_at =", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotEqualTo(Date value) { + addCriterion("updated_at <>", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThan(Date value) { + addCriterion("updated_at >", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("updated_at >=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThan(Date value) { + addCriterion("updated_at <", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { + addCriterion("updated_at <=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIn(List values) { + addCriterion("updated_at in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotIn(List values) { + addCriterion("updated_at not in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtBetween(Date value1, Date value2) { + addCriterion("updated_at between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { + addCriterion("updated_at not between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNull() { + addCriterion("rec_status is null"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNotNull() { + addCriterion("rec_status is not null"); + return (Criteria) this; + } + + public Criteria andRecStatusEqualTo(Byte value) { + addCriterion("rec_status =", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotEqualTo(Byte value) { + addCriterion("rec_status <>", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThan(Byte value) { + addCriterion("rec_status >", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("rec_status >=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThan(Byte value) { + addCriterion("rec_status <", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThanOrEqualTo(Byte value) { + addCriterion("rec_status <=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusIn(List values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List values) { + addCriterion("rec_status not in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusBetween(Byte value1, Byte value2) { + addCriterion("rec_status between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { + addCriterion("rec_status not between", value1, value2, "recStatus"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/tall/src/main/java/com/ccsens/tall/bean/po/SysOperationMessage.java b/tall/src/main/java/com/ccsens/tall/bean/po/SysOperationMessage.java new file mode 100644 index 00000000..f6de4db5 --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/bean/po/SysOperationMessage.java @@ -0,0 +1,117 @@ +package com.ccsens.tall.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class SysOperationMessage implements Serializable { + private Long id; + + private Long operationId; + + private String content; + + private Byte type; + + private String settings; + + private Byte sort; + + private Date createdAt; + + private Date updatedAt; + + private Byte recStatus; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getOperationId() { + return operationId; + } + + public void setOperationId(Long operationId) { + this.operationId = operationId; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getSettings() { + return settings; + } + + public void setSettings(String settings) { + this.settings = settings == null ? null : settings.trim(); + } + + public Byte getSort() { + return sort; + } + + public void setSort(Byte sort) { + this.sort = sort; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + + public Byte getRecStatus() { + return recStatus; + } + + public void setRecStatus(Byte recStatus) { + this.recStatus = recStatus; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", operationId=").append(operationId); + sb.append(", content=").append(content); + sb.append(", type=").append(type); + sb.append(", settings=").append(settings); + sb.append(", sort=").append(sort); + sb.append(", createdAt=").append(createdAt); + sb.append(", updatedAt=").append(updatedAt); + sb.append(", recStatus=").append(recStatus); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/tall/src/main/java/com/ccsens/tall/bean/po/SysOperationMessageExample.java b/tall/src/main/java/com/ccsens/tall/bean/po/SysOperationMessageExample.java new file mode 100644 index 00000000..d2bc0929 --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/bean/po/SysOperationMessageExample.java @@ -0,0 +1,761 @@ +package com.ccsens.tall.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SysOperationMessageExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SysOperationMessageExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andOperationIdIsNull() { + addCriterion("operation_id is null"); + return (Criteria) this; + } + + public Criteria andOperationIdIsNotNull() { + addCriterion("operation_id is not null"); + return (Criteria) this; + } + + public Criteria andOperationIdEqualTo(Long value) { + addCriterion("operation_id =", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdNotEqualTo(Long value) { + addCriterion("operation_id <>", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdGreaterThan(Long value) { + addCriterion("operation_id >", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdGreaterThanOrEqualTo(Long value) { + addCriterion("operation_id >=", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdLessThan(Long value) { + addCriterion("operation_id <", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdLessThanOrEqualTo(Long value) { + addCriterion("operation_id <=", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdIn(List values) { + addCriterion("operation_id in", values, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdNotIn(List values) { + addCriterion("operation_id not in", values, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdBetween(Long value1, Long value2) { + addCriterion("operation_id between", value1, value2, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdNotBetween(Long value1, Long value2) { + addCriterion("operation_id not between", value1, value2, "operationId"); + return (Criteria) this; + } + + public Criteria andContentIsNull() { + addCriterion("content is null"); + return (Criteria) this; + } + + public Criteria andContentIsNotNull() { + addCriterion("content is not null"); + return (Criteria) this; + } + + public Criteria andContentEqualTo(String value) { + addCriterion("content =", value, "content"); + return (Criteria) this; + } + + public Criteria andContentNotEqualTo(String value) { + addCriterion("content <>", value, "content"); + return (Criteria) this; + } + + public Criteria andContentGreaterThan(String value) { + addCriterion("content >", value, "content"); + return (Criteria) this; + } + + public Criteria andContentGreaterThanOrEqualTo(String value) { + addCriterion("content >=", value, "content"); + return (Criteria) this; + } + + public Criteria andContentLessThan(String value) { + addCriterion("content <", value, "content"); + return (Criteria) this; + } + + public Criteria andContentLessThanOrEqualTo(String value) { + addCriterion("content <=", value, "content"); + return (Criteria) this; + } + + public Criteria andContentLike(String value) { + addCriterion("content like", value, "content"); + return (Criteria) this; + } + + public Criteria andContentNotLike(String value) { + addCriterion("content not like", value, "content"); + return (Criteria) this; + } + + public Criteria andContentIn(List values) { + addCriterion("content in", values, "content"); + return (Criteria) this; + } + + public Criteria andContentNotIn(List values) { + addCriterion("content not in", values, "content"); + return (Criteria) this; + } + + public Criteria andContentBetween(String value1, String value2) { + addCriterion("content between", value1, value2, "content"); + return (Criteria) this; + } + + public Criteria andContentNotBetween(String value1, String value2) { + addCriterion("content not between", value1, value2, "content"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Byte value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Byte value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Byte value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Byte value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Byte value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Byte value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Byte value1, Byte value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Byte value1, Byte value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andSettingsIsNull() { + addCriterion("settings is null"); + return (Criteria) this; + } + + public Criteria andSettingsIsNotNull() { + addCriterion("settings is not null"); + return (Criteria) this; + } + + public Criteria andSettingsEqualTo(String value) { + addCriterion("settings =", value, "settings"); + return (Criteria) this; + } + + public Criteria andSettingsNotEqualTo(String value) { + addCriterion("settings <>", value, "settings"); + return (Criteria) this; + } + + public Criteria andSettingsGreaterThan(String value) { + addCriterion("settings >", value, "settings"); + return (Criteria) this; + } + + public Criteria andSettingsGreaterThanOrEqualTo(String value) { + addCriterion("settings >=", value, "settings"); + return (Criteria) this; + } + + public Criteria andSettingsLessThan(String value) { + addCriterion("settings <", value, "settings"); + return (Criteria) this; + } + + public Criteria andSettingsLessThanOrEqualTo(String value) { + addCriterion("settings <=", value, "settings"); + return (Criteria) this; + } + + public Criteria andSettingsLike(String value) { + addCriterion("settings like", value, "settings"); + return (Criteria) this; + } + + public Criteria andSettingsNotLike(String value) { + addCriterion("settings not like", value, "settings"); + return (Criteria) this; + } + + public Criteria andSettingsIn(List values) { + addCriterion("settings in", values, "settings"); + return (Criteria) this; + } + + public Criteria andSettingsNotIn(List values) { + addCriterion("settings not in", values, "settings"); + return (Criteria) this; + } + + public Criteria andSettingsBetween(String value1, String value2) { + addCriterion("settings between", value1, value2, "settings"); + return (Criteria) this; + } + + public Criteria andSettingsNotBetween(String value1, String value2) { + addCriterion("settings not between", value1, value2, "settings"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(Byte value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(Byte value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(Byte value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(Byte value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(Byte value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(Byte value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(Byte value1, Byte value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(Byte value1, Byte value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Date value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Date value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Date value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Date value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Date value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Date value1, Date value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Date value1, Date value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNull() { + addCriterion("updated_at is null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNotNull() { + addCriterion("updated_at is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtEqualTo(Date value) { + addCriterion("updated_at =", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotEqualTo(Date value) { + addCriterion("updated_at <>", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThan(Date value) { + addCriterion("updated_at >", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("updated_at >=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThan(Date value) { + addCriterion("updated_at <", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { + addCriterion("updated_at <=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIn(List values) { + addCriterion("updated_at in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotIn(List values) { + addCriterion("updated_at not in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtBetween(Date value1, Date value2) { + addCriterion("updated_at between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { + addCriterion("updated_at not between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNull() { + addCriterion("rec_status is null"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNotNull() { + addCriterion("rec_status is not null"); + return (Criteria) this; + } + + public Criteria andRecStatusEqualTo(Byte value) { + addCriterion("rec_status =", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotEqualTo(Byte value) { + addCriterion("rec_status <>", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThan(Byte value) { + addCriterion("rec_status >", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("rec_status >=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThan(Byte value) { + addCriterion("rec_status <", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThanOrEqualTo(Byte value) { + addCriterion("rec_status <=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusIn(List values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List values) { + addCriterion("rec_status not in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusBetween(Byte value1, Byte value2) { + addCriterion("rec_status between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { + addCriterion("rec_status not between", value1, value2, "recStatus"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/tall/src/main/java/com/ccsens/tall/bean/vo/MessageVo.java b/tall/src/main/java/com/ccsens/tall/bean/vo/MessageVo.java new file mode 100644 index 00000000..a09d3c7d --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/bean/vo/MessageVo.java @@ -0,0 +1,207 @@ +package com.ccsens.tall.bean.vo; + +import com.alibaba.fastjson.JSONObject; +import com.ccsens.util.WebConstant; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @description: + * @author: whj + * @time: 2020/5/26 15:05 + */ +public class MessageVo { + + + + + @Data + @ApiModel("消息通知--前端") + public static class InformToWeb{ + @ApiModelProperty("消息Id") + private Long id; + @ApiModelProperty("消息列表") + private List messages; + } + + @Data + @ApiModel("消息通知") + public static class Inform{ + @ApiModelProperty("项目ID") + private Long projectId; + @ApiModelProperty("操作者ID") + private Long operatorId; + @ApiModelProperty("消息列表") + private List messages = new ArrayList<>(); + + public Inform() { + } + + public Inform(Long projectId, Long operatorId) { + this.projectId = projectId; + this.operatorId = operatorId; + } + + public Inform appendMessage(Message message) { + messages.add(message); + return this; + } + } + + @Data + @ApiModel("消息内容") + public static class Message { + @ApiModelProperty("消息属性") + private String name; + @ApiModelProperty("消息内容") + private String content; + @ApiModelProperty("类型 0:文本 1:链接") + private Byte type = 0; + @ApiModelProperty("配置") + private String settings; + + public static String getProjectSettings(Long projectId) { + JSONObject json = new JSONObject(); + json.put(WebConstant.Project.PROJECT_ID, projectId); + return json.toJSONString(); + } + + public Message() { + } + public Message(String content) { + this.content = content; + } + public Message(String name, String content) { + this.name = name; + this.content = content; + } + + public Message(String name, String content, Byte type, String settings) { + this.name = name; + this.content = content; + this.type = type; + this.settings = settings; + } + } + + + + + /** + * 组装添加任务模板 + * @param userId + * @param userName + * @param projectId + * @param projectName + * @param taskName + * @param principal + * @return + */ + public static Inform addTask(Long userId, String userName, Long projectId, String projectName, String taskName, String principal) { + MessageVo.Inform inform = new MessageVo.Inform(projectId, userId); + inform.appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, projectName, WebConstant.Message.TYPE_LINK, Message.getProjectSettings(projectId))) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Principal.value,principal)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.TaskName.value,taskName)); + return inform; + } + + /** + * 组装完成任务模板 + * @param userId + * @param userName + * @param projectId + * @param projectName + * @param isFinish + * @param taskName + * @return + */ + public static Inform finishTask(Long userId, String userName, Long projectId, String projectName, String isFinish, String taskName) { + MessageVo.Inform inform = new MessageVo.Inform(projectId, userId); + inform.appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, projectName, WebConstant.Message.TYPE_LINK, Message.getProjectSettings(projectId))) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Operate.value, isFinish)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.TaskName.value,taskName)); + return inform; + } + + /** + * 上传交付物 + * @param userId + * @param userName + * @param projectId + * @param projectName + * @param taskName + * @param deliverName + * @return + */ + public static Inform addDeliver(Long userId, String userName, Long projectId, String projectName, String taskName, String deliverName) { + MessageVo.Inform inform = new MessageVo.Inform(projectId, userId); + inform.appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, projectName, WebConstant.Message.TYPE_LINK, Message.getProjectSettings(projectId))) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Deliverable.value, deliverName)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.TaskName.value,taskName)); + return inform; + } + + /** + * 检查交付物 + * @param userId + * @param userName + * @param projectId + * @param projectName + * @param taskName + * @param principalName + * @param deliverName + * @return + */ + public static Inform checkDeliver(Long userId, String userName, Long projectId, String projectName, String taskName, String principalName, String deliverName) { + MessageVo.Inform inform = new MessageVo.Inform(projectId, userId); + inform.appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, projectName, WebConstant.Message.TYPE_LINK, Message.getProjectSettings(projectId))) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Deliverable.value, deliverName)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.TaskName.value,taskName)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Principal.value,principalName)); + return inform; + } + + public static Inform deleteDeliver(Long userId, String userName, Long projectId, String projectName, String taskName, String deliverName) { + MessageVo.Inform inform = new MessageVo.Inform(projectId, userId); + inform.appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, projectName, WebConstant.Message.TYPE_LINK, Message.getProjectSettings(projectId))) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Deliverable.value, deliverName)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.TaskName.value,taskName)); + return inform; + } + + public static Inform deleteTask(Long userId, String userName, Long projectId, String projectName, String taskName) { + MessageVo.Inform inform = new MessageVo.Inform(projectId, userId); + inform.appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, projectName, WebConstant.Message.TYPE_LINK, Message.getProjectSettings(projectId))) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.TaskName.value,taskName)); + return inform; + + } + + public static Inform changeTask(Long userId, String userName, Long projectId, String projectName, String taskName, String principal) { + MessageVo.Inform inform = new MessageVo.Inform(projectId, userId); + inform.appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, projectName, WebConstant.Message.TYPE_LINK, Message.getProjectSettings(projectId))) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.TaskName.value,taskName)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Principal.value,principal)); + return inform; + } + + public static Inform addComment(Long userId, String userName, Long projectId, String projectName, String taskName) { + MessageVo.Inform inform = new MessageVo.Inform(projectId, userId); + inform.appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, projectName, WebConstant.Message.TYPE_LINK, Message.getProjectSettings(projectId))) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.TaskName.value,taskName)); + return inform; + } +} diff --git a/tall/src/main/java/com/ccsens/tall/bean/vo/ProjectMessageVo.java b/tall/src/main/java/com/ccsens/tall/bean/vo/ProjectMessageVo.java new file mode 100644 index 00000000..deaa8f99 --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/bean/vo/ProjectMessageVo.java @@ -0,0 +1,46 @@ +package com.ccsens.tall.bean.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @description: + * @author: whj + * @time: 2020/5/28 17:34 + */ +@ApiModel("未读消息相关返回结果") +public class ProjectMessageVo { + @Data + @ApiModel("未读消息数") + public static class UnreadNum{ + @ApiModelProperty("发送类型 0:ws,1:微信公众号") + private Integer unreadNum; + } + + @Data + @ApiModel("未读消息") + @JsonIgnoreProperties(value = { "handler" }) + public static class Query{ + @ApiModelProperty("发送消息ID") + private Long id; + @JsonIgnore + @ApiModelProperty("消息操作ID") + private Long operationId; + @ApiModelProperty("发送类型 0:ws,1:微信公众号") + private Byte sendType; + @ApiModelProperty("阅读状态 0未读 1已读") + private Byte readStatus; + @ApiModelProperty("消息内容") + List messages; + @JsonFormat(pattern="yyyy-MM-dd HH:mm") + @ApiModelProperty("发送时间") + private Date createTime; + } +} diff --git a/tall/src/main/java/com/ccsens/tall/persist/dao/ProMemberDao.java b/tall/src/main/java/com/ccsens/tall/persist/dao/ProMemberDao.java index 1f501c15..3986962c 100644 --- a/tall/src/main/java/com/ccsens/tall/persist/dao/ProMemberDao.java +++ b/tall/src/main/java/com/ccsens/tall/persist/dao/ProMemberDao.java @@ -17,4 +17,10 @@ public interface ProMemberDao extends ProMemberMapper{ List selectByRoleId(@Param("roleId")Long roleId); List getMemberAndStakeholder(@Param("projectId")Long projectId); + + /** + * 查询项目内所有成员的userid + * @param projectId + */ + List queryUserIdsByProjectId(@Param("projectId") Long projectId); } diff --git a/tall/src/main/java/com/ccsens/tall/persist/dao/SysMessageSendDao.java b/tall/src/main/java/com/ccsens/tall/persist/dao/SysMessageSendDao.java new file mode 100644 index 00000000..ad040cbf --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/persist/dao/SysMessageSendDao.java @@ -0,0 +1,32 @@ +package com.ccsens.tall.persist.dao; + +import com.ccsens.tall.persist.mapper.SysMessageSendMapper; +import org.apache.ibatis.annotations.Param; + +public interface SysMessageSendDao extends SysMessageSendMapper { + /** + * 标记消息已读+初始读 + * @param id + */ + void markInitRead(@Param("id") Long id); + + /** + * 标记某人某消息的所有未读发送为已读 + * @param operationId + * @param userId + */ + void markOtherSendRead(@Param("operationId") Long operationId, @Param("receiverId") Long userId); + + /** + * 标记用户该方式的消息为已读+初始阅读 + * @param sendType + * @param userId + */ + void markInitReadBySendType(@Param("sendType") Byte sendType, @Param("receiverId") Long userId); + + /** + * 标记用户的其他未读消息为已读 + * @param userId + */ + void markAllRead(@Param("receiverId") Long userId); +} diff --git a/tall/src/main/java/com/ccsens/tall/persist/dao/SysOperationDao.java b/tall/src/main/java/com/ccsens/tall/persist/dao/SysOperationDao.java new file mode 100644 index 00000000..7a6b446f --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/persist/dao/SysOperationDao.java @@ -0,0 +1,34 @@ +package com.ccsens.tall.persist.dao; + +import com.ccsens.tall.bean.vo.MessageVo; +import com.ccsens.tall.bean.vo.ProjectMessageVo; +import com.ccsens.tall.persist.mapper.SysOperationMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface SysOperationDao extends SysOperationMapper { + + /** + * 查询未读消息数 + * @param sendType + * @param userId + * @return + */ + ProjectMessageVo.UnreadNum queryUnreadNum(@Param("sendType") Byte sendType, @Param("userId") Long userId); + + /** + * 查询消息 + * @param sendType + * @param userId + * @return + */ + List queryMsg(@Param("sendType")Byte sendType, @Param("userId")Long userId); + + /** + * 查询消息的具体内容 + * @param operationId + * @return + */ + List queryContent(@Param("operationId") Long operationId); +} diff --git a/tall/src/main/java/com/ccsens/tall/persist/mapper/SysMessageSendMapper.java b/tall/src/main/java/com/ccsens/tall/persist/mapper/SysMessageSendMapper.java new file mode 100644 index 00000000..0827b91b --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/persist/mapper/SysMessageSendMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.tall.persist.mapper; + +import com.ccsens.tall.bean.po.SysMessageSend; +import com.ccsens.tall.bean.po.SysMessageSendExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface SysMessageSendMapper { + long countByExample(SysMessageSendExample example); + + int deleteByExample(SysMessageSendExample example); + + int deleteByPrimaryKey(Long id); + + int insert(SysMessageSend record); + + int insertSelective(SysMessageSend record); + + List selectByExample(SysMessageSendExample example); + + SysMessageSend selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") SysMessageSend record, @Param("example") SysMessageSendExample example); + + int updateByExample(@Param("record") SysMessageSend record, @Param("example") SysMessageSendExample example); + + int updateByPrimaryKeySelective(SysMessageSend record); + + int updateByPrimaryKey(SysMessageSend record); +} \ No newline at end of file diff --git a/tall/src/main/java/com/ccsens/tall/persist/mapper/SysOperationMapper.java b/tall/src/main/java/com/ccsens/tall/persist/mapper/SysOperationMapper.java new file mode 100644 index 00000000..229b83fb --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/persist/mapper/SysOperationMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.tall.persist.mapper; + +import com.ccsens.tall.bean.po.SysOperation; +import com.ccsens.tall.bean.po.SysOperationExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface SysOperationMapper { + long countByExample(SysOperationExample example); + + int deleteByExample(SysOperationExample example); + + int deleteByPrimaryKey(Long id); + + int insert(SysOperation record); + + int insertSelective(SysOperation record); + + List selectByExample(SysOperationExample example); + + SysOperation selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") SysOperation record, @Param("example") SysOperationExample example); + + int updateByExample(@Param("record") SysOperation record, @Param("example") SysOperationExample example); + + int updateByPrimaryKeySelective(SysOperation record); + + int updateByPrimaryKey(SysOperation record); +} \ No newline at end of file diff --git a/tall/src/main/java/com/ccsens/tall/persist/mapper/SysOperationMessageMapper.java b/tall/src/main/java/com/ccsens/tall/persist/mapper/SysOperationMessageMapper.java new file mode 100644 index 00000000..e6d044c0 --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/persist/mapper/SysOperationMessageMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.tall.persist.mapper; + +import com.ccsens.tall.bean.po.SysOperationMessage; +import com.ccsens.tall.bean.po.SysOperationMessageExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface SysOperationMessageMapper { + long countByExample(SysOperationMessageExample example); + + int deleteByExample(SysOperationMessageExample example); + + int deleteByPrimaryKey(Long id); + + int insert(SysOperationMessage record); + + int insertSelective(SysOperationMessage record); + + List selectByExample(SysOperationMessageExample example); + + SysOperationMessage selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") SysOperationMessage record, @Param("example") SysOperationMessageExample example); + + int updateByExample(@Param("record") SysOperationMessage record, @Param("example") SysOperationMessageExample example); + + int updateByPrimaryKeySelective(SysOperationMessage record); + + int updateByPrimaryKey(SysOperationMessage record); +} \ No newline at end of file diff --git a/tall/src/main/java/com/ccsens/tall/service/AsyncService.java b/tall/src/main/java/com/ccsens/tall/service/AsyncService.java index 5f3696fa..79b2f259 100644 --- a/tall/src/main/java/com/ccsens/tall/service/AsyncService.java +++ b/tall/src/main/java/com/ccsens/tall/service/AsyncService.java @@ -1,5 +1,6 @@ package com.ccsens.tall.service; +import com.ccsens.tall.bean.vo.MessageVo; import com.ccsens.tall.util.RobotUtil; import com.ccsens.util.annotation.OperateType; import lombok.extern.slf4j.Slf4j; @@ -18,6 +19,8 @@ public class AsyncService implements IAsyncService{ @Resource private IRobotService robotService; + @Resource + private IProjectMessageService projectMessageService; @Override @@ -25,4 +28,8 @@ public class AsyncService implements IAsyncService{ robotService.robotMessage(operateType,message); } + @Override + public void sendMessage(OperateType operateType, MessageVo.Inform inform) { + projectMessageService.sendProjectMessage(operateType, inform); + } } diff --git a/tall/src/main/java/com/ccsens/tall/service/IAsyncService.java b/tall/src/main/java/com/ccsens/tall/service/IAsyncService.java index aa8f6c5f..bd495fe8 100644 --- a/tall/src/main/java/com/ccsens/tall/service/IAsyncService.java +++ b/tall/src/main/java/com/ccsens/tall/service/IAsyncService.java @@ -1,5 +1,6 @@ package com.ccsens.tall.service; +import com.ccsens.tall.bean.vo.MessageVo; import com.ccsens.tall.util.RobotUtil; import com.ccsens.util.annotation.OperateType; @@ -8,4 +9,13 @@ import com.ccsens.util.annotation.OperateType; */ public interface IAsyncService { void sendRobotMessage(OperateType operateType, RobotUtil.Message message); + + /** + * 消息发送(ws,公众号) + * @param operateType + * @param inform + */ + void sendMessage(OperateType operateType, MessageVo.Inform inform); + + } diff --git a/tall/src/main/java/com/ccsens/tall/service/IProjectMessageService.java b/tall/src/main/java/com/ccsens/tall/service/IProjectMessageService.java new file mode 100644 index 00000000..672bfbac --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/service/IProjectMessageService.java @@ -0,0 +1,55 @@ +package com.ccsens.tall.service; + +import com.ccsens.tall.bean.dto.ProjectMessageDto; +import com.ccsens.tall.bean.vo.MessageVo; +import com.ccsens.tall.bean.vo.ProjectMessageVo; +import com.ccsens.util.CodeEnum; +import com.ccsens.util.annotation.OperateType; +import com.github.pagehelper.PageInfo; + +/** + * @description: + * @author: whj + * @time: 2020/5/26 17:36 + */ +public interface IProjectMessageService { + + /** + * 发送消息(ws/公众号) + * @param operateType + * @param inform + */ + void sendProjectMessage(OperateType operateType, MessageVo.Inform inform); + + /** + * 查询未读消息数 + * @param sendType + * @param userId + * @return + */ + ProjectMessageVo.UnreadNum queryUnreadNum(Byte sendType, Long userId); + + /** + * 分页查询未读消息数 + * @param param + * @param userId + * @return + */ + PageInfo queryMsg(ProjectMessageDto.Query param, Long userId); + + /** + * 标记某条消息已读 + * @param param + * @param userId + * @return + */ + CodeEnum markRead(ProjectMessageDto.MarkRead param, Long userId); + + /** + * 标记全部消息已读 + * @param param + * @param userId + * @return + */ + CodeEnum markAllRead(ProjectMessageDto.MarkAllRead param, Long userId); +} diff --git a/tall/src/main/java/com/ccsens/tall/service/IRobotService.java b/tall/src/main/java/com/ccsens/tall/service/IRobotService.java index 9ffa1fea..3bf14221 100644 --- a/tall/src/main/java/com/ccsens/tall/service/IRobotService.java +++ b/tall/src/main/java/com/ccsens/tall/service/IRobotService.java @@ -44,7 +44,7 @@ public interface IRobotService { * @param currentUserId * @param subTimeId */ - void addDeliverRobotSend(Long currentUserId,String deliverName, Long subTimeId) throws Exception; + void addDeliverRobotSend(Long currentUserId,String deliverName, Long subTimeId,SysProject project) throws Exception; /** * 删除交付物信息 @@ -69,4 +69,11 @@ public interface IRobotService { * @param proTaskDetail */ void addCommentRobotSend(Long userId, ProTaskDetail proTaskDetail) throws Exception; + + /** + * 查询模板 + * @param code + * @return + */ + String getRobotTemplate(int code); } diff --git a/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java b/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java index ab566fbf..40f06eb7 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java @@ -1121,6 +1121,8 @@ public class ProTaskDetailService implements IProTaskDetailService { //返回的任务详细信息 Long subTimeId = taskDeliverService.isTaskOrSubTime(taskDetail.getId()); normalTask = getTaskInfoByTaskId(currentUserId,project.getId(),subTimeId); + } else { + throw new BaseException(CodeEnum.NOT_POWER); } }else { throw new BaseException(CodeEnum.NOT_POWER); diff --git a/tall/src/main/java/com/ccsens/tall/service/ProjectMessageService.java b/tall/src/main/java/com/ccsens/tall/service/ProjectMessageService.java new file mode 100644 index 00000000..d0f0e9ab --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/service/ProjectMessageService.java @@ -0,0 +1,270 @@ +package com.ccsens.tall.service; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.lang.Snowflake; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.ccsens.tall.bean.dto.ProjectMessageDto; +import com.ccsens.tall.bean.po.SysMessageSend; +import com.ccsens.tall.bean.po.SysMessageSendExample; +import com.ccsens.tall.bean.po.SysOperation; +import com.ccsens.tall.bean.po.SysOperationMessage; +import com.ccsens.tall.bean.vo.MessageVo; +import com.ccsens.tall.bean.vo.ProjectMessageVo; +import com.ccsens.tall.persist.dao.ProMemberDao; +import com.ccsens.tall.persist.dao.SysMessageSendDao; +import com.ccsens.tall.persist.dao.SysOperationDao; +import com.ccsens.tall.persist.mapper.SysOperationMessageMapper; +import com.ccsens.util.CodeEnum; +import com.ccsens.util.TransactionUtil; +import com.ccsens.util.WebConstant; +import com.ccsens.util.annotation.OperateType; +import com.ccsens.util.bean.message.common.InMessage; +import com.ccsens.util.config.RabbitMQConfig; +import com.ccsens.util.exception.BaseException; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.amqp.core.AmqpTemplate; +import org.springframework.stereotype.Service; +import org.springframework.transaction.PlatformTransactionManager; +import org.springframework.transaction.TransactionException; +import org.springframework.transaction.TransactionStatus; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +/** + * @description: + * @author: whj + * @time: 2020/5/26 17:36 + */ +@Slf4j +@Service +@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) +public class ProjectMessageService implements IProjectMessageService { + @Resource + private IRobotService robotService; + @Resource + private ProMemberDao proMemberDao; + @Resource + private SysOperationDao sysOperationDao; + @Resource + private SysOperationMessageMapper sysOperationMessageMapper; + @Resource + private SysMessageSendDao sysMessageSendDao; + + @Resource + private AmqpTemplate rabbitTemplate; + @Resource + private Snowflake snowflake; + @Resource + private PlatformTransactionManager transactionManager; + + @Override + public void sendProjectMessage(OperateType operateType, MessageVo.Inform inform) { + log.info("发送消息请求参数:类型:{},消息:{}", operateType, inform); + if (operateType == null || inform == null) { + throw new BaseException(CodeEnum.PARAM_ERROR); + } + // 模板 + List newMessages = getMessages(operateType, inform); + log.info("模板:{}", newMessages); + // 查询项目内所有成员ID + List userIds = proMemberDao.queryUserIdsByProjectId(inform.getProjectId()); + + //保存消息记录 + Long operationId = initMessage(operateType, inform, newMessages, userIds); + //mq-->ws + InMessage inMessage = new InMessage(); + inMessage.setTos(InMessage.transTos(userIds)); + inMessage.setData(JSONObject.toJSONString(newMessages)); + rabbitTemplate.convertAndSend(RabbitMQConfig.MESSAGE_QUEUE_NAME, JSONObject.toJSONString(inMessage)); + log.info("mq通知消息:{}", inMessage); + //更新ws消息发送成功 + updateStatus(operationId, WebConstant.Message.SEND_WS); + } + + /** + * 更新记录为发送成功 + * @param operationId + * @param sendType + */ + private void updateStatus(Long operationId, byte sendType) { + SysMessageSend send = new SysMessageSend(); + send.setComplete(WebConstant.Message.SEND_SUCCESS); + SysMessageSendExample sendExample = new SysMessageSendExample(); + sendExample.createCriteria().andOperationIdEqualTo(operationId).andSendTypeEqualTo(sendType).andRecStatusEqualTo(WebConstant.REC_STATUS.Normal.value); + sysMessageSendDao.updateByExampleSelective(send, sendExample); + log.info("修改操作:{}的发送类型:{}为发送成功", operationId, sendType); + } + + /** + * 保存操作记录 + * @param operateType + * @param inform + * @param messages + * @param userIds + * @return + */ + private Long initMessage(OperateType operateType, MessageVo.Inform inform, List messages, + List userIds) { + // 操作日志 + SysOperation operation = new SysOperation(); + operation.setId(snowflake.nextId()); + operation.setProjectId(inform.getProjectId()); + operation.setOperatorId(inform.getOperatorId()); + operation.setOperateType((byte)operateType.value()); + log.info("保存操作记录:{}", operation); + sysOperationDao.insertSelective(operation); + // 操作内容 + if(CollectionUtil.isNotEmpty(messages)) { + for (int i = 0; i < messages.size(); i++) { + MessageVo.Message message = messages.get(i); + SysOperationMessage operationMessage = new SysOperationMessage(); + operationMessage.setId(snowflake.nextId()); + operationMessage.setOperationId(operation.getId()); + operationMessage.setContent(message.getContent()); + operationMessage.setType(message.getType()); + operationMessage.setSettings(message.getSettings()); + operationMessage.setSort((byte)i); + log.info("第{}个消息内容:{}", i, operationMessage); + sysOperationMessageMapper.insertSelective(operationMessage); + } + } + // 操作发送 + if (CollectionUtil.isNotEmpty(userIds)) { + initMessageSend(userIds, operation.getId()); + } + return operation.getId(); + } + + /** + * 保存消息通知了谁 + * @param userIds + * @param operationId + */ + private void initMessageSend(List userIds, Long operationId) { + TransactionStatus transactionStatus = TransactionUtil.getTransactionStatus(transactionManager); + int length = userIds.size() -1; + try { + for (int i = 0; i <= length ; i++) { + // 封装对象 + Long userId = userIds.get(i); + SysMessageSend send = new SysMessageSend(); + send.setId(snowflake.nextId()); + send.setOperationId(operationId); + send.setReceiverId(userId); + send.setSendType(WebConstant.Message.SEND_WS); + sysMessageSendDao.insertSelective(send); + log.info("消息发送:{}", send); + // 判断是否需要提交事务,并开启新事务 + boolean needCommit = (i > 0 && (i+1)%100==0) || i == length; + if (needCommit) { + transactionManager.commit(transactionStatus); + if (i getMessages(OperateType operateType, MessageVo.Inform inform) { + String template = robotService.getRobotTemplate(operateType.value()); + // 解析模板 + List oldMessages = inform.getMessages(); + List newMessages = new ArrayList<>(); + int lastIndex = oldMessages.size() - 1; + //文本替换参数 + modifyTemplate(template, oldMessages, newMessages, lastIndex); + + return newMessages; + } + + /** + * 将模板中的参数替换成对应的值,如果参数类型不是文本类型,需要将模板在参数位置分成三部分 + * 递归 + * @param template + * @param oldMessages + * @param newMessages + * @param lastIndex + */ + private void modifyTemplate(String template, List oldMessages, List newMessages, int lastIndex) { + for (int i = 0; i <= lastIndex; i++) { + MessageVo.Message msg = oldMessages.get(i); + if (msg.getType().byteValue() == WebConstant.Message.TYPE_TEXT) { + template=template.replace(msg.getName(), msg.getContent()); + } else { + // 若非文本类,将前面的 + int index = template.indexOf(msg.getName()); + if (index < 0) { + continue; + } + if (index > 0) { + String text = template.substring(0, index); + if (text.contains("{{")) { + modifyTemplate(text, oldMessages, newMessages, lastIndex); + } else { + newMessages.add(new MessageVo.Message(text)); + } + } + newMessages.add(msg); + template = template.substring(index + msg.getName().length()); + } + + } + if (StrUtil.isNotBlank(template)) { + newMessages.add(new MessageVo.Message(template)); + } + } + + @Override + public ProjectMessageVo.UnreadNum queryUnreadNum(Byte sendType, Long userId) { + return sysOperationDao.queryUnreadNum(sendType, userId); + } + + @Override + public PageInfo queryMsg(ProjectMessageDto.Query param, Long userId) { + PageHelper.startPage(param.getPageNum(), param.getPageSize()); + List list = sysOperationDao.queryMsg(param.getSendType(), userId); + return new PageInfo<>(list); + } + + @Override + public CodeEnum markRead(ProjectMessageDto.MarkRead param, Long userId) { + SysMessageSend send = sysMessageSendDao.selectByPrimaryKey(param.getId()); + log.info("消息发送:{}", send); + if (send == null) { + return CodeEnum.PARAM_ERROR; + } + // 标记已读+初始阅读为真 + sysMessageSendDao.markInitRead(param.getId()); + // 标记同一消息+同一接收人的不同发送方式为已读 + sysMessageSendDao.markOtherSendRead(send.getOperationId(), userId); + return CodeEnum.SUCCESS; + } + + @Override + public CodeEnum markAllRead(ProjectMessageDto.MarkAllRead param, Long userId) { + + // 标记用户该方式的消息为已读+初始阅读 + sysMessageSendDao.markInitReadBySendType(param.getSendType(), userId); + // 标记用户的其他未读消息为已读 + sysMessageSendDao.markAllRead(userId); + return CodeEnum.SUCCESS; + } +} diff --git a/tall/src/main/java/com/ccsens/tall/service/RobotService.java b/tall/src/main/java/com/ccsens/tall/service/RobotService.java index ee69ae66..3c644b7a 100644 --- a/tall/src/main/java/com/ccsens/tall/service/RobotService.java +++ b/tall/src/main/java/com/ccsens/tall/service/RobotService.java @@ -4,12 +4,14 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.ccsens.tall.bean.po.*; +import com.ccsens.tall.bean.vo.MessageVo; import com.ccsens.tall.bean.vo.TaskVo; import com.ccsens.tall.persist.dao.*; import com.ccsens.tall.util.RobotUtil; import com.ccsens.tall.util.TallConstant; import com.ccsens.util.CodeEnum; import com.ccsens.util.RedisUtil; +import com.ccsens.util.WebConstant; import com.ccsens.util.annotation.OperateType; import com.ccsens.util.exception.BaseException; import com.ccsens.util.wx.WxRobotUtil; @@ -62,11 +64,9 @@ public class RobotService implements IRobotService{ if(isSend(sysProjectRobot.getId(),operateType.value())){ String content = getRobotTemplate(operateType.value()); //获取发送参数 - StringBuilder builder = new StringBuilder(content); - String replace = "{{}}"; + final String[] builder = {content}; message.getParams().forEach(param->{ - int start = builder.indexOf(replace); - builder.replace(start, start + replace.length(),param); + builder[0] = builder[0].replace(param.getName(),param.getContent()); }); //获取机器人信息 @@ -76,20 +76,15 @@ public class RobotService implements IRobotService{ switch (sysRobot.getClientType()){ case 0://微信 try { - WxRobotUtil.sendRobotInfo(sysRobot.getWebHook(),builder,message.getMsgType(),message.getMentionedList(),message.getMentionedMobileList()); + WxRobotUtil.sendRobotInfo(sysRobot.getWebHook(), builder[0],message.getMsgType(),message.getMentionedList(),message.getMentionedMobileList()); } catch (Exception e) { e.printStackTrace(); } - //删除线程 - RobotUtil.del(); + break; case 1://钉钉 - //删除线程 - RobotUtil.del(); break; default: - //删除线程 - RobotUtil.del(); } } } @@ -112,7 +107,8 @@ public class RobotService implements IRobotService{ return flag.get(); } - private String getRobotTemplate(int code){ + @Override + public String getRobotTemplate(int code){ String robotKey = TallConstant.getRobotTemplateKey(code); String template = ""; template = (String)redisUtil.get(robotKey); @@ -156,35 +152,51 @@ public class RobotService implements IRobotService{ } RobotUtil.Message message = new RobotUtil.Message(projectId); - message.appendParams(userName,projectName,isFinish,taskName); + message.appendParams( + new MessageVo.Message(WebConstant.TemplateParam.Operator.value,userName), + new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value,projectName), + new MessageVo.Message(WebConstant.TemplateParam.Operate.value,isFinish), + new MessageVo.Message(WebConstant.TemplateParam.TaskName.value,taskName)); //获取角色内成员的手机号 String[] memberPhone = getMemberPhonesByRoleId(executorRoleId); if(memberPhone.length != 0){ message.appendMentionedMobileList(memberPhone); } - RobotUtil.set(message); + RobotUtil.setRobotMessage(message); + // 添加消息通知 + MessageVo.Inform inform = MessageVo.finishTask(currentUserId, userName, projectId, projectName, isFinish, taskName); + RobotUtil.setInform(inform); } @Override public void addTaskRobotSend(Long currentUserId, SysProject project, String taskName, Long executorId) throws Exception { + String userName = userService.getUserNameByUserId(currentUserId); + String projectName = ""; - String executorName = ""; - TaskVo.RoleCheckList role = proRoleService.selectRoleByCheckOrExecutor(executorId); - if(ObjectUtil.isNotNull(role)){ - executorName = role.getName(); - } + if(ObjectUtil.isNotNull(project)){ projectName = project.getName(); } + // 获取角色名 + TaskVo.RoleCheckList role = proRoleService.selectRoleByCheckOrExecutor(executorId); + String executorName = ObjectUtil.isNotNull(role) ? role.getName() : ""; + RobotUtil.Message message = new RobotUtil.Message(project.getId()); - message.appendParams(userName,projectName,taskName,executorName); + message.appendParams( + new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName), + new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, projectName), + new MessageVo.Message(WebConstant.TemplateParam.TaskName.value, taskName), + new MessageVo.Message(WebConstant.TemplateParam.Principal.value, executorName)); //获取角色内成员的手机号 String[] memberPhone = getMemberPhonesByRoleId(executorId); if(memberPhone.length != 0){ message.appendMentionedMobileList(memberPhone); } - RobotUtil.set(message); + RobotUtil.setRobotMessage(message); + // 添加消息通知 + MessageVo.Inform inform = MessageVo.addTask(currentUserId, userName, project.getId(), projectName, taskName, executorName); + RobotUtil.setInform(inform); } @Override @@ -196,30 +208,44 @@ public class RobotService implements IRobotService{ projectName = sysProject.getName(); } RobotUtil.Message message = new RobotUtil.Message(sysProject.getId()); - message.appendParams(userName,projectName,taskDetail.getName()); + message.appendParams( + new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName), + new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, projectName), + new MessageVo.Message(WebConstant.TemplateParam.TaskName.value, taskDetail.getName())); //获取角色内成员的手机号 String[] memberPhone = getMemberPhonesByRoleId(taskDetail.getExecutorRole()); if(memberPhone.length != 0){ message.appendMentionedMobileList(memberPhone); } - RobotUtil.set(message); + RobotUtil.setRobotMessage(message); + + MessageVo.Inform inform = MessageVo.deleteTask(currentUserId, userName, sysProject.getId(), projectName, taskDetail.getName()); + RobotUtil.setInform(inform); } @Override public void changeTaskRobotSend(Long currentUserId, TaskVo.NormalTask normalTask) throws Exception { String userName = userService.getUserNameByUserId(currentUserId); RobotUtil.Message message = new RobotUtil.Message(normalTask.getProjectId()); - message.appendParams(userName,normalTask.getProjectName(),normalTask.getName(),normalTask.getExecutorRoleName()); + message.appendParams( + new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName), + new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, normalTask.getProjectName()), + new MessageVo.Message(WebConstant.TemplateParam.TaskName.value, normalTask.getName()), + new MessageVo.Message(WebConstant.TemplateParam.Principal.value, normalTask.getExecutorRoleName())); //获取角色内成员的手机号 String[] memberPhone = getMemberPhonesByRoleId(normalTask.getExecutorRole()); if(memberPhone.length != 0){ message.appendMentionedMobileList(memberPhone); } - RobotUtil.set(message); + RobotUtil.setRobotMessage(message); + + MessageVo.Inform inform = MessageVo.changeTask(currentUserId, userName, normalTask.getProjectId(), normalTask.getProjectName(), normalTask.getName(), normalTask.getExecutorRoleName()); + RobotUtil.setInform(inform); } + @Override - public void addDeliverRobotSend(Long currentUserId, String deliverName, Long subTimeId) throws Exception { + public void addDeliverRobotSend(Long currentUserId, String deliverName, Long subTimeId,SysProject project) throws Exception { String userName = userService.getUserNameByUserId(currentUserId); String projectName = ""; ProTaskSubTime proTaskSubTime = taskSubTimeDao.selectByPrimaryKey(subTimeId); @@ -230,19 +256,26 @@ public class RobotService implements IRobotService{ if(ObjectUtil.isNull(taskDetail)){ throw new BaseException(CodeEnum.NOT_TASK); } - SysProject project = sysProjectDao.selectByPrimaryKey(taskDetail.getProjectId()); + if(ObjectUtil.isNotNull(project)){ projectName = project.getName(); } //生成消息 RobotUtil.Message message = new RobotUtil.Message(project.getId()); - message.appendParams(userName,projectName,taskDetail.getName(),deliverName); + message.appendParams( + new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName), + new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, projectName), + new MessageVo.Message(WebConstant.TemplateParam.TaskName.value, taskDetail.getName()), + new MessageVo.Message(WebConstant.TemplateParam.Deliverable.value, deliverName)); //获取角色内成员的手机号 String[] memberPhone = getMemberPhonesByRoleId(taskDetail.getExecutorRole()); if(memberPhone.length != 0){ message.appendMentionedMobileList(memberPhone); } - RobotUtil.set(message); + RobotUtil.setRobotMessage(message); + // 添加消息通知 + MessageVo.Inform inform = MessageVo.addDeliver(currentUserId, userName, taskDetail.getProjectId(), projectName, taskDetail.getName(),deliverName); + RobotUtil.setInform(inform); } @Override @@ -263,13 +296,20 @@ public class RobotService implements IRobotService{ } //生成消息 RobotUtil.Message message = new RobotUtil.Message(project.getId()); - message.appendParams(userName,projectName,taskDetail.getName(),deliverName); + message.appendParams( + new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName), + new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, projectName), + new MessageVo.Message(WebConstant.TemplateParam.TaskName.value, taskDetail.getName()), + new MessageVo.Message(WebConstant.TemplateParam.Deliverable.value, deliverName)); //获取角色内成员的手机号 String[] memberPhone = getMemberPhonesByRoleId(taskDetail.getExecutorRole()); if(memberPhone.length != 0){ message.appendMentionedMobileList(memberPhone); } - RobotUtil.set(message); + RobotUtil.setRobotMessage(message); + + MessageVo.Inform inform = MessageVo.deleteDeliver(currentUserId, userName, project.getId(), project.getName(), taskDetail.getName(), deliverName); + RobotUtil.setInform(inform); } @Override @@ -286,13 +326,23 @@ public class RobotService implements IRobotService{ } //生成消息 RobotUtil.Message message = new RobotUtil.Message(project.getId()); - message.appendParams(userName,uploadUserName,projectName,task.getName(),deliverName); + message.appendParams( + new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName), + new MessageVo.Message(WebConstant.TemplateParam.Principal.value, uploadUserName), + new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, projectName), + new MessageVo.Message(WebConstant.TemplateParam.TaskName.value, task.getName()), + new MessageVo.Message(WebConstant.TemplateParam.Deliverable.value, deliverName)); + + //获取角色内成员的手机号 String[] memberPhone = getMemberPhonesByRoleId(task.getExecutorRole()); if(memberPhone.length != 0){ message.appendMentionedMobileList(memberPhone); } - RobotUtil.set(message); + RobotUtil.setRobotMessage(message); + + MessageVo.Inform inform = MessageVo.checkDeliver(currentUserId, userName, project.getId(), project.getName(), task.getName(), uploadUserName, deliverName); + RobotUtil.setInform(inform); } @Override @@ -305,12 +355,18 @@ public class RobotService implements IRobotService{ } //生成消息 RobotUtil.Message message = new RobotUtil.Message(project.getId()); - message.appendParams(userName,projectName,proTaskDetail.getName()); + message.appendParams( + new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName), + new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, projectName), + new MessageVo.Message(WebConstant.TemplateParam.TaskName.value, proTaskDetail.getName())); //获取角色内成员的手机号 String[] memberPhone = getMemberPhonesByRoleId(proTaskDetail.getExecutorRole()); if(memberPhone.length != 0){ message.appendMentionedMobileList(memberPhone); } - RobotUtil.set(message); + RobotUtil.setRobotMessage(message); + + MessageVo.Inform inform = MessageVo.addComment(userId, userName, project.getId(), project.getName(), proTaskDetail.getName()); + RobotUtil.setInform(inform); } } diff --git a/tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java b/tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java index d8c0942d..3a3fe025 100644 --- a/tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java +++ b/tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java @@ -11,9 +11,11 @@ import com.ccsens.tall.bean.dto.message.DeliverMessageWithDeleteDto; import com.ccsens.tall.bean.dto.message.DeliverMessageWithUploadDto; import com.ccsens.tall.bean.po.*; import com.ccsens.tall.bean.vo.DeliverVo; +import com.ccsens.tall.bean.vo.MessageVo; import com.ccsens.tall.bean.vo.ProjectVo; import com.ccsens.tall.bean.vo.TaskVo; import com.ccsens.tall.persist.dao.*; +import com.ccsens.tall.util.RobotUtil; import com.ccsens.util.*; import com.ccsens.util.bean.message.common.InMessage; import com.ccsens.util.bean.message.common.MessageConstant; @@ -66,6 +68,8 @@ public class TaskDeliverService implements ITaskDeliverService { private AmqpTemplate rabbitTemplate; @Autowired private IRobotService robotService; + @Autowired + private SysProjectDao sysProjectDao; @Override public void saveDeliver(ProTaskDeliver taskDeliver) { @@ -283,7 +287,9 @@ public class TaskDeliverService implements ITaskDeliverService { throw new BaseException(CodeEnum.IS_NOT_EXECUTOR); } //用智能助手发送消息 - robotService.addDeliverRobotSend(currentUserId,d.getName(),subTimeId); + SysProject project = sysProjectDao.selectByPrimaryKey(taskDetail.getProjectId()); + robotService.addDeliverRobotSend(currentUserId,d.getName(),subTimeId, project); + return deliverInfo; } @@ -560,7 +566,7 @@ public class TaskDeliverService implements ITaskDeliverService { //检查完,返回数据 DeliverVo.DeliverInfo deliverInfo = selectDeliverInfo(currentUserId, deliver.getId(), checkDeliver.getTaskId()); - //用智能助手发送消息 + //用智能助手发送消息+ws/公众号发送 robotService.checkDeliverRobotSend(currentUserId,task,uploadUserId,deliver.getName()); return deliverInfo; } diff --git a/tall/src/main/java/com/ccsens/tall/service/TaskSubTimeService.java b/tall/src/main/java/com/ccsens/tall/service/TaskSubTimeService.java index 313df616..9739562e 100644 --- a/tall/src/main/java/com/ccsens/tall/service/TaskSubTimeService.java +++ b/tall/src/main/java/com/ccsens/tall/service/TaskSubTimeService.java @@ -9,6 +9,7 @@ import com.ccsens.tall.bean.dto.TaskDto; import com.ccsens.tall.bean.dto.message.BaseMessageDto; import com.ccsens.tall.bean.dto.message.SyncMessageWithStartDto; import com.ccsens.tall.bean.po.*; +import com.ccsens.tall.bean.vo.MessageVo; import com.ccsens.tall.bean.vo.TaskVo; import com.ccsens.tall.persist.dao.*; @@ -173,6 +174,7 @@ public class TaskSubTimeService implements ITaskSubTimeService { TaskVo.NormalTask normalTask = taskDetailService.getTaskInfoByTaskId(currentUserId,taskDetail.getProjectId(),subTimeId.getId()); //用智能助手发送消息 robotService.finishTaskRobotSend(currentUserId,normalTask.getProjectId(),normalTask.getProjectName(),normalTask.getName(),normalTask.getExecutorRole(),completedStatus); + return normalTask; } @@ -313,6 +315,8 @@ public class TaskSubTimeService implements ITaskSubTimeService { }else { throw new BaseException("项目信息不正确"); } + } else { + throw new BaseException(CodeEnum.PARAM_ERROR); } if(ObjectUtil.isNotNull(addTask.getParentTaskId())){ // ProTaskSubTime subTime = taskSubTimeDao.selectByPrimaryKey(addTask.getParentTaskId()); @@ -409,11 +413,13 @@ public class TaskSubTimeService implements ITaskSubTimeService { } //返回 TaskVo.NormalTask taskDetail = taskDetailDao.selectTaskByTaskId(subTimeId, detail.getId(),detail.getExecutorRole()); + if(ObjectUtil.isNotNull(taskDetail)) { taskDetailService.managePlugin(currentUserId, detail.getExecutorRole(), taskDetail); } //通过智能助手发送通知 robotService.addTaskRobotSend(currentUserId,project,addTask.getTaskName(),addTask.getExecutorId()); + return taskDetail; } diff --git a/tall/src/main/java/com/ccsens/tall/util/RobotUtil.java b/tall/src/main/java/com/ccsens/tall/util/RobotUtil.java index d8c799cb..e81d1064 100644 --- a/tall/src/main/java/com/ccsens/tall/util/RobotUtil.java +++ b/tall/src/main/java/com/ccsens/tall/util/RobotUtil.java @@ -1,5 +1,6 @@ package com.ccsens.tall.util; +import com.ccsens.tall.bean.vo.MessageVo; import lombok.Data; import java.util.ArrayList; @@ -8,6 +9,11 @@ import java.util.List; public class RobotUtil { + /** 机器人推送 */ + private static final ThreadLocal robotThreadLocal = new ThreadLocal(); + /** 消息推送(ws/公众号) */ + private static final ThreadLocal informThreadLocal = new ThreadLocal(); + @Data public static class Message{ private String msgType = "text"; @@ -15,7 +21,7 @@ public class RobotUtil { private List mentionedMobileList = new ArrayList<>(); private boolean isAtAll = false; private Long projectId; - private List params = new ArrayList<>(); + private List params = new ArrayList<>(); public Message(){ } @@ -43,7 +49,7 @@ public class RobotUtil { this.mentionedMobileList.addAll(Arrays.asList(mentionedMobileList)); } - public void appendParams(String... params){ + public void appendParams(MessageVo.Message... params){ if(params == null || params.length == 0){ return; } @@ -52,20 +58,33 @@ public class RobotUtil { } - static final ThreadLocal robotThreadLocal = new ThreadLocal(); - public static Message get() { + + public static Message getRobotMessage() { return robotThreadLocal.get(); } - public static void set(Message message) { + public static void setRobotMessage(Message message) { robotThreadLocal.set(message); } - public static void del() { + public static void delRobotMessage() { robotThreadLocal.remove(); } + public static MessageVo.Inform getInform() { + return informThreadLocal.get(); + } + + public static void setInform(MessageVo.Inform message) { + informThreadLocal.set(message); + } + + public static void delInform() { + informThreadLocal.remove(); + } + + } diff --git a/tall/src/main/java/com/ccsens/tall/web/ProjectMessageController.java b/tall/src/main/java/com/ccsens/tall/web/ProjectMessageController.java new file mode 100644 index 00000000..4f4fdde1 --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/web/ProjectMessageController.java @@ -0,0 +1,74 @@ +package com.ccsens.tall.web; + +import com.ccsens.cloudutil.annotation.MustLogin; +import com.ccsens.tall.bean.dto.ProjectMessageDto; +import com.ccsens.tall.bean.vo.ProjectMessageVo; +import com.ccsens.tall.service.IProjectMessageService; +import com.ccsens.util.CodeEnum; +import com.ccsens.util.JsonResponse; +import com.ccsens.util.bean.dto.QueryDto; +import com.github.pagehelper.PageInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * @description: + * @author: whj + * @time: 2020/5/28 17:12 + */ +@Slf4j +@Api(tags = "项目消息通知" , description = "") +@RestController +@RequestMapping("/projectMessage") +public class ProjectMessageController { + @Resource + private IProjectMessageService projectMessageService; + + + @MustLogin + @ApiOperation(value = "获取未读消息数",notes = "获取未读消息数") + @RequestMapping(value = "queryUnreadNum", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse queryUnreadNum(@RequestBody QueryDto param) { + log.info("未读消息请求参数:{}", param); + ProjectMessageDto.UnreadNum unreadNum = param.getParam(); + ProjectMessageVo.UnreadNum num = projectMessageService.queryUnreadNum(unreadNum.getSendType(), param.getUserId()); + log.info("未读消息返回结果:{}", num); + return JsonResponse.newInstance().ok(num); + } + + + @MustLogin + @ApiOperation(value = "分页查询未读消息",notes = "分页查询未读消息") + @RequestMapping(value = "queryMsg", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse queryMsg(@RequestBody QueryDto param) { + log.info("未读消息请求参数:{}", param); + PageInfo messages = projectMessageService.queryMsg(param.getParam(), param.getUserId()); + log.info("未读消息返回结果:{}", messages); + return JsonResponse.newInstance().ok(messages); + } + + @MustLogin + @ApiOperation(value = "标记某条消息已读",notes = "标记某条消息已读") + @RequestMapping(value = "markRead", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse markRead(@RequestBody QueryDto param) { + log.info("未读消息请求参数:{}", param); + CodeEnum codeEnum = projectMessageService.markRead(param.getParam(), param.getUserId()); + log.info("未读消息返回结果:{}", codeEnum); + return JsonResponse.newInstance().ok(codeEnum); + } + + @MustLogin + @ApiOperation(value = "标记全部消息已读",notes = "标记全部消息已读") + @RequestMapping(value = "markAllRead", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse markAllRead(@RequestBody QueryDto param) { + log.info("未读消息请求参数:{}", param); + CodeEnum codeEnum = projectMessageService.markAllRead(param.getParam(), param.getUserId()); + log.info("未读消息返回结果:{}", codeEnum); + return JsonResponse.newInstance().ok(codeEnum); + } + +} diff --git a/tall/src/main/resources/mapper_dao/ProMemberDao.xml b/tall/src/main/resources/mapper_dao/ProMemberDao.xml index c6040326..18bdc748 100644 --- a/tall/src/main/resources/mapper_dao/ProMemberDao.xml +++ b/tall/src/main/resources/mapper_dao/ProMemberDao.xml @@ -121,5 +121,13 @@ ) t on pm.id = t.stakeholderId + \ No newline at end of file diff --git a/tall/src/main/resources/mapper_dao/SysMessageSendDao.xml b/tall/src/main/resources/mapper_dao/SysMessageSendDao.xml new file mode 100644 index 00000000..eb7c621a --- /dev/null +++ b/tall/src/main/resources/mapper_dao/SysMessageSendDao.xml @@ -0,0 +1,40 @@ + + + + + + + UPDATE t_sys_message_send + SET read_status = 1, + init_read = 1 + WHERE + id = #{id} + AND rec_status = 0 + + + UPDATE t_sys_message_send + SET read_status = 1 + WHERE + operation_id = #{operationId} + AND receiver_id = #{receiverId} + AND read_status = 0 + AND rec_status = 0 + + + UPDATE t_sys_message_send + SET read_status = 1 , init_read = 1 + WHERE + receiver_id = #{receiverId} + AND send_type = #{sendType} + AND read_status = 0 + AND rec_status = 0 + + + UPDATE t_sys_message_send + SET read_status = 1 + WHERE + receiver_id = #{receiverId} + AND read_status = 0 + AND rec_status = 0 + + \ No newline at end of file diff --git a/tall/src/main/resources/mapper_dao/SysOperationDao.xml b/tall/src/main/resources/mapper_dao/SysOperationDao.xml new file mode 100644 index 00000000..7babf37c --- /dev/null +++ b/tall/src/main/resources/mapper_dao/SysOperationDao.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tall/src/main/resources/mapper_dao/SysUserDao.xml b/tall/src/main/resources/mapper_dao/SysUserDao.xml index 2a575dcb..af17504a 100644 --- a/tall/src/main/resources/mapper_dao/SysUserDao.xml +++ b/tall/src/main/resources/mapper_dao/SysUserDao.xml @@ -80,5 +80,6 @@ a.rec_status = 0 and u.id = #{userId} + limit 1 \ No newline at end of file diff --git a/tall/src/main/resources/mapper_raw/SysMessageSendMapper.xml b/tall/src/main/resources/mapper_raw/SysMessageSendMapper.xml new file mode 100644 index 00000000..04da5564 --- /dev/null +++ b/tall/src/main/resources/mapper_raw/SysMessageSendMapper.xml @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, operation_id, receiver_id, send_type, send_status, read_status, init_read, send_time, + complete, created_at, updated_at, rec_status + + + + + delete from t_sys_message_send + where id = #{id,jdbcType=BIGINT} + + + delete from t_sys_message_send + + + + + + insert into t_sys_message_send (id, operation_id, receiver_id, + send_type, send_status, read_status, + init_read, send_time, complete, + created_at, updated_at, rec_status + ) + values (#{id,jdbcType=BIGINT}, #{operationId,jdbcType=BIGINT}, #{receiverId,jdbcType=BIGINT}, + #{sendType,jdbcType=TINYINT}, #{sendStatus,jdbcType=TINYINT}, #{readStatus,jdbcType=TINYINT}, + #{initRead,jdbcType=TINYINT}, #{sendTime,jdbcType=BIGINT}, #{complete,jdbcType=TINYINT}, + #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} + ) + + + insert into t_sys_message_send + + + id, + + + operation_id, + + + receiver_id, + + + send_type, + + + send_status, + + + read_status, + + + init_read, + + + send_time, + + + complete, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{operationId,jdbcType=BIGINT}, + + + #{receiverId,jdbcType=BIGINT}, + + + #{sendType,jdbcType=TINYINT}, + + + #{sendStatus,jdbcType=TINYINT}, + + + #{readStatus,jdbcType=TINYINT}, + + + #{initRead,jdbcType=TINYINT}, + + + #{sendTime,jdbcType=BIGINT}, + + + #{complete,jdbcType=TINYINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_sys_message_send + + + id = #{record.id,jdbcType=BIGINT}, + + + operation_id = #{record.operationId,jdbcType=BIGINT}, + + + receiver_id = #{record.receiverId,jdbcType=BIGINT}, + + + send_type = #{record.sendType,jdbcType=TINYINT}, + + + send_status = #{record.sendStatus,jdbcType=TINYINT}, + + + read_status = #{record.readStatus,jdbcType=TINYINT}, + + + init_read = #{record.initRead,jdbcType=TINYINT}, + + + send_time = #{record.sendTime,jdbcType=BIGINT}, + + + complete = #{record.complete,jdbcType=TINYINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_sys_message_send + set id = #{record.id,jdbcType=BIGINT}, + operation_id = #{record.operationId,jdbcType=BIGINT}, + receiver_id = #{record.receiverId,jdbcType=BIGINT}, + send_type = #{record.sendType,jdbcType=TINYINT}, + send_status = #{record.sendStatus,jdbcType=TINYINT}, + read_status = #{record.readStatus,jdbcType=TINYINT}, + init_read = #{record.initRead,jdbcType=TINYINT}, + send_time = #{record.sendTime,jdbcType=BIGINT}, + complete = #{record.complete,jdbcType=TINYINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_sys_message_send + + + operation_id = #{operationId,jdbcType=BIGINT}, + + + receiver_id = #{receiverId,jdbcType=BIGINT}, + + + send_type = #{sendType,jdbcType=TINYINT}, + + + send_status = #{sendStatus,jdbcType=TINYINT}, + + + read_status = #{readStatus,jdbcType=TINYINT}, + + + init_read = #{initRead,jdbcType=TINYINT}, + + + send_time = #{sendTime,jdbcType=BIGINT}, + + + complete = #{complete,jdbcType=TINYINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_sys_message_send + set operation_id = #{operationId,jdbcType=BIGINT}, + receiver_id = #{receiverId,jdbcType=BIGINT}, + send_type = #{sendType,jdbcType=TINYINT}, + send_status = #{sendStatus,jdbcType=TINYINT}, + read_status = #{readStatus,jdbcType=TINYINT}, + init_read = #{initRead,jdbcType=TINYINT}, + send_time = #{sendTime,jdbcType=BIGINT}, + complete = #{complete,jdbcType=TINYINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/tall/src/main/resources/mapper_raw/SysOperationMapper.xml b/tall/src/main/resources/mapper_raw/SysOperationMapper.xml new file mode 100644 index 00000000..bc28230a --- /dev/null +++ b/tall/src/main/resources/mapper_raw/SysOperationMapper.xml @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, operator_id, project_id, operate_type, operation_time, created_at, updated_at, + rec_status + + + + + delete from t_sys_operation + where id = #{id,jdbcType=BIGINT} + + + delete from t_sys_operation + + + + + + insert into t_sys_operation (id, operator_id, project_id, + operate_type, operation_time, created_at, + updated_at, rec_status) + values (#{id,jdbcType=BIGINT}, #{operatorId,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, + #{operateType,jdbcType=TINYINT}, #{operationTime,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, + #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) + + + insert into t_sys_operation + + + id, + + + operator_id, + + + project_id, + + + operate_type, + + + operation_time, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{operatorId,jdbcType=BIGINT}, + + + #{projectId,jdbcType=BIGINT}, + + + #{operateType,jdbcType=TINYINT}, + + + #{operationTime,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_sys_operation + + + id = #{record.id,jdbcType=BIGINT}, + + + operator_id = #{record.operatorId,jdbcType=BIGINT}, + + + project_id = #{record.projectId,jdbcType=BIGINT}, + + + operate_type = #{record.operateType,jdbcType=TINYINT}, + + + operation_time = #{record.operationTime,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_sys_operation + set id = #{record.id,jdbcType=BIGINT}, + operator_id = #{record.operatorId,jdbcType=BIGINT}, + project_id = #{record.projectId,jdbcType=BIGINT}, + operate_type = #{record.operateType,jdbcType=TINYINT}, + operation_time = #{record.operationTime,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_sys_operation + + + operator_id = #{operatorId,jdbcType=BIGINT}, + + + project_id = #{projectId,jdbcType=BIGINT}, + + + operate_type = #{operateType,jdbcType=TINYINT}, + + + operation_time = #{operationTime,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_sys_operation + set operator_id = #{operatorId,jdbcType=BIGINT}, + project_id = #{projectId,jdbcType=BIGINT}, + operate_type = #{operateType,jdbcType=TINYINT}, + operation_time = #{operationTime,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/tall/src/main/resources/mapper_raw/SysOperationMessageMapper.xml b/tall/src/main/resources/mapper_raw/SysOperationMessageMapper.xml new file mode 100644 index 00000000..9750fbaf --- /dev/null +++ b/tall/src/main/resources/mapper_raw/SysOperationMessageMapper.xml @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, operation_id, content, type, settings, sort, created_at, updated_at, rec_status + + + + + delete from t_sys_operation_message + where id = #{id,jdbcType=BIGINT} + + + delete from t_sys_operation_message + + + + + + insert into t_sys_operation_message (id, operation_id, content, + type, settings, sort, + created_at, updated_at, rec_status + ) + values (#{id,jdbcType=BIGINT}, #{operationId,jdbcType=BIGINT}, #{content,jdbcType=VARCHAR}, + #{type,jdbcType=TINYINT}, #{settings,jdbcType=VARCHAR}, #{sort,jdbcType=TINYINT}, + #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} + ) + + + insert into t_sys_operation_message + + + id, + + + operation_id, + + + content, + + + type, + + + settings, + + + sort, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{operationId,jdbcType=BIGINT}, + + + #{content,jdbcType=VARCHAR}, + + + #{type,jdbcType=TINYINT}, + + + #{settings,jdbcType=VARCHAR}, + + + #{sort,jdbcType=TINYINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_sys_operation_message + + + id = #{record.id,jdbcType=BIGINT}, + + + operation_id = #{record.operationId,jdbcType=BIGINT}, + + + content = #{record.content,jdbcType=VARCHAR}, + + + type = #{record.type,jdbcType=TINYINT}, + + + settings = #{record.settings,jdbcType=VARCHAR}, + + + sort = #{record.sort,jdbcType=TINYINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_sys_operation_message + set id = #{record.id,jdbcType=BIGINT}, + operation_id = #{record.operationId,jdbcType=BIGINT}, + content = #{record.content,jdbcType=VARCHAR}, + type = #{record.type,jdbcType=TINYINT}, + settings = #{record.settings,jdbcType=VARCHAR}, + sort = #{record.sort,jdbcType=TINYINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_sys_operation_message + + + operation_id = #{operationId,jdbcType=BIGINT}, + + + content = #{content,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=TINYINT}, + + + settings = #{settings,jdbcType=VARCHAR}, + + + sort = #{sort,jdbcType=TINYINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_sys_operation_message + set operation_id = #{operationId,jdbcType=BIGINT}, + content = #{content,jdbcType=VARCHAR}, + type = #{type,jdbcType=TINYINT}, + settings = #{settings,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=TINYINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/util/src/main/java/com/ccsens/util/WebConstant.java b/util/src/main/java/com/ccsens/util/WebConstant.java index 8fe76f0e..7c45fd60 100644 --- a/util/src/main/java/com/ccsens/util/WebConstant.java +++ b/util/src/main/java/com/ccsens/util/WebConstant.java @@ -3,6 +3,7 @@ package com.ccsens.util; import cn.hutool.core.codec.Base64; import java.io.File; +import java.util.Arrays; public class WebConstant { @@ -12,6 +13,44 @@ public class WebConstant { /**数据已删除*/ public static final byte STATUS_DELETE = 1; + public static enum TemplateParam { + + Operator("{{operator}}", "操作者"), + ProjectName("{{projectName}}", "项目名"), + TaskName("{{taskName}}", "任务名"), + Deliverable("{{deliverable}}", "交付物"), + Operate("{{operate}}", "操作"), + Principal("{{principal}}", "负责人"), + ; + + public String value; + public String phase; + + private TemplateParam(String value, String phase) { + this.value = value; + this.phase = phase; + } + } + + public static final class Message{ + public static final byte TYPE_TEXT = 0; + public static final byte TYPE_LINK = 1; + public static final byte SEND_WS = 0; + public static final byte SEND_WX_OFFICIAL = 1; + public static final byte SEND_SUCCESS = 1; + public static final byte SEND_FAIL = 0; + } + + public static final class Project{ + public static final String PROJECT_ID = "projectId"; + public static final byte TASK_COMPLETE_YES = 2; + + + public static final String getTaskCompleteStatus(byte completedStatus) { + return completedStatus == WebConstant.Project.TASK_COMPLETE_YES ? "完成" : "取消完成"; + } + } + public static final class Wx { public static final String ACCESS_TOKEN = "tall_wx_access_token"; public static final long EXPIRE_TIME = 1 * 60 * 60; diff --git a/util/src/main/java/com/ccsens/util/bean/message/common/InMessage.java b/util/src/main/java/com/ccsens/util/bean/message/common/InMessage.java index c4d3cdc6..f1babf46 100644 --- a/util/src/main/java/com/ccsens/util/bean/message/common/InMessage.java +++ b/util/src/main/java/com/ccsens/util/bean/message/common/InMessage.java @@ -1,11 +1,16 @@ package com.ccsens.util.bean.message.common; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONObject; import com.ccsens.util.JacksonUtil; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; +import io.swagger.annotations.ApiModel; import lombok.Data; +import java.util.HashSet; +import java.util.List; import java.util.Set; /** @@ -92,4 +97,37 @@ public class InMessage { //TODO //添加方便链式调用的构造方法,类似builder + + + + @Data + @ApiModel("接收消息者") + public static class To{ + private Long id; + + public To() { + } + public To(Long id) { + this.id = id; + } + + } + + /** + * 将userids列表转成tos格式 + * @param userIds + * @return + */ + public static Set transTos(List userIds) { + + Set sets = new HashSet<>(); + if (CollectionUtil.isEmpty(userIds)) { + return sets; + } + userIds.forEach(userId -> { + To to = new To(userId); + sets.add(JSONObject.toJSONString(to)); + }); + return sets; + } } diff --git a/util/src/main/java/com/ccsens/util/config/RabbitMQConfig.java b/util/src/main/java/com/ccsens/util/config/RabbitMQConfig.java index 9ccda900..5b17417a 100644 --- a/util/src/main/java/com/ccsens/util/config/RabbitMQConfig.java +++ b/util/src/main/java/com/ccsens/util/config/RabbitMQConfig.java @@ -16,6 +16,10 @@ public class RabbitMQConfig { public static final String GAME_STATUS_DELAY_SEND_QUEUE = "gameStatusDelaySendQueue"; public static final String GAME_STATUS_DELAY_SEND_EXCHANGE = "gameStatusDelaySendExchange"; public static final String GAME_STATUS_DELAY_SEND_ROUTING_KEY = "gameStatusDelaySendRoutingKey"; + /**消息队列发送*/ + public static final String MESSAGE_QUEUE_NAME = "tall_message_1"; + + @Bean public Queue queue_game (){ diff --git a/util/src/main/java/com/ccsens/util/wx/WxRobotUtil.java b/util/src/main/java/com/ccsens/util/wx/WxRobotUtil.java index 5cdb0dfb..409debe2 100644 --- a/util/src/main/java/com/ccsens/util/wx/WxRobotUtil.java +++ b/util/src/main/java/com/ccsens/util/wx/WxRobotUtil.java @@ -22,13 +22,13 @@ public class WxRobotUtil { } @Data public static class WxRobotText{ - private StringBuilder content; + private String content; private List mentioned_list; private List mentioned_mobile_list; } @Data public static class WxRobotMarkdown{ - private StringBuilder content; + private String content; } @@ -74,7 +74,7 @@ public class WxRobotUtil { } } - public static void sendRobotInfo(String webHook,StringBuilder content,String msgType,List mentionedList,List mentionedMobileList)throws Exception { + public static void sendRobotInfo(String webHook,String content,String msgType,List mentionedList,List mentionedMobileList)throws Exception { WxRobotVo wxRobotVo = new WxRobotVo(); wxRobotVo.setMsgtype(msgType); if("text".equalsIgnoreCase(msgType)){ From 07f94f75d84592468786035a341085dbb4cc687e Mon Sep 17 00:00:00 2001 From: zhizhi wu <2377881365@qq.com> Date: Tue, 2 Jun 2020 15:30:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tall/bean/dto/ProjectMessageDto.java | 10 ++++++---- .../ccsens/tall/bean/vo/ProjectMessageVo.java | 4 ++-- .../tall/persist/dao/SysOperationDao.java | 5 +++-- .../tall/service/ProjectMessageService.java | 2 +- .../com/ccsens/tall/service/UserService.java | 2 +- .../tall/web/ProjectMessageController.java | 2 +- .../resources/mapper_dao/SysOperationDao.xml | 18 ++++++++++++------ 7 files changed, 26 insertions(+), 17 deletions(-) diff --git a/tall/src/main/java/com/ccsens/tall/bean/dto/ProjectMessageDto.java b/tall/src/main/java/com/ccsens/tall/bean/dto/ProjectMessageDto.java index 0ce25af9..ef9fb0cc 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/dto/ProjectMessageDto.java +++ b/tall/src/main/java/com/ccsens/tall/bean/dto/ProjectMessageDto.java @@ -17,7 +17,7 @@ import javax.validation.constraints.NotNull; public class ProjectMessageDto { @Data - @ApiModel("查询未读消息数") + @ApiModel("查询未读消息数-请求") public static class UnreadNum{ @NotNull @ApiModelProperty("发送类型 0:ws,1:微信公众号") @@ -25,11 +25,13 @@ public class ProjectMessageDto { } @Data - @ApiModel("查询未读消息") + @ApiModel("查询消息-请求") public static class Query{ @NotNull @ApiModelProperty("发送类型 0:ws,1:微信公众号") private Byte sendType; + @ApiModelProperty("项目ID") + private Long projectId; @ApiModelProperty("第几页") @Min(value = 1) private int pageNum = 1; @@ -40,7 +42,7 @@ public class ProjectMessageDto { } @Data - @ApiModel("查询未读消息") + @ApiModel("标记某条消息已读-请求") public static class MarkRead{ @NotNull(message="发送消息ID不能为空") @ApiModelProperty("发送消息ID") @@ -48,7 +50,7 @@ public class ProjectMessageDto { } @Data - @ApiModel("查询未读消息") + @ApiModel("标记所有消息已读-请求") public static class MarkAllRead{ @NotNull @ApiModelProperty("消息发送类型 0:ws,1:微信公众号") diff --git a/tall/src/main/java/com/ccsens/tall/bean/vo/ProjectMessageVo.java b/tall/src/main/java/com/ccsens/tall/bean/vo/ProjectMessageVo.java index deaa8f99..5e4fee11 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/vo/ProjectMessageVo.java +++ b/tall/src/main/java/com/ccsens/tall/bean/vo/ProjectMessageVo.java @@ -18,14 +18,14 @@ import java.util.List; @ApiModel("未读消息相关返回结果") public class ProjectMessageVo { @Data - @ApiModel("未读消息数") + @ApiModel("未读消息数-返回") public static class UnreadNum{ @ApiModelProperty("发送类型 0:ws,1:微信公众号") private Integer unreadNum; } @Data - @ApiModel("未读消息") + @ApiModel("未读消息-返回") @JsonIgnoreProperties(value = { "handler" }) public static class Query{ @ApiModelProperty("发送消息ID") diff --git a/tall/src/main/java/com/ccsens/tall/persist/dao/SysOperationDao.java b/tall/src/main/java/com/ccsens/tall/persist/dao/SysOperationDao.java index 7a6b446f..64c9a923 100644 --- a/tall/src/main/java/com/ccsens/tall/persist/dao/SysOperationDao.java +++ b/tall/src/main/java/com/ccsens/tall/persist/dao/SysOperationDao.java @@ -1,5 +1,6 @@ package com.ccsens.tall.persist.dao; +import com.ccsens.tall.bean.dto.ProjectMessageDto; import com.ccsens.tall.bean.vo.MessageVo; import com.ccsens.tall.bean.vo.ProjectMessageVo; import com.ccsens.tall.persist.mapper.SysOperationMapper; @@ -19,11 +20,11 @@ public interface SysOperationDao extends SysOperationMapper { /** * 查询消息 - * @param sendType + * @param param * @param userId * @return */ - List queryMsg(@Param("sendType")Byte sendType, @Param("userId")Long userId); + List queryMsg(@Param("param") ProjectMessageDto.Query param, @Param("userId")Long userId); /** * 查询消息的具体内容 diff --git a/tall/src/main/java/com/ccsens/tall/service/ProjectMessageService.java b/tall/src/main/java/com/ccsens/tall/service/ProjectMessageService.java index d0f0e9ab..a4820137 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ProjectMessageService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ProjectMessageService.java @@ -240,7 +240,7 @@ public class ProjectMessageService implements IProjectMessageService { @Override public PageInfo queryMsg(ProjectMessageDto.Query param, Long userId) { PageHelper.startPage(param.getPageNum(), param.getPageSize()); - List list = sysOperationDao.queryMsg(param.getSendType(), userId); + List list = sysOperationDao.queryMsg(param, userId); return new PageInfo<>(list); } diff --git a/tall/src/main/java/com/ccsens/tall/service/UserService.java b/tall/src/main/java/com/ccsens/tall/service/UserService.java index daca9f61..f5a9296c 100644 --- a/tall/src/main/java/com/ccsens/tall/service/UserService.java +++ b/tall/src/main/java/com/ccsens/tall/service/UserService.java @@ -246,7 +246,7 @@ public class UserService implements IUserService { if (ObjectUtil.isNotNull(wxOauth2UserInfo)) { SysAuthExample authExample = new SysAuthExample(); authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.OAUTH2_Wx.value) - .andIdentifierEqualTo(wxOauth2UserInfo.getOpenId()); + .andIdentifierEqualTo(wxOauth2UserInfo.getOpenId()).andCredentialEqualTo(wxOauth2UserInfo.getUnionId()); List authList = authDao.selectByExample(authExample); if (CollectionUtil.isNotEmpty(authList)) { theAuth = authList.get(0); diff --git a/tall/src/main/java/com/ccsens/tall/web/ProjectMessageController.java b/tall/src/main/java/com/ccsens/tall/web/ProjectMessageController.java index 4f4fdde1..aa4ba858 100644 --- a/tall/src/main/java/com/ccsens/tall/web/ProjectMessageController.java +++ b/tall/src/main/java/com/ccsens/tall/web/ProjectMessageController.java @@ -42,7 +42,7 @@ public class ProjectMessageController { @MustLogin - @ApiOperation(value = "分页查询未读消息",notes = "分页查询未读消息") + @ApiOperation(value = "分页查询消息",notes = "分页查询消息") @RequestMapping(value = "queryMsg", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse queryMsg(@RequestBody QueryDto param) { log.info("未读消息请求参数:{}", param); diff --git a/tall/src/main/resources/mapper_dao/SysOperationDao.xml b/tall/src/main/resources/mapper_dao/SysOperationDao.xml index 7babf37c..e154dcdd 100644 --- a/tall/src/main/resources/mapper_dao/SysOperationDao.xml +++ b/tall/src/main/resources/mapper_dao/SysOperationDao.xml @@ -32,15 +32,21 @@