Reviewed-on: http://39.105.23.186:3000/develop/digimeta-MultiSaas/pulls/5tags/B.1.0.0.0_20200714_alpha
| @@ -326,6 +326,44 @@ | |||
| </dependencies> | |||
| <profiles> | |||
| <profile> | |||
| <id>dev</id> | |||
| <properties> | |||
| <!-- 环境标识,需要与配置文件的名称相对应 --> | |||
| <activatedProperties>dev</activatedProperties> | |||
| <nacos.host>39.107.77.235</nacos.host> | |||
| <nacos.port>18848</nacos.port> | |||
| <nacos.namespace>6d0ee265-2a92-44cc-a6de-f34b3ea104e6</nacos.namespace> | |||
| </properties> | |||
| <activation> | |||
| <!-- 默认环境 --> | |||
| <activeByDefault>true</activeByDefault> | |||
| </activation> | |||
| </profile> | |||
| <profile> | |||
| <id>test</id> | |||
| <properties> | |||
| <!-- 环境标识,需要与配置文件的名称相对应 --> | |||
| <activatedProperties>test</activatedProperties> | |||
| <nacos.host>172.17.0.1</nacos.host> | |||
| <nacos.port>18848</nacos.port> | |||
| <nacos.namespace></nacos.namespace> | |||
| </properties> | |||
| </profile> | |||
| <profile> | |||
| <id>prod</id> | |||
| <properties> | |||
| <!-- 环境标识,需要与配置文件的名称相对应 --> | |||
| <activatedProperties>prod</activatedProperties> | |||
| <nacos.host>172.17.0.1</nacos.host> | |||
| <nacos.port>18848</nacos.port> | |||
| <nacos.namespace></nacos.namespace> | |||
| </properties> | |||
| </profile> | |||
| </profiles> | |||
| <build> | |||
| <plugins> | |||
| <plugin> | |||
| @@ -7,6 +7,7 @@ MAINTAINER xueyi | |||
| VOLUME /home/xueyi | |||
| # 创建目录 | |||
| RUN mkdir -p /home/xueyi | |||
| RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | |||
| # 指定路径 | |||
| WORKDIR /home/xueyi | |||
| # 复制jar文件到路径 | |||
| @@ -68,7 +68,21 @@ | |||
| </execution> | |||
| </executions> | |||
| </plugin> | |||
| <plugin> | |||
| <artifactId>maven-resources-plugin</artifactId> | |||
| <groupId>org.apache.maven.plugins</groupId> | |||
| <configuration> | |||
| <delimiters>@</delimiters> | |||
| <useDefaultDelimiters>false</useDefaultDelimiters> | |||
| </configuration> | |||
| </plugin> | |||
| </plugins> | |||
| <resources> | |||
| <resource> | |||
| <directory>src/main/resources</directory> | |||
| <filtering>true</filtering> | |||
| </resource> | |||
| </resources> | |||
| </build> | |||
| </project> | |||
| @@ -9,21 +9,17 @@ spring: | |||
| name: xueyi-auth | |||
| profiles: | |||
| # 环境配置 | |||
| active: dev | |||
| active: @activatedProperties@ | |||
| cloud: | |||
| nacos: | |||
| discovery: | |||
| # 服务注册地址 | |||
| server-addr: 172.17.0.1:18848 | |||
| #namespace: 6d0ee265-2a92-44cc-a6de-f34b3ea104e6 | |||
| # 配置中心地址 | |||
| #server-addr: 39.107.77.235:18848 | |||
| server-addr: @nacos.host@:@nacos.port@ | |||
| namespace: @nacos.namespace@ | |||
| config: | |||
| # 配置中心地址 | |||
| server-addr: 172.17.0.1:18848 | |||
| # namespace: 6d0ee265-2a92-44cc-a6de-f34b3ea104e6 | |||
| # 配置中心地址 | |||
| # server-addr: 39.107.77.235:18848 | |||
| server-addr: @nacos.host@:@nacos.port@ | |||
| namespace: @nacos.namespace@ | |||
| # 配置文件格式 | |||
| file-extension: yml | |||
| # 共享配置 | |||
| @@ -58,9 +58,16 @@ public class TenantLineInnerInterceptor extends BaseMultiTableInnerInterceptor i | |||
| public void beforeQuery(Executor executor, MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException { | |||
| if (InterceptorIgnoreHelper.willIgnoreTenantLine(ms.getId())) return; | |||
| PluginUtils.MPBoundSql mpBs = PluginUtils.mpBoundSql(boundSql); | |||
| mpBs.sql(this.parserSingle(mpBs.sql(), null)); | |||
| String modifiedSql = fixEmptyInClause(mpBs.sql()); | |||
| mpBs.sql(this.parserSingle(modifiedSql, null)); | |||
| } | |||
| private String fixEmptyInClause(String sql) { | |||
| String fixedSql = sql.replaceAll("IN \\(\\)", "IN (null)"); // 将空括号替换为 (null) | |||
| return fixedSql; | |||
| } | |||
| /** | |||
| * before -> prepare | |||
| */ | |||
| @@ -7,6 +7,7 @@ MAINTAINER xueyi | |||
| VOLUME /home/xueyi | |||
| # 创建目录 | |||
| RUN mkdir -p /home/xueyi | |||
| RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | |||
| # 指定路径 | |||
| WORKDIR /home/xueyi | |||
| # 复制jar文件到路径 | |||
| @@ -104,7 +104,21 @@ | |||
| </execution> | |||
| </executions> | |||
| </plugin> | |||
| <plugin> | |||
| <artifactId>maven-resources-plugin</artifactId> | |||
| <groupId>org.apache.maven.plugins</groupId> | |||
| <configuration> | |||
| <delimiters>@</delimiters> | |||
| <useDefaultDelimiters>false</useDefaultDelimiters> | |||
| </configuration> | |||
| </plugin> | |||
| </plugins> | |||
| <resources> | |||
| <resource> | |||
| <directory>src/main/resources</directory> | |||
| <filtering>true</filtering> | |||
| </resource> | |||
| </resources> | |||
| </build> | |||
| </project> | |||
| @@ -9,19 +9,18 @@ spring: | |||
| name: xueyi-gateway | |||
| profiles: | |||
| # 环境配置 | |||
| active: dev | |||
| active: @activatedProperties@ | |||
| cloud: | |||
| nacos: | |||
| discovery: | |||
| # 服务注册地址 | |||
| server-addr: 172.17.0.1:18848 | |||
| #namespace: 6d0ee265-2a92-44cc-a6de-f34b3ea104e6 | |||
| #server-addr: 39.107.77.235:18848 | |||
| server-addr: @nacos.host@:@nacos.port@ | |||
| namespace: @nacos.namespace@ | |||
| config: | |||
| # 配置中心地址 | |||
| server-addr: 172.17.0.1:18848 | |||
| #namespace: 6d0ee265-2a92-44cc-a6de-f34b3ea104e6 | |||
| #server-addr: 39.107.77.235:18848 | |||
| server-addr: @nacos.host@:@nacos.port@ | |||
| namespace: @nacos.namespace@ | |||
| # 配置文件格式 | |||
| file-extension: yml | |||
| # 共享配置 | |||
| @@ -7,6 +7,7 @@ MAINTAINER xueyi | |||
| VOLUME /home/xueyi | |||
| # 创建目录 | |||
| RUN mkdir -p /home/xueyi | |||
| RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | |||
| # 指定路径 | |||
| WORKDIR /home/xueyi | |||
| # 复制jar文件到路径 | |||
| @@ -88,7 +88,21 @@ | |||
| </execution> | |||
| </executions> | |||
| </plugin> | |||
| <plugin> | |||
| <artifactId>maven-resources-plugin</artifactId> | |||
| <groupId>org.apache.maven.plugins</groupId> | |||
| <configuration> | |||
| <delimiters>@</delimiters> | |||
| <useDefaultDelimiters>false</useDefaultDelimiters> | |||
| </configuration> | |||
| </plugin> | |||
| </plugins> | |||
| <resources> | |||
| <resource> | |||
| <directory>src/main/resources</directory> | |||
| <filtering>true</filtering> | |||
| </resource> | |||
| </resources> | |||
| </build> | |||
| </project> | |||
| @@ -9,7 +9,7 @@ spring: | |||
| name: xueyi-file | |||
| profiles: | |||
| # 环境配置 | |||
| active: dev | |||
| active: @activatedProperties@ | |||
| servlet: | |||
| multipart: | |||
| max-request-size: 10MB | |||
| @@ -18,10 +18,12 @@ spring: | |||
| nacos: | |||
| discovery: | |||
| # 服务注册地址 | |||
| server-addr: 172.17.0.1:18848 | |||
| server-addr: @nacos.host@:@nacos.port@ | |||
| namespace: @nacos.namespace@ | |||
| config: | |||
| # 配置中心地址 | |||
| server-addr: 172.17.0.1:18848 | |||
| server-addr: @nacos.host@:@nacos.port@ | |||
| namespace: @nacos.namespace@ | |||
| # 配置文件格式 | |||
| file-extension: yml | |||
| # 共享配置 | |||
| @@ -7,6 +7,7 @@ MAINTAINER xueyi | |||
| VOLUME /home/xueyi | |||
| # 创建目录 | |||
| RUN mkdir -p /home/xueyi | |||
| RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | |||
| # 指定路径 | |||
| WORKDIR /home/xueyi | |||
| # 复制jar文件到路径 | |||
| @@ -81,7 +81,21 @@ | |||
| </execution> | |||
| </executions> | |||
| </plugin> | |||
| <plugin> | |||
| <artifactId>maven-resources-plugin</artifactId> | |||
| <groupId>org.apache.maven.plugins</groupId> | |||
| <configuration> | |||
| <delimiters>@</delimiters> | |||
| <useDefaultDelimiters>false</useDefaultDelimiters> | |||
| </configuration> | |||
| </plugin> | |||
| </plugins> | |||
| <resources> | |||
| <resource> | |||
| <directory>src/main/resources</directory> | |||
| <filtering>true</filtering> | |||
| </resource> | |||
| </resources> | |||
| </build> | |||
| </project> | |||
| @@ -9,15 +9,17 @@ spring: | |||
| name: xueyi-job | |||
| profiles: | |||
| # 环境配置 | |||
| active: dev | |||
| active: @activatedProperties@ | |||
| cloud: | |||
| nacos: | |||
| discovery: | |||
| # 服务注册地址 | |||
| server-addr: 172.17.0.1:18848 | |||
| server-addr: @nacos.host@:@nacos.port@ | |||
| namespace: @nacos.namespace@ | |||
| config: | |||
| # 配置中心地址 | |||
| server-addr: 172.17.0.1:18848 | |||
| server-addr: @nacos.host@:@nacos.port@ | |||
| namespace: @nacos.namespace@ | |||
| # 配置文件格式 | |||
| file-extension: yml | |||
| # 共享配置 | |||
| @@ -7,6 +7,7 @@ MAINTAINER xueyi | |||
| VOLUME /home/xueyi | |||
| # 创建目录 | |||
| RUN mkdir -p /home/xueyi | |||
| RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | |||
| # 指定路径 | |||
| WORKDIR /home/xueyi | |||
| # 复制jar文件到路径 | |||
| @@ -106,6 +106,20 @@ | |||
| </execution> | |||
| </executions> | |||
| </plugin> | |||
| <plugin> | |||
| <artifactId>maven-resources-plugin</artifactId> | |||
| <groupId>org.apache.maven.plugins</groupId> | |||
| <configuration> | |||
| <delimiters>@</delimiters> | |||
| <useDefaultDelimiters>false</useDefaultDelimiters> | |||
| </configuration> | |||
| </plugin> | |||
| </plugins> | |||
| <resources> | |||
| <resource> | |||
| <directory>src/main/resources</directory> | |||
| <filtering>true</filtering> | |||
| </resource> | |||
| </resources> | |||
| </build> | |||
| </project> | |||
| @@ -6,6 +6,7 @@ import com.xueyi.common.mqtt.annotation.MqttTopic; | |||
| import com.xueyi.common.mqtt.service.IMqttMessageHandler; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Value; | |||
| import org.springframework.messaging.Message; | |||
| import org.springframework.messaging.MessageHandler; | |||
| import org.springframework.messaging.MessagingException; | |||
| @@ -25,6 +26,9 @@ import java.util.Map; | |||
| @Component | |||
| public class MqttMessageHandle implements IMqttMessageHandler { | |||
| @Value("${spring.profiles.active}") | |||
| private String activeProfile; | |||
| private static final Logger log = LoggerFactory.getLogger(MqttMessageHandle.class); | |||
| // 包含 @MqttService注解 的类(Component) | |||
| @@ -51,6 +55,7 @@ public class MqttMessageHandle implements IMqttMessageHandler { | |||
| public void getMqttTopicService(Message<?> message){ | |||
| // 在这里 我们根据不同的 主题 分发不同的消息 | |||
| String receivedTopic = message.getHeaders().get("mqtt_receivedTopic",String.class); | |||
| log.info("receivedTopic = {},message = {}", receivedTopic ,message.getPayload()); | |||
| if(receivedTopic==null || "".equals(receivedTopic)){ | |||
| return; | |||
| } | |||
| @@ -63,7 +68,8 @@ public class MqttMessageHandle implements IMqttMessageHandler { | |||
| if (method.isAnnotationPresent(MqttTopic.class)){ | |||
| // 如果这个方法有 这个注解 | |||
| MqttTopic handleTopic = method.getAnnotation(MqttTopic.class); | |||
| if(isMatch(receivedTopic,handleTopic.value())){ | |||
| String topicName = "/" + "prod" + handleTopic.value(); | |||
| if(isMatch(receivedTopic,topicName)){ | |||
| // 并且 这个 topic 匹配成功 | |||
| try { | |||
| method.invoke(SpringUtils.getBean(clazz),message); | |||
| @@ -70,6 +70,11 @@ public class ApiController { | |||
| System.out.println("heartbeat: device: " + vo.getDevId() + " timestamp: " + sysTime); | |||
| Integer dex_res = 0; | |||
| // 根据设备id获取租户信息 | |||
| R<DmManDeviceDto> manDeviceDtoR = manDeviceService.manDeviceInfoInner(vo.getDevId()); | |||
| if (manDeviceDtoR.isFail()) { | |||
| return AjaxResult.warn("设备号获取失败,请检查"); | |||
| } | |||
| // 根据设备id获取租户信息 | |||
| R<SysEnterpriseDto> enterpriseDto = remoteStaffService.tenantIdInner(vo.getEnterpriseName()); | |||
| if (enterpriseDto.isFail()) { | |||
| return AjaxResult.warn("企业号获取失败,请检查"); | |||
| @@ -78,7 +83,7 @@ public class ApiController { | |||
| // 更新心跳 | |||
| redisTemplate.opsForValue().set("group:dgman:" + vo.getDevId() + ":" + MessageConstants.HEART_BEAT_SYNC,String.valueOf(sysTime)); | |||
| String timestamp = redisTemplate.opsForValue().get("group:dgman:" + enterpriseDto.getData().getId() + ":" + MessageConstants.STAFF_SYNC); | |||
| String timestamp = redisTemplate.opsForValue().get("group:dgman:" + manDeviceDtoR.getData().getTId() + ":" + MessageConstants.STAFF_SYNC); | |||
| if (timestamp != null && !timestamp.equalsIgnoreCase(vo.getTimestamp()) && Long.parseLong(timestamp) > Long.parseLong(vo.getTimestamp())) { | |||
| @@ -1,6 +1,6 @@ | |||
| # Tomcat | |||
| server: | |||
| port: 9700 | |||
| port: 9900 | |||
| # Spring | |||
| spring: | |||
| @@ -9,7 +9,7 @@ spring: | |||
| name: xueyi-message | |||
| profiles: | |||
| # 环境配置 | |||
| active: dev | |||
| active: @activatedProperties@ | |||
| servlet: | |||
| multipart: | |||
| max-request-size: 20MB | |||
| @@ -17,11 +17,15 @@ spring: | |||
| cloud: | |||
| nacos: | |||
| discovery: | |||
| # 服务注册地址 | |||
| server-addr: 172.17.0.1:18848 | |||
| server-addr: @nacos.host@:@nacos.port@ | |||
| namespace: @nacos.namespace@ | |||
| config: | |||
| # 配置中心地址 | |||
| server-addr: 172.17.0.1:18848 | |||
| server-addr: @nacos.host@:@nacos.port@ | |||
| namespace: @nacos.namespace@ | |||
| # 配置文件格式 | |||
| file-extension: yml | |||
| # 共享配置 | |||
| @@ -7,6 +7,7 @@ MAINTAINER xueyi | |||
| VOLUME /home/xueyi | |||
| # 创建目录 | |||
| RUN mkdir -p /home/xueyi | |||
| RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | |||
| # 指定路径 | |||
| WORKDIR /home/xueyi | |||
| # 复制jar文件到路径 | |||
| @@ -116,6 +116,20 @@ | |||
| </execution> | |||
| </executions> | |||
| </plugin> | |||
| <plugin> | |||
| <artifactId>maven-resources-plugin</artifactId> | |||
| <groupId>org.apache.maven.plugins</groupId> | |||
| <configuration> | |||
| <delimiters>@</delimiters> | |||
| <useDefaultDelimiters>false</useDefaultDelimiters> | |||
| </configuration> | |||
| </plugin> | |||
| </plugins> | |||
| <resources> | |||
| <resource> | |||
| <directory>src/main/resources</directory> | |||
| <filtering>true</filtering> | |||
| </resource> | |||
| </resources> | |||
| </build> | |||
| </project> | |||
| @@ -161,7 +161,7 @@ public class DmManDeviceServiceImpl extends BaseServiceImpl<DmManDeviceQuery, Dm | |||
| // 发送重启指令 | |||
| JSONObject message = new JSONObject(); | |||
| message.put("type",type); | |||
| mqttTemplate.sendToMqtt("/digital_man/" + devId + "/notify/restart", message.toJSONString()); | |||
| mqttTemplate.sendToMqtt("/prod/digital_man/" + devId + "/notify/restart", message.toJSONString()); | |||
| // 更新设备启动状态 | |||
| DmManDeviceDto dmManDeviceDto = new DmManDeviceDto(); | |||
| dmManDeviceDto.setManCode(devId); | |||
| @@ -299,7 +299,7 @@ public class DmExceptionLogController extends BaseController<DmExceptionLogQuery | |||
| JSONObject jsonObject = new JSONObject(); | |||
| jsonObject.put("devId", devId); | |||
| mqttTemplate.sendToMqtt("/digital_man"+"/"+devId+"/log_upload", jsonObject.toJSONString()); | |||
| mqttTemplate.sendToMqtt("/prod/digital_man"+"/"+devId+"/log_upload", jsonObject.toJSONString()); | |||
| return success("操作成功"); | |||
| } | |||
| @@ -143,6 +143,7 @@ public class DmVisitorInnerApiController extends BaseApiController { | |||
| Wrappers.<DmVisitorsPo>query().lambda() | |||
| .eq(DmVisitorsPo::getPhone, commonDto.getVisitorTel()).last(SqlConstants.LIMIT_ONE)); | |||
| } | |||
| System.err.println("exec===1"); | |||
| if (v == null) { | |||
| v = new DmVisitorsPo(); | |||
| v.setName(commonDto.getVisitorName()); | |||
| @@ -158,56 +159,68 @@ public class DmVisitorInnerApiController extends BaseApiController { | |||
| dmVisitorsMapper.updateById(v); | |||
| } | |||
| DmVisitRecordsPo visitRecords = new DmVisitRecordsPo(); | |||
| System.err.println("exec===2"); | |||
| try { | |||
| DmStaffPo emp = dmStaffMapper.selectOne( | |||
| Wrappers.<DmStaffPo>query().lambda() | |||
| .eq(DmStaffPo::getId, commonDto.getEmpId()).last(SqlConstants.LIMIT_ONE)); | |||
| System.err.println("exec===2111-"); | |||
| System.err.println(emp); | |||
| System.err.println("emp===end"); | |||
| System.err.println(commonDto); | |||
| if (ObjectUtils.isNotEmpty(emp)) { | |||
| visitRecords.setDeptId(emp.getDeptId()); | |||
| visitRecords.setVisitorId(v.getId()); | |||
| System.err.println("emp===111"); | |||
| if (StringUtils.isNotEmpty(commonDto.getVisitDate())) { | |||
| visitRecords.setVisitDate(DateUtils.parseStrToDate(commonDto.getVisitDate(), "yyyy-MM-dd")); | |||
| } | |||
| System.err.println("emp===2222"); | |||
| visitRecords.setUserId(commonDto.getEmpId()); | |||
| visitRecords.setRecordStatus(VisitRecordStatus.getRecordStatusStart()); | |||
| System.err.println("emp===333"); | |||
| String code = visitRecordsService.genVisitorCode(); | |||
| System.err.println("emp===444"); | |||
| visitRecords.setVisitorCode(code); | |||
| visitRecords.setReceiverName(commonDto.getEmpName()); | |||
| visitRecords.setReceiverPhone(commonDto.getEmpTel()); | |||
| System.err.println("emp===555"); | |||
| dmVisitRecordsMapper.insert(visitRecords); | |||
| System.err.println("exec===3--"+commonDto.getVisitorTel()); | |||
| JSONObject json = new JSONObject(); | |||
| if (null != commonDto.getVisitorTel()){ | |||
| DmVisitorSmsConfigPo dmVisitorSmsConfigPo = visitorSmsConfigMapper.selectOne(Wrappers.<DmVisitorSmsConfigPo>query().lambda().last(SqlConstants.LIMIT_ONE)); | |||
| DmDigitalmanPo dmDigitalmanPo = digitalmanMapper.selectByCode(digitalmanExtMapper.selectOne(Wrappers.<DmDigitalmanExtPo>query().lambda().eq(DmDigitalmanExtPo::getDeviceId, commonDto.getDevId()).last(SqlConstants.LIMIT_ONE)).getManCode()); | |||
| json.put("code", code); | |||
| json.put("nickName", commonDto.getVisitorName()); | |||
| json.put("robotName", dmDigitalmanPo.getName()); | |||
| json.put("dateTime", commonDto.getVisitDate()); | |||
| json.put("companyName", dmVisitorSmsConfigPo!=null?dmVisitorSmsConfigPo.getCompanyName():""); | |||
| json.put("companyAddr", dmVisitorSmsConfigPo!=null?dmVisitorSmsConfigPo.getCompanyAddress():""); | |||
| json.put("receiverName", commonDto.getEmpName()); | |||
| json.put("receiverPhone", commonDto.getEmpTel()); | |||
| json.put("parkInfo", dmVisitorSmsConfigPo!=null?dmVisitorSmsConfigPo.getParkPrompt():""); | |||
| //给访客发送短信 | |||
| SmsReqEntity send = new SmsReqEntity(); | |||
| System.err.println(json.toJSONString()); | |||
| System.err.println("exec===4"); | |||
| send.setPhone(commonDto.getVisitorTel()); | |||
| send.setTemplate(smsProperties.getVisitorTemplate()); | |||
| send.setDataMap(json.toJSONString()); | |||
| remoteSmsService.sendSms(send); | |||
| DmStaffPo emp = dmStaffMapper.selectOne( | |||
| Wrappers.<DmStaffPo>query().lambda() | |||
| .eq(DmStaffPo::getId, commonDto.getEmpId()).last(SqlConstants.LIMIT_ONE)); | |||
| if (ObjectUtils.isNotEmpty(emp)) { | |||
| visitRecords.setDeptId(emp.getDeptId()); | |||
| visitRecords.setVisitorId(v.getId()); | |||
| if (StringUtils.isNotEmpty(commonDto.getVisitDate())) { | |||
| visitRecords.setVisitDate(DateUtils.parseStrToDate(commonDto.getVisitDate(), "yyyy-MM-dd")); | |||
| } | |||
| visitRecords.setUserId(commonDto.getEmpId()); | |||
| visitRecords.setRecordStatus(VisitRecordStatus.getRecordStatusStart()); | |||
| String code = visitRecordsService.generateCode(); | |||
| visitRecords.setVisitorCode(code); | |||
| visitRecords.setReceiverName(commonDto.getEmpName()); | |||
| visitRecords.setReceiverPhone(commonDto.getEmpTel()); | |||
| dmVisitRecordsMapper.insert(visitRecords); | |||
| JSONObject json = new JSONObject(); | |||
| if (null != commonDto.getVisitorTel()){ | |||
| DmVisitorSmsConfigPo dmVisitorSmsConfigPo = visitorSmsConfigMapper.selectOne(Wrappers.<DmVisitorSmsConfigPo>query().lambda().last(SqlConstants.LIMIT_ONE)); | |||
| DmDigitalmanPo dmDigitalmanPo = digitalmanMapper.selectByCode(digitalmanExtMapper.selectOne(Wrappers.<DmDigitalmanExtPo>query().lambda().eq(DmDigitalmanExtPo::getDeviceId, commonDto.getDevId()).last(SqlConstants.LIMIT_ONE)).getManCode()); | |||
| json.put("code", code); | |||
| json.put("nickName", commonDto.getVisitorName()); | |||
| json.put("robotName", dmDigitalmanPo.getName()); | |||
| json.put("dateTime", commonDto.getVisitDate()); | |||
| json.put("companyName", dmVisitorSmsConfigPo!=null?dmVisitorSmsConfigPo.getCompanyName():""); | |||
| json.put("companyAddr", dmVisitorSmsConfigPo!=null?dmVisitorSmsConfigPo.getCompanyAddress():""); | |||
| json.put("receiverName", commonDto.getEmpName()); | |||
| json.put("receiverPhone", commonDto.getEmpTel()); | |||
| json.put("parkInfo", dmVisitorSmsConfigPo!=null?dmVisitorSmsConfigPo.getParkPrompt():""); | |||
| //给访客发送短信 | |||
| SmsReqEntity send = new SmsReqEntity(); | |||
| try { | |||
| send.setPhone(commonDto.getVisitorTel()); | |||
| send.setTemplate(smsProperties.getVisitorTemplate()); | |||
| send.setDataMap(json.toJSONString()); | |||
| remoteSmsService.sendSms(send); | |||
| } catch (Exception ee) { | |||
| ee.printStackTrace(); | |||
| } | |||
| } | |||
| } else { | |||
| return output(ResponseCode.DATA_NOT_EXISTS, "员工").toJSON(); | |||
| } else { | |||
| System.err.println("emp not exist"); | |||
| return output(ResponseCode.DATA_NOT_EXISTS, "员工").toJSON(); | |||
| } | |||
| } catch (Exception ee) { | |||
| ee.printStackTrace(); | |||
| } | |||
| @@ -10,10 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.data.redis.core.RedisTemplate; | |||
| import org.springframework.stereotype.Service; | |||
| import java.security.NoSuchAlgorithmException; | |||
| import java.security.SecureRandom; | |||
| import java.util.List; | |||
| import java.util.Random; | |||
| import java.util.concurrent.TimeUnit; | |||
| /** | |||
| @@ -33,7 +30,7 @@ public class DmVisitRecordsServiceImpl extends BaseServiceImpl<DmVisitRecordsQue | |||
| public String generateCode() { | |||
| try { | |||
| /*try { | |||
| Random random = SecureRandom.getInstanceStrong(); | |||
| StringBuilder codeBuilder = new StringBuilder(CODE_LENGTH); | |||
| @@ -44,10 +41,11 @@ public class DmVisitRecordsServiceImpl extends BaseServiceImpl<DmVisitRecordsQue | |||
| return codeBuilder.toString(); | |||
| } catch (NoSuchAlgorithmException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| }*/ | |||
| String timeStr = String.valueOf(System.currentTimeMillis()); | |||
| timeStr.substring(timeStr.length() - 4 ); | |||
| return null; | |||
| return timeStr.substring(timeStr.length() - 4 ); | |||
| } | |||
| public boolean storeCode(String code) { | |||
| @@ -78,7 +78,7 @@ public class DmReleaseManagerServiceImpl extends BaseServiceImpl<DmReleaseManage | |||
| jo.put("setupTime", dmApkVersionDto.getReleaseTime()); | |||
| jo.put("md5", ""); | |||
| // 2.向Mqtt发送消息 | |||
| mqttTemplate.sendToMqtt("/digital_man/" + dId + "/notify/apk_update", jo.toJSONString()); | |||
| mqttTemplate.sendToMqtt("/prod/digital_man/" + dId + "/notify/apk_update", jo.toJSONString()); | |||
| // 3. 更新setup_status字段并更新表 | |||
| dmReleaseManagerDto.setSetupStatus(MessageConstants.SYS_DICT_DATA_RELEASE_START_DOWNLOAD); | |||
| baseManager.update(dmReleaseManagerDto); | |||
| @@ -9,7 +9,7 @@ spring: | |||
| name: xueyi-system | |||
| profiles: | |||
| # 环境配置 | |||
| active: dev | |||
| active: @activatedProperties@ | |||
| servlet: | |||
| multipart: | |||
| max-request-size: 20MB | |||
| @@ -18,15 +18,14 @@ spring: | |||
| nacos: | |||
| discovery: | |||
| # 服务注册地址 | |||
| server-addr: 172.17.0.1:18848 | |||
| #server-addr: 39.107.77.235:18848 | |||
| # namespace: 6d0ee265-2a92-44cc-a6de-f34b3ea104e6 | |||
| server-addr: @nacos.host@:@nacos.port@ | |||
| namespace: @nacos.namespace@ | |||
| config: | |||
| # namespace: 6d0ee265-2a92-44cc-a6de-f34b3ea104e6 | |||
| # 配置中心地址 | |||
| #server-addr: 39.107.77.235:18848 | |||
| server-addr: 172.17.0.1:18848 | |||
| server-addr: @nacos.host@:@nacos.port@ | |||
| namespace: @nacos.namespace@ | |||
| # 配置文件格式 | |||
| file-extension: yml | |||
| # 共享配置 | |||
| @@ -7,6 +7,7 @@ MAINTAINER xueyi | |||
| VOLUME /home/xueyi | |||
| # 创建目录 | |||
| RUN mkdir -p /home/xueyi | |||
| RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | |||
| # 指定路径 | |||
| WORKDIR /home/xueyi | |||
| # 复制jar文件到路径 | |||
| @@ -81,6 +81,20 @@ | |||
| </execution> | |||
| </executions> | |||
| </plugin> | |||
| <plugin> | |||
| <artifactId>maven-resources-plugin</artifactId> | |||
| <groupId>org.apache.maven.plugins</groupId> | |||
| <configuration> | |||
| <delimiters>@</delimiters> | |||
| <useDefaultDelimiters>false</useDefaultDelimiters> | |||
| </configuration> | |||
| </plugin> | |||
| </plugins> | |||
| <resources> | |||
| <resource> | |||
| <directory>src/main/resources</directory> | |||
| <filtering>true</filtering> | |||
| </resource> | |||
| </resources> | |||
| </build> | |||
| </project> | |||
| @@ -9,7 +9,7 @@ spring: | |||
| name: xueyi-tenant | |||
| profiles: | |||
| # 环境配置 | |||
| active: dev | |||
| active: @activatedProperties@ | |||
| servlet: | |||
| multipart: | |||
| max-request-size: 20MB | |||
| @@ -18,10 +18,13 @@ spring: | |||
| nacos: | |||
| discovery: | |||
| # 服务注册地址 | |||
| server-addr: 172.17.0.1:18848 | |||
| server-addr: @nacos.host@:@nacos.port@ | |||
| namespace: @nacos.namespace@ | |||
| config: | |||
| # 配置中心地址 | |||
| server-addr: 172.17.0.1:18848 | |||
| server-addr: @nacos.host@:@nacos.port@ | |||
| namespace: @nacos.namespace@ | |||
| # 配置文件格式 | |||
| file-extension: yml | |||
| # 共享配置 | |||