From e36993eb771515c17a468eec1845e715ef434d17 Mon Sep 17 00:00:00 2001 From: caojianbin <1910336823> Date: Wed, 27 Mar 2024 16:54:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E5=9B=BD=E9=99=85=E5=8C=96,?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=A8=A1=E5=9D=97=E9=83=A8=E5=88=86=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/system/entity/PositioningModelInfo.java | 69 ++++++ .../issue/callback/CustomMessageCallback.java | 30 +++ .../common/issue/constant/CommonConstant.java | 147 +++++++++++++ .../common/issue/entity/AlarmClockDto.java | 15 ++ .../common/issue/entity/AlarmClockSecond.java | 14 ++ .../common/issue/entity/BootOff.java | 14 ++ .../issue/entity/ChatGroupDisbandMessageInfo.java | 20 ++ .../common/issue/entity/DeviceDisabledAppDto.java | 15 ++ .../issue/entity/DeviceDisabledInnerAppDto.java | 15 ++ .../common/issue/entity/DistributeParent.java | 22 ++ .../common/issue/issue/IssueInstructions.java | 234 +++++++++++++++++++++ .../security/annotation/EnableCustomConfig.java | 2 +- .../system/EcellSystemApplication.java | 24 +++ .../controller/ActivityBannerController.java | 126 +++++++++++ .../system/controller/ActivityController.java | 32 +-- .../controller/ActivitySearchController.java | 24 +-- .../internationalize/system/entity/Advert.java | 124 +++++++++++ .../system/service/ActivitySearchService.java | 26 +++ .../system/service/ActivityService.java | 34 +++ .../service/impl/ActivitySearchServiceImpl.java | 40 ++++ .../system/service/impl/ActivityServiceImpl.java | 76 +++++++ .../system/mapper/ActivitySearchMapper.xml | 22 ++ 22 files changed, 1096 insertions(+), 29 deletions(-) create mode 100644 ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/callback/CustomMessageCallback.java create mode 100644 ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/constant/CommonConstant.java create mode 100644 ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/AlarmClockDto.java create mode 100644 ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/AlarmClockSecond.java create mode 100644 ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/BootOff.java create mode 100644 ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/ChatGroupDisbandMessageInfo.java create mode 100644 ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/DeviceDisabledAppDto.java create mode 100644 ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/DeviceDisabledInnerAppDto.java create mode 100644 ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/DistributeParent.java create mode 100644 ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/issue/IssueInstructions.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/EcellSystemApplication.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivityBannerController.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/Advert.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/ActivitySearchService.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/ActivityService.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/ActivitySearchServiceImpl.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/ActivityServiceImpl.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/ActivitySearchMapper.xml diff --git a/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/PositioningModelInfo.java b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/PositioningModelInfo.java index 9ff60e0..fa18757 100644 --- a/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/PositioningModelInfo.java +++ b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/PositioningModelInfo.java @@ -1,9 +1,78 @@ package com.ecell.internationalize.common.system.entity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; +import java.util.Date; /** * @author borui */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="PositioningModelInfo对象", description="定位模式信息表") public class PositioningModelInfo implements Serializable { + private static final long serialVersionUID=1L; + + @ApiModelProperty(value = "定位模式id") + @TableId(value ="positioning_mode_id",type = IdType.INPUT) + private String positioningModeId; + + @NotEmpty(message = "定位模式1名称不能为空") + @ApiModelProperty(value = "定位模式1名称(正常模式)") + private String modelOneName; + + @Min(1) + @ApiModelProperty(value = "定位模式1间隔(单位分钟)") + private Integer positioningOneInterva; + + @NotEmpty(message = "定位模式2名称不能为空") + @ApiModelProperty(value = "定位模式2名称(省电模式)") + private String modelTwoName; + + @Min(1) + @ApiModelProperty(value = "定位模式2间隔(单位分钟)") + private Integer positioningTwoInterva; + + @NotEmpty(message = "定位模式3名称不能为空") + @ApiModelProperty(value = "定位模式3名称(高频模式)") + private String modelThreeName; + + @Min(1) + @ApiModelProperty(value = "定位模式3间隔(单位分钟)") + private Integer positioningThreeInterva; + + @ApiModelProperty(value = "创建人") + @TableField(value = "create_user",fill = FieldFill.INSERT) + private String createUser; + + @ApiModelProperty(value = "修改人") + @TableField(value = "update_user",fill = FieldFill.UPDATE) + private String updateUser; + + @TableField(value = "create_time",fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "默认值(0.代表默认,默认数据不可以修改)") + private String defaultValue; + } diff --git a/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/callback/CustomMessageCallback.java b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/callback/CustomMessageCallback.java new file mode 100644 index 0000000..ae2e9f3 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/callback/CustomMessageCallback.java @@ -0,0 +1,30 @@ +package com.ecell.internationalize.common.issue.callback; + +import com.ecell.internationalize.common.issue.mqtt.AppSingleMqttClient; +import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken; +import org.eclipse.paho.client.mqttv3.MqttCallback; +import org.eclipse.paho.client.mqttv3.MqttMessage; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author borui + */ +public class CustomMessageCallback implements MqttCallback { + private static final Logger logger = LoggerFactory.getLogger(CustomMessageCallback.class); + @Override + public void connectionLost(Throwable throwable) { + logger.info("进行重新连接"); + AppSingleMqttClient.reconnection(); + } + + @Override + public void messageArrived(String s, MqttMessage mqttMessage) throws Exception { + + } + + @Override + public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) { + + } +} diff --git a/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/constant/CommonConstant.java b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/constant/CommonConstant.java new file mode 100644 index 0000000..f5f8655 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/constant/CommonConstant.java @@ -0,0 +1,147 @@ +package com.ecell.internationalize.common.issue.constant; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author borui + */ +public class CommonConstant { + public static final String AUDIT_STATUS_ZERO="0"; + public static final String AUDIT_STATUS_ONE="1"; + public static final String AUDIT_STATUS_TWO="2"; + public static final String AUDIT_STATUS_THREE="3"; + public static final String AUDIT_STATUS_FOUR="4"; + public static final String AUDIT_STATUS_FIVE="5"; + public static final Integer AUDIT_STATUS_AND=240; + public static final int NUMBER_ZERO=0; + public static final int NUMBER_ONE=1; + public static final int NUMBER_TWO=2; + public static final int NUMBER_THREE=3; + public static final int NUMBER_FOUR=4; + public static final int NUMBER_FIVE=5; + public static final int PRE_NUMBER_FOUR=-4; + public static final int PRE_NUMBER_FIVE=-5; + public static final String BINDING_STATUS="binding_status"; + public static final String ADMIN_EMAIL="admin_email"; + public static final String ADMIN_PHONE="admin_phone"; + public static final String DEVICE_TYPE="device_type"; + + public static final String PHONE="phone"; + + public static final String MESSAGE_CODE="code"; + public static final String MESSAGE_INFO_SIX="666"; + public static final String MESSAGE_INFO_TWO="200"; + + public static final String SOUND="default"; + public static final String ANDROID="Android"; + public static final String IOS="iOS"; + public static final String CN="CN"; + public static final String US="US"; + + /**type常量**/ + public static final String LOCATION_TYPE="location"; + public static final String TYPE="type"; + public static final String IOS_PUSH_KAFKA="jianyou_tongxin_PUSH"; + + /**TCP-TOPIC*/ + public static final String WATCHPUSH_KAFKA="jianyou_tongxin_WatchPUSH_Kafka"; + /** 视频类型为声网*/ + public static final String VIDEO_TYPE_TWO="SW"; + /** 视频类型为菊风*/ + public static final String VIDEO_TYPE_ONE="JF"; + /** 视频类型为佰锐*/ + public static final String VIDEO_TYPE_THREE="BR"; + /** 视频类型为鹈鹕*/ + public static final String VIDEO_TYPE_FOUR="TH"; + /** 视频类型不支持*/ + public static final String VIDEO_TYPE_ZERO="0"; + + public static final int VIDEO_RESULT_PRE_ONE=-1; + public static final int VIDEO_RESULT_PRE_TWO=-2; + public static final int VIDEO_RESULT_PRE_THREE=-3; + public static final Map VIDEO_TYPE_MAP = new HashMap<>(); + static { + VIDEO_TYPE_MAP.put("0", "0"); + VIDEO_TYPE_MAP.put("1", "JF"); + VIDEO_TYPE_MAP.put("2", "SW"); + VIDEO_TYPE_MAP.put("3", "BR"); + VIDEO_TYPE_MAP.put("4", "TH"); + } + public static final String DOWN_VIDEO_CALL_WITH_WATCH="downVideoCallWithWatch"; + public static final String UP_VIDEO_CALL_WITH_APP="upVideoCallWithAPP"; + /** 分辨率 宽 * 高 */ + public static final String DISPLAY_RESOLUTION="120*160"; + + /** 单次通话时长/秒 手表小热的等待时间(秒)*/ + public static final Integer ONE_CALL_TIME=15*60; + + /** 等待时长*/ + public static final Integer WAIT_TIME=60; + + /** 通话间隔/秒 菊风视频的不启用限制的 间隔总分钟数 (超过该分钟数就不启用限制,并清除之前的限制)(秒)*/ + public static final Integer CALL_INTERVAL=3*60; + + /**总视频时长/秒 菊风视频的启用限制的 视频通话总分钟数 最近视频通话累计时间 /秒 默认*/ + public static final Integer ALL_CALL_TIME=10*60; + /** 菊风视频Key */ + public static final String JF_VIDEO_KEY = "28012fd8eee097ab30ca5096"; + /** 鹈鹕视频Key */ + public static final String TH_VIDEO_KEY = "UkM4Q8mk3BeKEtbt"; + /** 佰锐视频Key */ + public static final String BR_VIDEO_KEY = "A3BEE84E-9C7A-D848-85D3-90F233D9A022"; + /** 声网视频Key*/ + public static final String SW_VIDEO_KEY = "f692ba8aa8b941afa9421d10a5f7b929"; + public static final String SW_CUSTOMER_ID = "去声网申请"; + public static final String SW_CUSTOMER_CERTIFICATE = "去声网申请"; + /** Ios的token */ + public static final String DEVICE_TOKEN="deviceToken"; + /** Ios的package */ + public static final String IOS_PACKAGE="iosPackage"; + /** Ios的version */ + public static final String IOS_VERSION="iosVersion"; + /** Ios 语言 */ + public static final String IOS_LANGUAGE="iosLanguage"; + /** 消息推送区分Android / iOS*/ + public static final String USER_AGENT="userAgent"; + /** 系统推送区分Android具体型号*/ + public static final String ANDROID_AGENT="AndroidAgent:"; + public static final String VIDEO_CALL ="message.video.call" ; + public static final String INVITE_CALL ="message.invite.call" ; + public static final String TRIGGER_SOS = "message.trigger.sos"; + public static final String ALARM_SOS = "message.alarm.sos"; + + public static final String HEART_RATE_ABNORMAL = "heart.rate.abnormal"; + public static final String PRE_MIN = "pre.min"; + public static final String HEART_RATE_CURRENT = "heart.rate.current"; + + public static final String TEMP_ABNORMAL = "temp.abnormal"; + public static final String TEMP_CURRENT = "temp.current"; + + public static final String HEART_SIMPLE_ABNORMAL = "heart.simple.abnormal"; + public static final String TEMP_SIMPLE= "temp.simple"; + public static final String CHANT_VIDEO="message.chant.video"; + public static final String ACCEPT_CHANT_VIDEO="accept.chant.video"; + + public static final String USER_UNBIND_DEVICE="user.unbind.device"; + public static final String DOWN_VIDEO_CALL="down.video.call"; + public static final String ENTER_RAIL="enter.rail"; + public static final String LEAVE_RAIL="leave.rail"; + public static final String CALL_FOLLOW="call.follow"; + + public static final String PRE_IDENTITY_TRANSFER="pre.identity.transer"; + public static final String AFTER_IDENTITY_TRANSFER="after.identity.transer"; + + public static final String ACCEPT_IDENTITY_TRANSFER="accept.identity.transer"; + + public static final String ADDRESS_BOOK_MAX="message.addressBook.max"; + + public static final String EXIT_LIST_VIDEO_CALL = "exit.list.video.call"; + public static final String CAN_NOT_VIDEO_CALL = "cannot.video.call"; + public static final String DISABLED_VIDEO_CALL = "disabled.video.call"; + public static final String NOT_INTERNET_VIDEO_CALL = "not.internet.video.call"; + public static final String LONG_TIME_VIDEO_CALL = "long.time.video.call"; + public static final String PROCESS_VIDEO_CALL = "process.video.call"; + + public static final String PHONE_HAS_EXIT="phone.has.exit"; +} diff --git a/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/AlarmClockDto.java b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/AlarmClockDto.java new file mode 100644 index 0000000..9e19eb2 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/AlarmClockDto.java @@ -0,0 +1,15 @@ +package com.ecell.internationalize.common.issue.entity; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * @author borui + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class AlarmClockDto extends DistributeParent{ + private List alarm; +} diff --git a/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/AlarmClockSecond.java b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/AlarmClockSecond.java new file mode 100644 index 0000000..743dd30 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/AlarmClockSecond.java @@ -0,0 +1,14 @@ +package com.ecell.internationalize.common.issue.entity; + +import lombok.Data; + +/** + * @author borui + */ +@Data +public class AlarmClockSecond { + private String text; + private String week; + private String start; + private Integer status; +} diff --git a/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/BootOff.java b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/BootOff.java new file mode 100644 index 0000000..1b54725 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/BootOff.java @@ -0,0 +1,14 @@ +package com.ecell.internationalize.common.issue.entity; + +import lombok.Data; + +/** + * @author borui + */ +@Data +public class BootOff extends DistributeParent { + private String startTime; //"06:00",[str] //开始时间 (24 小时制 ) + private String endTime; //"23:00",[str] //结束时间 (24 小时制 ) + private String week; //"1111111",[str] // 重复星期数 默认是 1111111 每天开启 + private Integer status; // 开关状态 +} diff --git a/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/ChatGroupDisbandMessageInfo.java b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/ChatGroupDisbandMessageInfo.java new file mode 100644 index 0000000..ae1e6c1 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/ChatGroupDisbandMessageInfo.java @@ -0,0 +1,20 @@ +package com.ecell.internationalize.common.issue.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @author borui + */ +@Data +public class ChatGroupDisbandMessageInfo { + private String type; + private String groupId; + private String operator; + private String name; + private String imei; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private Date disbandTime; +} diff --git a/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/DeviceDisabledAppDto.java b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/DeviceDisabledAppDto.java new file mode 100644 index 0000000..7190a82 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/DeviceDisabledAppDto.java @@ -0,0 +1,15 @@ +package com.ecell.internationalize.common.issue.entity; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * @author borui + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class DeviceDisabledAppDto extends DistributeParent{ + private List disturb; +} diff --git a/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/DeviceDisabledInnerAppDto.java b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/DeviceDisabledInnerAppDto.java new file mode 100644 index 0000000..911e328 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/DeviceDisabledInnerAppDto.java @@ -0,0 +1,15 @@ +package com.ecell.internationalize.common.issue.entity; + +import lombok.Data; + +/** + * @author borui + */ +@Data +public class DeviceDisabledInnerAppDto { + private String end; + private String week; + private String start; + private Integer status; + +} diff --git a/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/DistributeParent.java b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/DistributeParent.java new file mode 100644 index 0000000..a6b0ca3 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/entity/DistributeParent.java @@ -0,0 +1,22 @@ +package com.ecell.internationalize.common.issue.entity; + +import lombok.Data; + +/** + * @author borui + */ +@Data +public class DistributeParent { + //6位随机数 + protected String ident; + //设备imei + protected String imei; + //登录用户id + protected String openid; + //厂商标识 + protected String vender; + //下发指令类型 + protected String type; + //下发时间 + protected Long time; +} diff --git a/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/issue/IssueInstructions.java b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/issue/IssueInstructions.java new file mode 100644 index 0000000..713c297 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-issue/src/main/java/com/ecell/internationalize/common/issue/issue/IssueInstructions.java @@ -0,0 +1,234 @@ +package com.ecell.internationalize.common.issue.issue; + +import com.alibaba.fastjson2.JSON; +import com.ecell.internationalize.common.issue.constant.CommonConstant; +import com.ecell.internationalize.common.issue.entity.AlarmClockDto; +import com.ecell.internationalize.common.issue.entity.BootOff; +import com.ecell.internationalize.common.issue.entity.DeviceDisabledAppDto; +import com.ecell.internationalize.common.redis.service.RedisService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.kafka.core.KafkaTemplate; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.concurrent.TimeUnit; + +/** + * @author borui + */ +@Component +public class IssueInstructions { + private static final Logger log = LoggerFactory.getLogger(IssueInstructions.class); + @Autowired + private RedisService redisService; + @Autowired + private KafkaTemplate kafkaTemplate; + public void emitDeviceDemand(String type, String imei, Object object){ + //查询缓存设备状态 + String onlineStatus = redisService.getCacheMapValue(imei, "onlineStatus"); + if ("disturb".equals(type)){ //上课禁用(下发)18 + DeviceDisabledAppDto disturb =(DeviceDisabledAppDto)object; + addRedis(imei,type,"disBan","disBanSync",disturb,onlineStatus); + } + else if ("alarm".equals(type)){ //闹钟(下发) 17 + AlarmClockDto alarm = (AlarmClockDto)object; + addRedis(imei,type,"alarms","alarmsSync",alarm,onlineStatus); + } + else if ("setBootOff".equals(type)){ //定时开关机数据设置下发指令 62 + BootOff bootOff =(BootOff)object; + addRedis(imei,type,"setBootOff","setBootOffSync",bootOff,onlineStatus); + + } + //设备在线才下发指令 + if(CommonConstant.AUDIT_STATUS_ONE.equals(onlineStatus)){ + log.info("下发到kafka指令:{},状态{}",object,onlineStatus); + sendKafka(object); + } +// //获取用户id +// String stringUserId = SecurityContextHolder.getStringUserId(); +// log.info("指令下发内容:{}",object); +// //查询缓存设备状态 +// String onlineStatus = redisService.getCacheMapValue(imei, "onlineStatus"); +// if ("centerPhone".equals(type)){// 中心号码设置(下发)只有管理员绑定设备,和管理员转让才下发该指令 29 +// CenterPhoneSetting centerPhoneSetting =(CenterPhoneSetting) object; +// addRedis(imei,type,"centerPhone","centerPhoneSync",centerPhoneSetting,onlineStatus); +// }else if ("sos".equals(type)){ //sos下发 20 +// SOS sos = (SOS)object; +// addRedis(imei,type,"sos","sosSync",sos,onlineStatus); +// }else if ("alarm".equals(type)){ //闹钟(下发) 17 +// AlarmClockDto alarm = (AlarmClockDto)object; +// addRedis(imei,type,"alarms","alarmsSync",alarm,onlineStatus); +// }else if ("disturb".equals(type)){ //上课禁用(下发)18 +// DeviceDisabledAppDto disturb =(DeviceDisabledAppDto)object; +// addRedis(imei,type,"disBan","disBanSync",disturb,onlineStatus); +// }else if ("PowerOff".equals(type)){ //远程关机(下发) 只有管理员才能操作 +// DistributeParent distributeParent =(DistributeParent)object; +// addRedis(imei,type,"PowerOff","PowerOffSync",distributeParent,onlineStatus); +// }else if ("dialSwitch".equals(type)){//拨号盘开关(下发) +// DialSwitch dialSwitch =(DialSwitch)object; +// addRedis(imei,type,"dialSwitch","dialSwitchSync",dialSwitch,onlineStatus); +// +// }else if ("locationUploadInterval".equals(type)){ //位置上报间隔设置(下发)22 +// LocationUploadInterval locationUploadInterval =(LocationUploadInterval)object; +// if (StringUtils.isNotNull(locationUploadInterval)){ +// if (StringUtils.isNotEmpty(locationUploadInterval.getSecond().toString())){ +// locationUploadInterval.setSecond(locationUploadInterval.getSecond()*60); +// } else { +// locationUploadInterval.setSecond(600); +// } +// } +// +// addRedis(imei,type,"locMode_rate","locMode_rateSync",locationUploadInterval,onlineStatus); +// }else if ("contact".equals(type)) { //通讯录下发 TODO 这里还要理一下逻辑 +// Contact contact = (Contact) object; +// addRedis(imei, type, "contacts", "contactsSync", contact, onlineStatus); +// }else if ("reset".equals(type)){ //恢复出厂设置(下发)25 +// restDevice(imei); +// }else if ("requestLocation".equals(type)){ //请求定位(下发)15 +// log.info("请求定位下发 imei:%s object: %s", imei, object); +// setRedisKey(type,imei,stringUserId); +// }else if ("requestWifi".equals(type)){ //TCP-API接口文档没有 先不做 +// +// }else if ("setBootOff".equals(type)){ //定时开关机数据设置下发指令 62 +// BootOff bootOff =(BootOff)object; +// addRedis(imei,type,"setBootOff","setBootOffSync",bootOff,onlineStatus); +// +// }else if ("setSetpSwitch".equals(type)){ //APP 下发计步开关和目标步数指令60 +// SetpSwitch setpSwitch =(SetpSwitch)object; +// addRedis(imei,type,"setSetpSwitch","setSetpSwitchSync",setpSwitch,onlineStatus); +// +// }else if ("downSchoolTimeTable".equals(type)){ //APP 下发课程表信息 (下发) +// DownSchoolTimeTable downSchoolTimeTable =(DownSchoolTimeTable) object; +// addRedis(imei,type,"downSchoolTimeTable","downSchoolTimeTableSync",downSchoolTimeTable,onlineStatus); +// }else if ("STUDENTINFO".equals(type)){//平台下发学生信息 +// StudentInfo studentInfo =(StudentInfo) object; +// addRedis(imei,type,"STUDENTINFO","STUDENTINFOSync",studentInfo,onlineStatus); +// +// }else if ("familyPhoneList".equals(type)){//亲情号下发 +// FamilyPhoneInfo familyPhoneInfo =(FamilyPhoneInfo) object; +// addRedis(imei,type,"familyPhoneList","familyPhoneListSync",familyPhoneInfo,onlineStatus); +// } + + + + } + + /** + * + * @param imei 设备IMEI + * @param type 指令下发类型 + * @param key1 缓存的key1 + * @param key2 缓存的key2 + * @param o 下发指令的内容 + * @param onlineStatus 缓存中设备的状态 + */ + // 设置缓存 + private void addRedis(String imei, String type, String key1, String key2, Object o, String onlineStatus){ + log.info("存到redis数据库结果 type:%s:{}, data:%s:{}", key1, o); + redisService.setCacheMapValue(imei,key1, JSON.toJSONString(o)); + if (CommonConstant.AUDIT_STATUS_ONE.equals(onlineStatus)){ + log.info("设备imei: %s 在线",imei); + }else { + redisService.setCacheMapValue(imei,key2,"1"); + } + + } + + // 下发KAFKA + public void sendKafka(Object object){ + log.info("下发到kafka的数据信息:{}",object); + kafkaTemplate.send(CommonConstant.WATCHPUSH_KAFKA, JSON.toJSONString(object)).addCallback(success->{ + log.info("发送到kafka具体信息{},partition 分区 {},offset {}", success.getRecordMetadata().topic(),success.getRecordMetadata().partition(),success.getRecordMetadata().offset()); + + },failure -> { + //失败 + log.info("下发到kafka的数据信息失败:{}",failure.getMessage()); + log.info("发送到kafka具体信息{}",JSON.toJSONString(object)); + + }); + + + } + + + /** + * 恢复出厂设置 + * @param imei + */ + private void restDevice(String imei){ + List list = Arrays.asList("messageVoice", "messageVoiceSync", "centerPhone", "weather", "weather_time", "weather_adcode", "locMode_rate", "locMode_rateSync", "reject", "rejectSync", "dialSwitch", + "dialSwitchSync", "volume", "volumeSync", "downSchoolTimeTable", "downSchoolTimeTableSync", "setHeartRate", "setHeartRateSync", "setBodyTemperature", "setBodyTemperatureSync", + "setBootOff", "setBootOffSync", "setSetpSwitch", "setSetpSwitchSync", "ppmessage", "ppmessageSync", "sos", "sosSync", "familyPhoneList", "familyPhoneListSync", "whitePhoneList", + "whitePhoneListSync", "studentInfo", "studentInfoSync","familyPhoneList","zytz"); + log.info("设备恢复出厂设置:{}",imei); + // delRedisKey(imei,list); + boolean flag= redisService.deleteObject(imei); + log.info("删除缓存是否成功:{}",flag); + if (flag){ + redisService.setCacheMapValue(imei,"contacts","{\"last\":0,\"ident\":1616,\"contact\":[],\"index\":0,\"type\":'contact'}"); + redisService.setCacheMapValue(imei,"contactsSync", "1"); + redisService.setCacheMapValue(imei,"alarms", "{\"ident\":3030,\"alarm\":[],\"type\":'alarm'}"); + redisService.setCacheMapValue(imei, "alarmsSync", "1"); + redisService.setCacheMapValue(imei, "disBan", "{\"disturb\": [], \"ident\": 2828, \"type\": 'disturb'}"); + redisService.setCacheMapValue(imei, "disBanSync", "1"); + redisService.setCacheMapValue(imei, "onlineStatus", "0"); + redisService.setCacheMapValue(imei, "agent", "20000"); + redisService.setCacheMapValue(imei, "deviceHead","YS"); + redisService.setCacheMapValue(imei, "familyPhoneList","[]"); + } + + + } + + /** + * 删除缓存 + */ + private void delRedisKey(String imei,Listlist){ + Map cacheMap = redisService.getCacheMap(imei); + log.info("redids 中的键值对:{}",cacheMap); + if (redisService.deleteObject(imei)){ + try { + Iterator> iterator = cacheMap.entrySet().iterator(); + while (iterator.hasNext()){ + Map.Entry next = iterator.next(); + if (list.stream().anyMatch(a->a.equals(next.getKey()))){ + redisService.setCacheMapValue(imei,next.getKey(),next.getValue()); + } + } + }catch (Exception e){ + log.info("删除redis失败 imei{},数据{}",imei,cacheMap); + } + + } + + } + + + // 下发KAFKA + public void sendKafkaTwo(String imei,Object object){ + log.info("下发到kafka的数据信息:{}",object); + kafkaTemplate.send(CommonConstant.WATCHPUSH_KAFKA, imei,JSON.toJSONString(object)).addCallback(success->{ + log.info("发送到kafka具体信息{},partition 分区 {},offset {}", success.getRecordMetadata().topic(),success.getRecordMetadata().partition(),success.getRecordMetadata().offset()); + + },failure -> { + //失败 + log.info("下发到kafka的数据信息失败:{}",failure.getMessage()); + log.info("发送到kafka具体信息{}",JSON.toJSONString(object)); + + }); + + + } + + /** + * 存入redis中 + */ + private void setRedisKey(String type,String imei,String userId){ + String s = String.format(type+":%s:%s",imei, userId); + log.info("存入redis中的key:{},data:{}",s,userId); + redisService.setCacheObject(s,userId, 60L, TimeUnit.SECONDS); + } + +} diff --git a/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-security/src/main/java/com/ecell/internationalize/common/security/annotation/EnableCustomConfig.java b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-security/src/main/java/com/ecell/internationalize/common/security/annotation/EnableCustomConfig.java index 05dae41..b161af9 100644 --- a/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-security/src/main/java/com/ecell/internationalize/common/security/annotation/EnableCustomConfig.java +++ b/ecell-internationalize/ecell-internationalize-common/ecell-internationalize-security/src/main/java/com/ecell/internationalize/common/security/annotation/EnableCustomConfig.java @@ -19,7 +19,7 @@ import java.lang.annotation.*; // 表示通过aop框架暴露该代理对象,AopContext能够访问 @EnableAspectJAutoProxy(exposeProxy = true) // 指定要扫描的Mapper类的包的路径 -@MapperScan("com.campus.**.mapper") +@MapperScan("com.ecell.internationalize.**.mapper") // 开启线程异步执行 @EnableAsync // 自动加载类 diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/EcellSystemApplication.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/EcellSystemApplication.java new file mode 100644 index 0000000..56ffb93 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/EcellSystemApplication.java @@ -0,0 +1,24 @@ +package com.ecell.internationalize.system; + +import com.ecell.internationalize.common.security.annotation.EnableCustomConfig; +import com.ecell.internationalize.common.security.annotation.EnableRyFeignClients; +import com.ecell.internationalize.common.swagger.annotation.EnableCustomSwagger2; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableScheduling; + +/** + * @author borui + */ +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableRyFeignClients +@EnableScheduling +@SpringBootApplication(scanBasePackages = "com.ecell.internationalize") +public class EcellSystemApplication { + public static void main(String[] args) { + SpringApplication.run(EcellSystemApplication.class, args); + System.out.println("易赛后台服务管理系统启动成功"); + + } +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivityBannerController.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivityBannerController.java new file mode 100644 index 0000000..15d1cbe --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivityBannerController.java @@ -0,0 +1,126 @@ +package com.ecell.internationalize.system.controller; +import com.ecell.internationalize.common.core.utils.locale.LocaleUtil; +import com.ecell.internationalize.common.core.utils.uuid.UUID; +import com.ecell.internationalize.common.core.web.domain.AjaxResult; +import com.ecell.internationalize.common.security.utils.SecurityUtils; +import com.ecell.internationalize.common.system.annotation.SystemLog; +import com.ecell.internationalize.common.system.constant.FieldConstant; +import com.ecell.internationalize.common.system.utlis.UploadUtil; +import com.ecell.internationalize.system.entity.ActivityBanner; +import com.ecell.internationalize.system.service.ActivityBannerService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.Date; +import java.util.Map; + +/** + *

+ * 活动banner图 前端控制器 + *

+ * + * @author liy + * @since 2022-07-13 + */ +@Api(value="活动banner图",tags={"活动banner图接口"}) +@RestController +@RequestMapping("/activity_banner") +public class ActivityBannerController { + @Autowired + private ActivityBannerService activityBannerService; + /** + * 活动banner图条件分页查询 + * @Author liy + * @Date 2022/7/14 16:38 + * @param map 分页条件查询体 + * @Return AjaxResult + */ + @ApiOperation("条件分页查询活动banner图信息") + @PostMapping("banner/list") + public AjaxResult queryAllByPage(@RequestBody Map map){ + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityBannerService.findAllByPage(map)); + } + /** + * 活动banner图发布 + * @Author liy + * @Date 2022/7/14 16:38 + * @param activityBanner 实体类 + * @Return AjaxResult + */ + @ApiOperation("活动banner图发布/取消发布") + @SystemLog(msg =FieldConstant.ACTIVITY_BANNER_BANNER,operation = FieldConstant.ACTIVITY_BANNER_PUBLISH) + @PostMapping("banner/changeStatus") + public AjaxResult changeStatusOrDelUser(@RequestBody @ApiParam(name="活动",value="传整个对象,修改其中status字段,(0:取消发布,1:发布)",required=true) ActivityBanner activityBanner){ + //1表示发布图片,新增默认0未发布 + if (FieldConstant.MATH_ONE.equals(activityBanner.getStatus())){ + activityBanner.setPublishUser("admin"); + activityBanner.setPublishTime(new Date()); + }else { + activityBanner.setPublishUser(null); + activityBanner.setPublishTime(null); + } + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityBannerService.updateById(activityBanner)); + } + /** + * 活动banner图删除 + * @Author liy + * @Date 2022/7/14 16:38 + * @param activityBanner 实体类 + * @Return AjaxResult + */ + @ApiOperation("活动banner图删除") + @SystemLog(msg =FieldConstant.ACTIVITY_BANNER_BANNER,operation = FieldConstant.DELETE_OPERATOR) + @PostMapping("banner/del") + public AjaxResult del(@RequestBody @ApiParam(name="活动",value="传整个对象,修改其中delFlag字段,(0:删除,1:正常)",required=true) ActivityBanner activityBanner){ + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityBannerService.updateById(activityBanner)); + } + /** + * 活动banner图上传/新增 + * @Author liy + * @Date 2022/7/14 16:38 + * @param file 文件 + * @Return AjaxResult + */ + @ApiOperation("活动banner图新增上传") + @SystemLog(msg =FieldConstant.ACTIVITY_BANNER_BANNER,operation = FieldConstant.SAVE_OPERATOR) + @PostMapping("banner/save") + public AjaxResult save(@RequestParam("file") MultipartFile file,@RequestParam("title") String title,@RequestParam("bannerOrder")Integer bannerOrder) throws IOException { + String path = UploadUtil.upload(file); + String id= UUID.randomUUID().toString(true); + ActivityBanner activityBanner=new ActivityBanner(); + activityBanner.setId(id); + activityBanner.setCreateUser(SecurityUtils.getUsername()); + activityBanner.setBannerOrder(bannerOrder); + activityBanner.setTitle(title); + activityBanner.setBanner(path); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityBannerService.save(activityBanner)); + } + /** + * 活动banner图上传/修改 + * @Author liy + * @Date 2022/7/14 16:38 + * @param file 文件 + * @Return AjaxResult + */ + @ApiOperation("活动banner图修改上传") + @SystemLog(msg =FieldConstant.ACTIVITY_BANNER_BANNER,operation = FieldConstant.UPDATE_OPERATOR) + @PostMapping("banner/update") + public AjaxResult update(@RequestParam(value = "file",required = false) MultipartFile file,@RequestParam("id")String id, @RequestParam("title") String title,@RequestParam("bannerOrder")Integer bannerOrder) throws IOException { + ActivityBanner activityBanner=new ActivityBanner(); + if (null!=file) { + String path = UploadUtil.upload(file); + activityBanner.setBanner(path); + } + activityBanner.setId(id); + activityBanner.setBannerOrder(bannerOrder); + activityBanner.setTitle(title); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityBannerService.updateById(activityBanner)); + } + +} + diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivityController.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivityController.java index ae02b97..6a2af09 100644 --- a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivityController.java +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivityController.java @@ -2,15 +2,15 @@ package com.ecell.internationalize.system.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.ruoyi.common.core.utils.uuid.UUID; -import com.ruoyi.common.core.web.domain.AjaxResult; -import com.yisai.common.security.utils.SecurityUtils; -import com.yisai.system.common.annotation.SystemLog; -import com.yisai.system.common.constant.FieldConstant; -import com.yisai.system.common.utlis.I18nUtil; -import com.yisai.system.common.utlis.UploadUtil; -import com.yisai.system.entity.Activity; -import com.yisai.system.service.ActivityService; +import com.ecell.internationalize.common.core.utils.locale.LocaleUtil; +import com.ecell.internationalize.common.core.utils.uuid.UUID; +import com.ecell.internationalize.common.core.web.domain.AjaxResult; +import com.ecell.internationalize.common.security.utils.SecurityUtils; +import com.ecell.internationalize.common.system.annotation.SystemLog; +import com.ecell.internationalize.common.system.constant.FieldConstant; +import com.ecell.internationalize.common.system.utlis.UploadUtil; +import com.ecell.internationalize.system.entity.Activity; +import com.ecell.internationalize.system.service.ActivityService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -47,7 +47,7 @@ public class ActivityController { @ApiOperation("条件分页查询活动信息") @PostMapping("current/list") public AjaxResult queryAllByPage(@RequestBody Map map){ - return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.findAllByPage(map)); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.findAllByPage(map)); } /** * 活动发布 @@ -67,7 +67,7 @@ public class ActivityController { activity.setPublishUser(null); activity.setPublishTime(null); } - return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.updateById(activity)); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.updateById(activity)); } /** * 活动删除 @@ -80,7 +80,7 @@ public class ActivityController { @SystemLog(msg =FieldConstant.ACTIVITY_BANNER,operation = FieldConstant.DELETE_OPERATOR) @PostMapping("current/del") public AjaxResult del(@RequestBody @ApiParam(name="活动",value="传整个对象,修改其中delFlag字段,(0:删除,1:正常)",required=true) Activity activity){ - return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.updateById(activity)); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.updateById(activity)); } /** @@ -111,7 +111,7 @@ public class ActivityController { activity.setExpiryDate(expiryDate); activity.setCreateUser(SecurityUtils.getUsername()); activity.setBannerImage(path); - return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.save(activity)); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.save(activity)); } /** * 活动上传/修改 @@ -141,7 +141,7 @@ public class ActivityController { activity.setActivityAreas(activityAreas); activity.setActivityQuota(activityQuota); activity.setExpiryDate(expiryDate); - return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.updateById(activity)); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.updateById(activity)); } /** * 往期活动条件分页查询 @@ -153,7 +153,7 @@ public class ActivityController { @ApiOperation("往期活动条件分页查询") @PostMapping("last/list") public AjaxResult queryLastListByPage(@RequestBody Map map){ - return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.queryLastListByPage(map)); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.queryLastListByPage(map)); } /** * 搜索条件查询接口 @@ -168,7 +168,7 @@ public class ActivityController { QueryWrapper queryWrapper = new QueryWrapper<>(); String value = FieldConstant.TYPE_MAP.get(type); queryWrapper.select("DISTINCT "+value).eq("del_flag", FieldConstant.MATH_ONE); - return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.getBaseMapper().selectList(queryWrapper)); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activityService.getBaseMapper().selectList(queryWrapper)); } } diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivitySearchController.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivitySearchController.java index fde0acc..1ea5e53 100644 --- a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivitySearchController.java +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/ActivitySearchController.java @@ -1,14 +1,14 @@ package com.ecell.internationalize.system.controller; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.ruoyi.common.core.utils.uuid.UUID; -import com.ruoyi.common.core.web.domain.AjaxResult; -import com.yisai.common.security.utils.SecurityUtils; -import com.yisai.system.common.annotation.SystemLog; -import com.yisai.system.common.constant.FieldConstant; -import com.yisai.system.common.utlis.I18nUtil; -import com.yisai.system.entity.ActivitySearch; -import com.yisai.system.service.ActivitySearchService; +import com.ecell.internationalize.common.core.utils.locale.LocaleUtil; +import com.ecell.internationalize.common.core.utils.uuid.UUID; +import com.ecell.internationalize.common.core.web.domain.AjaxResult; +import com.ecell.internationalize.common.security.utils.SecurityUtils; +import com.ecell.internationalize.common.system.annotation.SystemLog; +import com.ecell.internationalize.common.system.constant.FieldConstant; +import com.ecell.internationalize.system.entity.ActivitySearch; +import com.ecell.internationalize.system.service.ActivitySearchService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -44,7 +44,7 @@ public class ActivitySearchController { @ApiOperation("条件分页查询热门搜索信息") @PostMapping("search/list") public AjaxResult queryAll(@RequestBody Page page){ - return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activitySearchService.findAllByPage(page)); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activitySearchService.findAllByPage(page)); } /** * 新增热门搜索 @@ -60,7 +60,7 @@ public class ActivitySearchController { String id= UUID.randomUUID().toString(true); activitySearch.setId(id); activitySearch.setCreateUser(SecurityUtils.getUsername()); - return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activitySearchService.save(activitySearch)); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activitySearchService.save(activitySearch)); } /** * 修改热门搜索 @@ -73,7 +73,7 @@ public class ActivitySearchController { @SystemLog(msg =FieldConstant.HOT_SEARCH,operation = FieldConstant.UPDATE_OPERATOR) @PostMapping("search/update") public AjaxResult updateSearch(@RequestBody @Valid ActivitySearch activitySearch){ - return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activitySearchService.updateById(activitySearch)); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activitySearchService.updateById(activitySearch)); } /** * 删除热门搜索 @@ -86,7 +86,7 @@ public class ActivitySearchController { @SystemLog(msg =FieldConstant.HOT_SEARCH,operation = FieldConstant.DELETE_OPERATOR) @PostMapping("search/del") public AjaxResult delCategory(@RequestBody @ApiParam(value="传整个对象,修改其中delFlag字段,(0:删除,1:正常)",required=true) ActivitySearch activitySearch){ - return AjaxResult.success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activitySearchService.updateById(activitySearch)); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),activitySearchService.updateById(activitySearch)); } } diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/Advert.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/Advert.java new file mode 100644 index 0000000..f236efa --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/Advert.java @@ -0,0 +1,124 @@ +package com.ecell.internationalize.system.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 广告 + *

+ * + * @author liy + * @since 2022-07-14 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("advert") +public class Advert implements Serializable { + +private static final long serialVersionUID=1L; + + /** + * 主键Id + */ + @TableId("id") + private String id; + + /** + * 排序号 + */ + @NotNull(message = "排序序号不能为空") + private Integer advertOrder; + + /** + * 广告商 + */ + @NotBlank(message = "广告商名称不能为空") + private String advertName; + + /** + * 广告商字母缩写 + */ + @NotBlank(message = "广告商标识不能为空") + private String advertShortName; + + /** + * 开关状态(0:关闭,1:打开),默认0 + */ + private String status; + + /** + * 开始时间1 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTimeFirst; + + /** + * 开始时间2 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTimeSecond; + + /** + * 开始时间3 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTimeThird; + + /** + * 结束时间1 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endTimeFirst; + + /** + * 结束时间2 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endTimeSecond; + + /** + * 结束时间3 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endTimeThird; + + /** + * 删除标识(0:已删除,1:正常) + */ + private String delFlag; + + /** + * 创建人 + */ + private String createUser; + /** + * 创建时间 + */ + @TableField(value = "create_time",fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + /** + * 修改人 + */ + private String updateUser; + /** + * 修改时间 + */ + @TableField(value = "update_time",fill = FieldFill.UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/ActivitySearchService.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/ActivitySearchService.java new file mode 100644 index 0000000..9cb49fa --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/ActivitySearchService.java @@ -0,0 +1,26 @@ +package com.ecell.internationalize.system.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ecell.internationalize.system.entity.ActivitySearch; + +/** + *

+ * 服务类 + *

+ * + * @author liy + * @since 2022-07-13 + */ +public interface ActivitySearchService extends IService { + + /** + * 热门搜索分页列表 + * @Author liy + * @Date 2022/7/14 11:42 + * @param page 分页 + * @return IPage + */ + IPage findAllByPage(Page page); +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/ActivityService.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/ActivityService.java new file mode 100644 index 0000000..758cf0a --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/ActivityService.java @@ -0,0 +1,34 @@ +package com.ecell.internationalize.system.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ecell.internationalize.system.entity.Activity; + +import java.util.Map; + +/** + *

+ * 活动 服务类 + *

+ * + * @author liy + * @since 2022-07-13 + */ +public interface ActivityService extends IService { + /** + * 活动分页查询 + * @Author liy + * @Date 2022/7/14 16:42 + * @param map 分页查询体 + * @return IPage + */ + IPage findAllByPage(Map map); + /** + * 往期活动分页查询 + * @Author liy + * @Date 2022/7/14 16:42 + * @param map 分页查询体 + * @return IPage + */ + IPage queryLastListByPage(Map map); +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/ActivitySearchServiceImpl.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/ActivitySearchServiceImpl.java new file mode 100644 index 0000000..50acb1c --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/ActivitySearchServiceImpl.java @@ -0,0 +1,40 @@ +package com.ecell.internationalize.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ecell.internationalize.common.system.constant.FieldConstant; +import com.ecell.internationalize.system.entity.ActivitySearch; +import com.ecell.internationalize.system.mapper.ActivitySearchMapper; +import com.ecell.internationalize.system.service.ActivitySearchService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author liy + * @since 2022-07-13 + */ +@Service +public class ActivitySearchServiceImpl extends ServiceImpl implements ActivitySearchService { + @Autowired + private ActivitySearchMapper activitySearchMapper; + /** + * 热门搜索分页列表 + * @Author liy + * @Date 2022/7/14 11:42 + * @param page 分页 + * @return IPage + */ + @Override + public IPage findAllByPage(Page page) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ActivitySearch::getDelFlag, FieldConstant.MATH_ONE); + queryWrapper.orderByAsc(ActivitySearch::getSearchOrder); + return activitySearchMapper.selectPage(page,queryWrapper); + } +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/ActivityServiceImpl.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/ActivityServiceImpl.java new file mode 100644 index 0000000..1dcdf9e --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/ActivityServiceImpl.java @@ -0,0 +1,76 @@ +package com.ecell.internationalize.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ecell.internationalize.common.system.constant.FieldConstant; +import com.ecell.internationalize.system.entity.Activity; +import com.ecell.internationalize.system.mapper.ActivityMapper; +import com.ecell.internationalize.system.service.ActivityService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.Map; + +/** + *

+ * 活动 服务实现类 + *

+ * + * @author liy + * @since 2022-07-13 + */ +@Service +public class ActivityServiceImpl extends ServiceImpl implements ActivityService { + @Autowired + private ActivityMapper activityMapper; + /** + * 活动分页查询 + * @Author liy + * @Date 2022/7/14 16:42 + * @param map 分页查询体 + * @return IPage + */ + @Override + public IPage findAllByPage(Map map) { + Page page=new Page<>(Integer.parseInt(map.get(FieldConstant.CURRENT).toString()),Integer.parseInt(map.get(FieldConstant.SIZE).toString())); + LambdaQueryWrapper queryWrapper = conditions(map); + return activityMapper.selectPage(page,queryWrapper); + } + /** + * 往期活动分页查询 + * @Author liy + * @Date 2022/7/14 16:42 + * @param map 分页查询体 + * @return IPage + */ + @Override + public IPage queryLastListByPage(Map map) { + Page page=new Page<>(Integer.parseInt(map.get(FieldConstant.CURRENT).toString()),Integer.parseInt(map.get(FieldConstant.SIZE).toString())); + LambdaQueryWrapper queryWrapper = conditions(map); + queryWrapper.lt(Activity::getExpiryDate,new Date()); + return activityMapper.selectPage(page,queryWrapper); + } + private LambdaQueryWrapper conditions(Map map){ + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (map.containsKey(FieldConstant.ACTIVITY_TITLE)&&null!=map.get(FieldConstant.ACTIVITY_TITLE).toString()){ + queryWrapper.eq(Activity::getActivityTitle,map.get(FieldConstant.ACTIVITY_TITLE).toString()); + } + if (map.containsKey(FieldConstant.STATUS)&&null!=map.get(FieldConstant.STATUS).toString()){ + queryWrapper.eq(Activity::getStatus,map.get(FieldConstant.STATUS).toString()); + } + if (map.containsKey(FieldConstant.ACTIVITY_CATEGORY)&&null!=map.get(FieldConstant.ACTIVITY_CATEGORY).toString()){ + queryWrapper.eq(Activity::getActivityCategory,map.get(FieldConstant.ACTIVITY_CATEGORY).toString()); + } + if (map.containsKey(FieldConstant.ACTIVITY_AGE)&&null!=map.get(FieldConstant.ACTIVITY_AGE).toString()){ + queryWrapper.eq(Activity::getActivityAge,map.get(FieldConstant.ACTIVITY_AGE).toString()); + } + if (map.containsKey(FieldConstant.ACTIVITY_AREAS)&&null!=map.get(FieldConstant.ACTIVITY_AREAS).toString()){ + queryWrapper.eq(Activity::getActivityAreas,map.get(FieldConstant.ACTIVITY_AREAS).toString()); + } + queryWrapper.eq(Activity::getDelFlag, FieldConstant.MATH_ONE); + return queryWrapper; + } +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/ActivitySearchMapper.xml b/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/ActivitySearchMapper.xml new file mode 100644 index 0000000..432a11c --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/ActivitySearchMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + id, search_order, search_name, create_user, create_time, update_user, update_time, del_flag + + +