Browse Source

微信消息订阅推送

tags/v1.0.0^2
chengwang 1 year ago
parent
commit
8d753bf39f
8 changed files with 57 additions and 57 deletions
  1. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/NoticeWeChatMiniProgramService.java
  2. +42
    -42
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/WxMessageRequest.java
  3. +1
    -1
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/entity/wx/WxMessageRequest.java
  4. +5
    -5
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WxServiceImpl.java
  5. +2
    -2
      tuoheng-service/tuoheng-miniprogram/src/main/resources/application-dev.yml
  6. +2
    -2
      tuoheng-service/tuoheng-miniprogram/src/main/resources/application-local.yml
  7. +2
    -2
      tuoheng-service/tuoheng-miniprogram/src/main/resources/application-prod.yml
  8. +2
    -2
      tuoheng-service/tuoheng-miniprogram/src/main/resources/application-test.yml

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/NoticeWeChatMiniProgramService.java View File

@@ -42,7 +42,7 @@ public class NoticeWeChatMiniProgramService {
jsonObject.put("inspectionId", inspection.getId());
jsonObject.put("questionName", questionType.getName());
jsonObject.put("questionDesc", questionType.getContent());
jsonObject.put("createTime", DateUtils.now());
jsonObject.put("createTime", DateUtils.dateTimeNow("yyyy-MM-dd HH:mm:ss"));

log.info("任务发现第一个问题,推送给微信小程序:url:{}", url);
log.info("任务发现第一个问题,推送给微信小程序:jsonObject:{}", jsonObject);

+ 42
- 42
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/WxMessageRequest.java View File

@@ -1,42 +1,42 @@
package com.tuoheng.admin.service.third.dsp;
import lombok.Data;
/**
* @Author ChengWang
* @Date 2023/6/26
*/
@Data
public class WxMessageRequest {
/**
* 租户id
*/
private String tenantId;
/**
* 任务id
*/
private String inspectionId;
/**
* 问题id
*/
private String questionId;
/**
* 问题标题
*/
private String questionName;
/**
* 问题描述
*/
private String questionDesc;
/**
* 上报时间
*/
private String createTime;
}
package com.tuoheng.admin.service.third.dsp;
import lombok.Data;
/**
* @Author ChengWang
* @Date 2023/6/26
*/
@Data
public class WxMessageRequest {
/**
* 租户id
*/
private String tenantId;
/**
* 任务id
*/
private String inspectionId;
/**
* 问题id
*/
private String questionId;
/**
* 问题标题
*/
private String questionName;
/**
* 问题描述
*/
private String questionDesc;
/**
* 上报时间
*/
private String createTime;
}

+ 1
- 1
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/entity/wx/WxMessageRequest.java View File

@@ -32,7 +32,7 @@ public class WxMessageRequest {
/**
*问题标题
*/
private String inspectionName;
private String questionName;

/**
* 问题描述

+ 5
- 5
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WxServiceImpl.java View File

@@ -185,7 +185,7 @@ public class WxServiceImpl implements IWxService {
ResponseEntity<String> responseEntity = null;
try {
data.put("time12",new TemplateMinDto(wxMessageRequest.getCreateTime()));
data.put("thing4",new TemplateMinDto(wxMessageRequest.getInspectionName()));
data.put("thing4",new TemplateMinDto(wxMessageRequest.getQuestionName()));
data.put("thing13",new TemplateMinDto(wxMessageRequest.getQuestionDesc()));
param.setData(data);

@@ -243,13 +243,13 @@ public class WxServiceImpl implements IWxService {
if(StringUtils.isEmpty(wxMessageRequest.getInspectionId())){
return JsonResult.error(WeiXinRequestEnum.INSPECTION_ID_IS_NULL.getCode(),WeiXinRequestEnum.INSPECTION_ID_IS_NULL.getMsg());
}
if(StringUtils.isEmpty(wxMessageRequest.getQuestionId())){
return JsonResult.error(WeiXinRequestEnum.QUESTION_ID_IS_NULL.getCode(),WeiXinRequestEnum.QUESTION_ID_IS_NULL.getMsg());
}
// if(StringUtils.isEmpty(wxMessageRequest.getQuestionId())){
// return JsonResult.error(WeiXinRequestEnum.QUESTION_ID_IS_NULL.getCode(),WeiXinRequestEnum.QUESTION_ID_IS_NULL.getMsg());
// }
if(StringUtils.isEmpty(wxMessageRequest.getCreateTime())){
return JsonResult.error(WeiXinRequestEnum.CREATE_TIME_IS_NULL.getCode(),WeiXinRequestEnum.CREATE_TIME_IS_NULL.getMsg());
}
if(StringUtils.isEmpty(wxMessageRequest.getInspectionName())){
if(StringUtils.isEmpty(wxMessageRequest.getQuestionName())){
return JsonResult.error(WeiXinRequestEnum.INSPECTION_NAME_NOT_EXIST.getCode(),WeiXinRequestEnum.INSPECTION_NAME_NOT_EXIST.getMsg());
}
if(StringUtils.isEmpty(wxMessageRequest.getQuestionDesc())){

+ 2
- 2
tuoheng-service/tuoheng-miniprogram/src/main/resources/application-dev.yml View File

@@ -81,8 +81,8 @@ tuoheng:
pilot-url: http://192.168.11.11:7011/pilot/web/
#airport配置地址
airport-url: http://192.168.11.22:9060
#微信小程序地址
minprogram-url: http://192.168.11.11:9151
#小程序配置地址
wechat-url: http://192.168.11.11:9151
# 文件配置
uploads:
#上传的服务器上的映射文件夹

+ 2
- 2
tuoheng-service/tuoheng-miniprogram/src/main/resources/application-local.yml View File

@@ -84,8 +84,8 @@ tuoheng:
pilot-url: http://192.168.11.11:7011/pilot/web/
#airport配置地址
airport-url: http://192.168.11.22:9060
#微信小程序地址
minprogram-url: https://telecomumale-miniprogram-test.t-aaron.com
#小程序配置地址
wechat-url: http://192.168.11.11:9151
# 文件配置
uploads:
#上传的服务器上的映射文件夹

+ 2
- 2
tuoheng-service/tuoheng-miniprogram/src/main/resources/application-prod.yml View File

@@ -81,8 +81,8 @@ tuoheng:
pilot-url: http://192.168.11.11:7011/pilot/web/
#airport配置地址
airport-url: https://airport.t-aaron.com
#微信小程序地址
minprogram-url: https://telecomumale-miniprogram.t-aaron.com
#小程序配置地址
wechat-url: https://telecomumale-miniprogram.t-aaron.com
# 文件配置
uploads:
#上传的服务器上的映射文件夹

+ 2
- 2
tuoheng-service/tuoheng-miniprogram/src/main/resources/application-test.yml View File

@@ -81,8 +81,8 @@ tuoheng:
pilot-url: http://192.168.11.11:7011/pilot/web/
#airport配置地址
airport-url: https://airport-test.t-aaron.com
#微信小程序地址
minprogram-url: https://telecomumale-miniprogram-test.t-aaron.com
#小程序配置地址
wechat-url: https://telecomumale-miniprogram-test.t-aaron.com
# 文件配置
uploads:
#上传的服务器上的映射文件夹

Loading…
Cancel
Save