|
|
@@ -175,7 +175,7 @@ public class AsyncUtils {
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
- * @param type 发送对象 0营销管理员 1 通知所有人
|
|
|
+ * @param type 发送对象 0发起营销管理员 1 完成通知所有人 2拒绝发送给营销员
|
|
|
* @param sotpType 发送对象 类型 0=项目暂停,1=项目重启
|
|
|
*
|
|
|
*/
|
|
|
@@ -183,9 +183,11 @@ public class AsyncUtils {
|
|
|
Integer noticeType=0;
|
|
|
if (task==null)task = tOrderTaskMapper.selectByPrimaryKey(Integer.valueOf(ids.split(",")[0]));
|
|
|
TOrderNewBo tOrderNew = tOrderNewMapper.getOrderNewDetail(task.getOrderNo());
|
|
|
+ List<Notice> notes=new ArrayList<>();
|
|
|
+ StringBuffer emails=new StringBuffer();
|
|
|
if (type==0){
|
|
|
noticeType=sotpType==0?NoticeStatus.PROJECT_SOPT_START.getCode() :NoticeStatus.PROJECT_RENEW_START.getCode();
|
|
|
- String str=String.format("客户名称[%s]订单编号[%s]项目编号[%s],请及时审核",tOrderNew.getUserName(),task.getOrderNo(),ids);
|
|
|
+ String str=String.format("客户名称[%s]订单编号[%s]项目编号[%s],请及时审核。",tOrderNew.getUserName(),task.getOrderNo(),ids);
|
|
|
List<Admin> admins = adminMapper.listAdminBydepIdAndRoleType(tOrderNew.getOrderDep(),AFTConstants.SALESMAN_ADMIN);
|
|
|
for (Admin admin : admins) {
|
|
|
addNotic( noticeType,admin.getId(), str);
|
|
|
@@ -194,43 +196,60 @@ public class AsyncUtils {
|
|
|
}else if(type==1){
|
|
|
String str=String.format("客户名称[%s]订单编号[%s]项目编号[%s],已%s请悉知。",tOrderNew.getUserName(),task.getOrderNo(),task.getId(),sotpType==1?"恢复":"暂停");
|
|
|
noticeType=sotpType==0?NoticeStatus.PROJECT_SOPT_YES.getCode() :NoticeStatus.PROJECT_RENEW_YES.getCode();
|
|
|
- List<String> list = new ArrayList<>();
|
|
|
- List<Notice> notes=new ArrayList<>();
|
|
|
OrderOperator orderOperator = tOrderTaskMapper.selectAidByParam(task.getId());
|
|
|
- StringBuffer emails=new StringBuffer();
|
|
|
- if (task.getConsultantId()!=null){
|
|
|
- pushParam(task.getConsultantId(), noticeType, str, notes, emails);
|
|
|
+ List<String >aids=new ArrayList<>();
|
|
|
+ if (orderOperator.getSalesmanId()!=null&&!aids.contains(orderOperator.getFinanceId())){
|
|
|
+ aids.add(orderOperator.getSalesmanId());
|
|
|
}
|
|
|
- if (task.getManagerId()!=null){
|
|
|
- pushParam(task.getManagerId(), noticeType, str, notes, emails);
|
|
|
+ if (task.getConsultantId()!=null&&!aids.contains(task.getConsultantId())){
|
|
|
+ aids.add(task.getConsultantId());
|
|
|
}
|
|
|
-
|
|
|
- if (orderOperator.getFinanceId()!=null){
|
|
|
- pushParam(orderOperator.getFinanceId(), noticeType, str, notes, emails);
|
|
|
-
|
|
|
+ if (task.getManagerId()!=null&&!aids.contains(task.getManagerId())){
|
|
|
+ aids.add(task.getManagerId());
|
|
|
}
|
|
|
- if (orderOperator.getSalesmanId()!=null){
|
|
|
- pushParam(orderOperator.getSalesmanId(), noticeType, str, notes, emails);
|
|
|
+ if (orderOperator.getFinanceId()!=null&&!aids.contains(orderOperator.getFinanceId())){
|
|
|
+ aids.add(orderOperator.getFinanceId());
|
|
|
}
|
|
|
List<Admin> cwgly = adminMapper.selectAdminByRoleType(AFTConstants.FINANCE_ADMIN);
|
|
|
for (Admin admin : cwgly) {
|
|
|
- pushParam(orderOperator.getSalesmanId(), noticeType, str, notes, emails);
|
|
|
+ if (!aids.contains(admin.getId())){
|
|
|
+ aids.add(admin.getId());
|
|
|
+ }
|
|
|
}
|
|
|
List<Admin> zxsgly = adminMapper.selectAdminByRoleType(AFTConstants.TECH_ADMIN);
|
|
|
for (Admin admin : zxsgly) {
|
|
|
- pushParam(admin, noticeType, str, notes, emails);
|
|
|
+ if (!aids.contains(admin.getId())){
|
|
|
+ aids.add(admin.getId());
|
|
|
+ }
|
|
|
}
|
|
|
List<Admin> zc = adminMapper.selectAdminByRoleType(AFTConstants.CED);
|
|
|
for (Admin admin : zc) {
|
|
|
- pushParam(admin, noticeType, str, notes, emails);
|
|
|
+ if (!aids.contains(admin.getId())){
|
|
|
+ aids.add(admin.getId());
|
|
|
+ }
|
|
|
}
|
|
|
List<Admin> dsz = adminMapper.selectAdminByRoleType(AFTConstants.APPROVAL_DECISION);
|
|
|
for (Admin admin : dsz) {
|
|
|
- pushParam(admin, noticeType, str, notes, emails);
|
|
|
+ if (!aids.contains(admin.getId())){
|
|
|
+ aids.add(admin.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!aids.isEmpty()){
|
|
|
+ for (String aid : aids) {
|
|
|
+ pushParam( aid, noticeType, str, notes, emails);
|
|
|
+ }
|
|
|
}
|
|
|
System.out.println("========================"+emails.substring(0,emails.length()-1));
|
|
|
noticeMapper.insertBatch(notes);
|
|
|
send(new EmailBo(NoticeStatus.getValueByCode(noticeType),emails.substring(0,emails.length()-1),str));
|
|
|
+ }else if (type==2){
|
|
|
+ noticeType=sotpType==0?NoticeStatus.PROJECT_SOPT_NO.getCode() :NoticeStatus.PROJECT_RENEW_NO.getCode();
|
|
|
+ String str=String.format("客户名称[%s]订单编号[%s]项目编号[%s],已经被驳回。",tOrderNew.getUserName(),task.getOrderNo(),task.getId());
|
|
|
+ if (tOrderNew.getSalesmanId()!=null){
|
|
|
+ Admin admin = adminMapper.selectByPrimaryKey(tOrderNew.getSalesmanId());
|
|
|
+ addNotic( noticeType,admin.getId(), str);
|
|
|
+ send(new EmailBo(NoticeStatus.getValueByCode(noticeType),admin.getEmail(),str));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|