Commit e24ecea6 by guojuxing

基础服务审批通过进行发短信给超级管理员

parent 0ce7f327
......@@ -128,6 +128,12 @@
<artifactId>gic-marketing-process-api</artifactId>
<version>${gic-marketing-process-api}</version>
</dependency>
<!--开放平台-->
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-open-platform-api</artifactId>
<version>${gic-open-platform-api}</version>
</dependency>
</dependencies>
<build>
......
......@@ -3,6 +3,13 @@ package com.gic.finance.service.outer.impl;
import java.util.Date;
import java.util.List;
import com.gic.auth.dto.UserDTO;
import com.gic.auth.service.UserApiService;
import com.gic.marketing.process.api.service.sms.SmsSendApiService;
import com.gic.open.api.dto.ApplicationDTO;
import com.gic.open.api.dto.OrderDTO;
import com.gic.open.api.service.ApplicationApiService;
import com.gic.open.api.service.OrderApiService;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -40,6 +47,14 @@ public class TransferAccountsApprovalApiServiceImpl implements TransferAccountsA
private final static String SERVICE_NAME = "转账审批";
@Autowired
private TransferAccountsApprovalService transferAccountsApprovalService;
@Autowired
private OrderApiService orderApiService;
@Autowired
private ApplicationApiService applicationApiService;
@Autowired
private SmsSendApiService smsSendApiService;
@Autowired
private UserApiService userApiService;
/**
* 发起审批
......@@ -156,6 +171,55 @@ public class TransferAccountsApprovalApiServiceImpl implements TransferAccountsA
callBack(tab);
transferAccountsApprovalService.updateTransferAccountsApproval(dto);
//如果是商户基础服务,则进行短信发送给超级管理员
if (tab.getOrderType().intValue() == OrderTypeEnum.SERVICE.getCode()) {
//服务类型
String orderNum = tab.getOrderNumber();
ServiceResponse<OrderDTO> orderResult = orderApiService.getOrderForFinance(orderNum);
if (!orderResult.isSuccess()) {
LOGGER.warn("财务审批通过-服务订单信息结果:{}, {}", orderResult.getCode(), orderResult.getMessage());
}
OrderDTO orderDTO = orderResult.getResult();
Long applicationId = orderDTO.getApplicationId();
ServiceResponse<ApplicationDTO> applicationResult = applicationApiService.getApplicationSimpleByApplicationId(applicationId);
if (!applicationResult.isSuccess()) {
LOGGER.warn("财务审批通过-应用信息结果:{}, {}", applicationResult.getCode(), applicationResult.getMessage());
}
if ("gic".equals(applicationResult.getResult().getModuleCode())) {
//是基础服务
ServiceResponse<UserDTO> userResult = userApiService.getUserByEnterpriseId(tab.getEnterpriseId());
UserDTO userDTO = userResult.getResult();
Integer relationOrderType = orderDTO.getOrderType();
String operationName = "开通";
switch (relationOrderType) {
case 1:
operationName = "开通";
break;
case 2:
operationName = "续费";
break;
case 3:
operationName = "升级";
break;
case 4:
operationName = "扩容";
break;
default:
}
String[] smsArr = new String[]{tab.getEnterpriseName(), operationName};
if (userResult.isSuccess()) {
ServiceResponse<Void> smsSendResult = smsSendApiService.sendPlatformSms("GICJFZX004",
tab.getEnterpriseId(),
userDTO.getPhoneAreaCode(), userDTO.getPhoneNumber(), smsArr);
if (!smsSendResult.isSuccess()) {
LOGGER.warn(smsSendResult.getMessage());
}
}
} else {
LOGGER.warn("财务审批通过-不是基础服务");
}
}
return ServiceResponse.success();
}
......
......@@ -31,4 +31,7 @@
<dubbo:reference interface="com.gic.marketing.process.api.service.sms.SmsSendApiService" id="smsSendApiService" timeout="60000" />
<!--用户-->
<dubbo:reference interface="com.gic.auth.service.UserApiService" id="userApiService" timeout="60000" />
<!--开放给平台订单详情-->
<dubbo:reference interface="com.gic.open.api.service.OrderApiService" id="orderApiService" timeout="60000" />
<dubbo:reference interface="com.gic.open.api.service.ApplicationApiService" id="applicationApiService" timeout="60000" />
</beans>
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