Commit eb9b9252 authored by huyuchen's avatar huyuchen

优化修改

parent ef53beaa
......@@ -61,8 +61,8 @@ public class TBusWarningController {
*/
@Operation(summary = "获取所有要自动发送的主表,以及人员信息进行定时任务发送", description = "获取所有要自动发送的主表,以及人员信息进行定时任务发送")
@PostMapping("/inner/doBatchSendBusSms")
public R<Boolean> doBatchSendBusSms() {
return tBusWarningService.doBatchSendBusSms();
public void doBatchSendBusSms() {
tBusWarningService.doBatchSendBusSms();
}
/**
......@@ -74,8 +74,8 @@ public class TBusWarningController {
*/
@Operation(summary = "更新当日所有发送的短信状态", description = "更新当日所有发送的短信状态")
@PostMapping("/inner/doUpdateSendBusSmsStatus")
public R<Boolean> doUpdateSendBusSmsStatus() {
return tBusWarningService.doUpdateSendBusSmsStatus(DateUtil.getCurrentDateString(DateUtil.ISO_DATE_FORMAT));
public void doUpdateSendBusSmsStatus() {
tBusWarningService.doUpdateSendBusSmsStatus(DateUtil.getCurrentDateString(DateUtil.ISO_DATE_FORMAT));
}
}
......@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.business.entity.system.TBusWarning;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
/**
* B端预警表
......@@ -27,17 +26,17 @@ public interface TBusWarningService extends IService<TBusWarning> {
* @Description: 获取所有要自动发送的主表,以及人员信息进行定时任务发送短信
* @Author: hgw
* @Date: 2021/8/25 11:32
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @return:
**/
R<Boolean> doBatchSendBusSms();
void doBatchSendBusSms();
/**
* @param dateStr
* @Description: 更新当日所有发送的短信状态
* @Author: hgw
* @Date: 2021/8/25 11:32
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @return:
**/
R<Boolean> doUpdateSendBusSmsStatus(String dateStr);
void doUpdateSendBusSmsStatus(String dateStr);
}
......@@ -13,7 +13,6 @@ import com.yifu.cloud.plus.v1.business.service.system.TBusWarningService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
......@@ -56,7 +55,7 @@ public class TBusWarningServiceImpl extends ServiceImpl<TBusWarningMapper, TBusW
* @Date 2021-8-23 16:47:44
*/
@Override
public R<Boolean> doBatchSendBusSms() {
public void doBatchSendBusSms() {
List<TBusWarning> smsInfoList = this.getTBusWarningListByAuto();
if (Common.isNotNull(smsInfoList)) {
List<TBusWarningEmployee> smsEmployeeList;
......@@ -65,7 +64,6 @@ public class TBusWarningServiceImpl extends ServiceImpl<TBusWarningMapper, TBusW
this.doSendOne(smsEmployeeList, smsInfo);
}
}
return R.ok(null,CommonConstants.RESULT_DATA_SUCESS);
}
private void doSendOne(List<TBusWarningEmployee> smsEmployeeList, TBusWarning smsInfo) {
......@@ -125,7 +123,7 @@ public class TBusWarningServiceImpl extends ServiceImpl<TBusWarningMapper, TBusW
* @Date 2021-8-23 16:47:52
*/
@Override
public R<Boolean> doUpdateSendBusSmsStatus(String dateStr) {
public void doUpdateSendBusSmsStatus(String dateStr) {
List<TBusWarningEmployee> smsEmployeeList = busWarningEmployeeService.getTBusWarningEmployeeListToday(dateStr);
if (Common.isNotNull(smsEmployeeList)) {
QuerySendResult res;
......@@ -142,7 +140,6 @@ public class TBusWarningServiceImpl extends ServiceImpl<TBusWarningMapper, TBusW
}
}
busWarningEmployeeService.updateBatchById(smsEmployeeList);
return R.ok(null,CommonConstants.RESULT_DATA_SUCESS);
}
/**
......
package com.yifu.cloud.plus.v1.yifu.common.dapr.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/**
* @Author hgw
* @Date 2022-7-27 19:38:08
* @Description
* @Version 1.0
*/
@Data
@Component
@PropertySource("classpath:daprConfig.properties")
@ConfigurationProperties(value = "dapr.business", ignoreInvalidFields = false)
public class DaprBusinessProperties {
/*
* @author fxj
* @date 14:34
* @Description dapr sidercar url 如:http://localhost:3005/v1.0/invoke/
**/
String appUrl;
/*
* @author fxj
* @date 14:35
* @decription app_id 如:"yifu_upms_sider"
**/
String appId;
String appPort;
String httpPort;
String grpcPort;
String metricsPort;
}
......@@ -21,4 +21,8 @@ dapr.salary.appId=yifu-salary
#\u6D4B\u8BD5\u73AF\u5883-\u793E\u4FDD\u670D\u52A1
dapr.social.appUrl=http://yifu-social.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.social.appId=yifu-social
\ No newline at end of file
dapr.social.appId=yifu-social
#\u6D4B\u8BD5\u73AF\u5883-B\u7AEF\u670D\u52A1
dapr.business.appUrl=http://yifu-business.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.business.appId=yifu-business
\ No newline at end of file
package com.yifu.cloud.plus.v1.job.compont; import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprBusinessProperties;import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;import lombok.extern.slf4j.Slf4j;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.boot.context.properties.EnableConfigurationProperties;import org.springframework.stereotype.Component; /** * @author wangweiguo * @description hrob端微服务定时任务 * @date 22:31 2021/8/17 **/@Component(value = "businessTask")@Slf4j@EnableConfigurationProperties(DaprBusinessProperties.class)public class BusinessTask { @Autowired private DaprBusinessProperties daprBusinessProperties;// // /** // * @author wangweiguo // * @description 每天初始化年假信息 // * @date 22:35 2021/8/17 // * @return void // **/ // public void buildMonitorData() { // remoteVacationMonitorService.buildMonitorData(SecurityConstants.FROM_IN); // } // /** // * @author fxj // * @description 每天更新证件状态 // * @date 2021-08-23 // * @return void // **/ // public void updateCertStatusTask() { // log.info("------------扫描定时任务开始:定时更新B端证据状态信息开始------------"); // remoteBusinessService.updateCertStatusTask(SecurityConstants.FROM_IN); // log.info("------------扫描定时任务开始:定时更新B端证据状态信息结束------------"); // } /** * @Description: 发送短信定时任务 * @Author: hgw * @Date: 2021/8/25 9:35 * @return: void **/ public void doBatchSendBusSms(){ log.info("------------发送短信定时任务-开始------------"); HttpDaprUtil.invokeMethodPost(daprBusinessProperties.getAppUrl(), daprBusinessProperties.getAppId(), "/tbuswarning/inner/doBatchSendBusSms", "", Object.class, SecurityConstants.FROM_IN); log.info("------------发送短信定时任务-结束------------"); } /** * @Description: 短信状态更新定时任务 * @Author: hgw * @Date: 2021/8/25 9:35 * @return: void **/ public void doUpdateSendBusSmsStatus(){ log.info("------------短信状态更新定时任务-开始------------"); HttpDaprUtil.invokeMethodPost(daprBusinessProperties.getAppUrl(), daprBusinessProperties.getAppId(), "/tbuswarning/inner/doUpdateSendBusSmsStatus", "", Object.class, SecurityConstants.FROM_IN); log.info("------------短信状态更新定时任务-结束------------"); } }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment