|
@@ -6,6 +6,7 @@ import com.ruoyi.common.enums.FileType;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
|
|
+import com.ruoyi.common.utils.sms.SmsSenderUtils;
|
|
|
import com.ruoyi.common.utils.uuid.IdUtils;
|
|
import com.ruoyi.common.utils.uuid.IdUtils;
|
|
|
import com.ruoyi.flowable.common.constant.ProcessConstants;
|
|
import com.ruoyi.flowable.common.constant.ProcessConstants;
|
|
|
import com.ruoyi.flowable.common.constant.UUIDGenerator;
|
|
import com.ruoyi.flowable.common.constant.UUIDGenerator;
|
|
@@ -27,9 +28,11 @@ import org.flowable.task.api.Task;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -42,6 +45,8 @@ import java.util.*;
|
|
|
public class InvestmentOpportunityServiceImpl extends FlowServiceFactory implements IInvestmentOpportunityService
|
|
public class InvestmentOpportunityServiceImpl extends FlowServiceFactory implements IInvestmentOpportunityService
|
|
|
{
|
|
{
|
|
|
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
|
|
+ @Value("${spring.profiles.active}")
|
|
|
|
|
+ private String active;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private InvestmentOpportunityMapper investmentOpportunityMapper;
|
|
private InvestmentOpportunityMapper investmentOpportunityMapper;
|
|
|
|
|
|
|
@@ -220,8 +225,10 @@ public class InvestmentOpportunityServiceImpl extends FlowServiceFactory impleme
|
|
|
if (flowBaseInfo.isFlag()) {
|
|
if (flowBaseInfo.isFlag()) {
|
|
|
getAssignee(tProjectPool, flowBaseInfo);
|
|
getAssignee(tProjectPool, flowBaseInfo);
|
|
|
}
|
|
}
|
|
|
- //todo 短信
|
|
|
|
|
- //sendMessage(flowBaseInfo,"");
|
|
|
|
|
|
|
+ if (Objects.equals(active, "druid")) {
|
|
|
|
|
+ //todo 短信
|
|
|
|
|
+ sendMessage(flowBaseInfo,"");
|
|
|
|
|
+ }
|
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
|
}
|
|
}
|
|
|
return AjaxResult.error();
|
|
return AjaxResult.error();
|
|
@@ -391,8 +398,10 @@ public class InvestmentOpportunityServiceImpl extends FlowServiceFactory impleme
|
|
|
if(flow.isFlag()){
|
|
if(flow.isFlag()){
|
|
|
getAssignee(tProjectPool,flow);
|
|
getAssignee(tProjectPool,flow);
|
|
|
}
|
|
}
|
|
|
- //todo 短信
|
|
|
|
|
- //sendMessage(flow,result);
|
|
|
|
|
|
|
+ if (Objects.equals(active, "druid")) {
|
|
|
|
|
+ //todo 短信
|
|
|
|
|
+ sendMessage(flow,result);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
|
}
|
|
}
|
|
@@ -426,25 +435,23 @@ public class InvestmentOpportunityServiceImpl extends FlowServiceFactory impleme
|
|
|
String assignee = task.getAssignee();
|
|
String assignee = task.getAssignee();
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(assignee)) { // 给审批人发送短信
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(assignee)) { // 给审批人发送短信
|
|
|
SysUser auditUser = sysUserService.selectUserById(Long.valueOf(assignee));
|
|
SysUser auditUser = sysUserService.selectUserById(Long.valueOf(assignee));
|
|
|
- String auditContents = auditUser.getNickName() + ",您好。投资系统中" + projectPool.getProjectName() + "的项目机会流程待处理";
|
|
|
|
|
- System.out.println(auditContents);
|
|
|
|
|
|
|
+ String auditContents = auditUser.getNickName() + ",您好。投资系统中" + projectPool.getProjectName() + "的项目机会流程待处理,请查看!";
|
|
|
if (auditUser != null && StringUtils.isNotBlank(auditUser.getPhonenumber())) {
|
|
if (auditUser != null && StringUtils.isNotBlank(auditUser.getPhonenumber())) {
|
|
|
- /*try{
|
|
|
|
|
|
|
+ try{
|
|
|
SmsSenderUtils.sendSms(auditUser.getPhonenumber(), auditContents);
|
|
SmsSenderUtils.sendSms(auditUser.getPhonenumber(), auditContents);
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
logger.error("短信发送失败"+e.getMessage());
|
|
logger.error("短信发送失败"+e.getMessage());
|
|
|
- }*/
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} else { // 审批人驳回,给申请人发短信
|
|
} else { // 审批人驳回,给申请人发短信
|
|
|
- String rejectContents = applyUserInfo.getNickName()+",您好。你在投资系统中提交" + projectPool.getProjectName() + "的项目机会申请已审核,结果为【驳回】";
|
|
|
|
|
- System.out.println(rejectContents);
|
|
|
|
|
|
|
+ String rejectContents = applyUserInfo.getNickName()+",您好。你在投资系统中提交" + projectPool.getProjectName() + "的项目机会申请已审核,结果为【驳回】,请查看!";
|
|
|
if (applyUserInfo != null && StringUtils.isNotBlank(applyUserInfo.getPhonenumber())) {
|
|
if (applyUserInfo != null && StringUtils.isNotBlank(applyUserInfo.getPhonenumber())) {
|
|
|
- /*try{
|
|
|
|
|
- SmsSenderUtils.sendSms(rejectUser.getPhonenumber(), rejectContents);
|
|
|
|
|
|
|
+ try{
|
|
|
|
|
+ SmsSenderUtils.sendSms(applyUserInfo.getPhonenumber(), rejectContents);
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
logger.error("短信发送失败"+e.getMessage());
|
|
logger.error("短信发送失败"+e.getMessage());
|
|
|
- }*/
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -455,26 +462,24 @@ public class InvestmentOpportunityServiceImpl extends FlowServiceFactory impleme
|
|
|
if(flag) {
|
|
if(flag) {
|
|
|
// 审批完成,给申请人发短信
|
|
// 审批完成,给申请人发短信
|
|
|
//XXX,您好。你在投资系统中提交“XXX”的项目立项申请已审核,结果为【通过】/【驳回】/【观望】!
|
|
//XXX,您好。你在投资系统中提交“XXX”的项目立项申请已审核,结果为【通过】/【驳回】/【观望】!
|
|
|
- completeContents = applyUserInfo.getNickName()+",您好。你在投资系统中提交" +projectPool.getProjectName() + "的项目机会申请已审核,结果为【同意】";
|
|
|
|
|
- System.out.println(completeContents);
|
|
|
|
|
|
|
+ completeContents = applyUserInfo.getNickName()+",您好。你在投资系统中提交" +projectPool.getProjectName() + "的项目机会申请已审核,结果为【同意】,请查看!";
|
|
|
if (applyUserInfo != null && StringUtils.isNotBlank(applyUserInfo.getPhonenumber())) {
|
|
if (applyUserInfo != null && StringUtils.isNotBlank(applyUserInfo.getPhonenumber())) {
|
|
|
- /*try{
|
|
|
|
|
- SmsSenderUtils.sendSms(completeUser.getPhonenumber(), completeContents);
|
|
|
|
|
|
|
+ try{
|
|
|
|
|
+ SmsSenderUtils.sendSms(applyUserInfo.getPhonenumber(), completeContents);
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
logger.error("短信发送失败"+e.getMessage());
|
|
logger.error("短信发送失败"+e.getMessage());
|
|
|
- }*/
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}else{
|
|
}else{
|
|
|
if(StringUtils.isNotEmpty(result)){//代表是终止或者观望
|
|
if(StringUtils.isNotEmpty(result)){//代表是终止或者观望
|
|
|
- completeContents = applyUserInfo.getNickName()+",您好。你在投资系统中提交" +projectPool.getProjectName() + "的项目机会申请已审核,结果为"+result;
|
|
|
|
|
- System.out.println(completeContents);
|
|
|
|
|
|
|
+ completeContents = applyUserInfo.getNickName()+",您好。你在投资系统中提交" +projectPool.getProjectName() + "的项目机会申请已审核,结果为"+result+",请查看!";
|
|
|
if (applyUserInfo != null && StringUtils.isNotBlank(applyUserInfo.getPhonenumber())) {
|
|
if (applyUserInfo != null && StringUtils.isNotBlank(applyUserInfo.getPhonenumber())) {
|
|
|
- /*try{
|
|
|
|
|
- SmsSenderUtils.sendSms(completeUser.getPhonenumber(), completeContents);
|
|
|
|
|
- } catch (IOException e) {
|
|
|
|
|
- logger.error("短信发送失败"+e.getMessage());
|
|
|
|
|
- }*/
|
|
|
|
|
|
|
+ try{
|
|
|
|
|
+ SmsSenderUtils.sendSms(applyUserInfo.getPhonenumber(), completeContents);
|
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
|
+ logger.error("短信发送失败"+e.getMessage());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|