设置收费通知发送邮件消息
This commit is contained in:
+2
-2
@@ -32,8 +32,8 @@ public enum CompanyMessageEnums {
|
|||||||
MSG18("QY_18_JFTZ_VOUCHER_CHECK","缴费通知","projectName"),//进入缴费凭证的页面 projectName
|
MSG18("QY_18_JFTZ_VOUCHER_CHECK","缴费通知","projectName"),//进入缴费凭证的页面 projectName
|
||||||
MSG19("QY_19_HYTZ_CANCELLATION","合同通知","contractNum,contractName"),//合同列表页 contractNum,contractName
|
MSG19("QY_19_HYTZ_CANCELLATION","合同通知","contractNum,contractName"),//合同列表页 contractNum,contractName
|
||||||
MSG20("QY_20_HYTZ_NOT_AUDIT_CREATE","项目通知","projectName,"),//项目详情页/弹框 projectName
|
MSG20("QY_20_HYTZ_NOT_AUDIT_CREATE","项目通知","projectName,"),//项目详情页/弹框 projectName
|
||||||
MSG21("QY_21_HYTZ_NOT_AUDIT_CREATE","合同通知","contractNum,contractName");//合同列表页 contractNum,contractName 对应原型的序号19
|
MSG21("QY_21_HYTZ_NOT_AUDIT_CREATE","合同通知","contractNum,contractName"),//合同列表页 contractNum,contractName 对应原型的序号19
|
||||||
|
MSG22("QY_22_WJTZ_DEND_FILE","文件通知","projectName");// 弹窗:查看该项目详情,projectName
|
||||||
|
|
||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ public enum MessageUrlEnums {
|
|||||||
C_OPEN_TYPE18("C_OPEN_TYPE18","url","/MessagePage/PaymentVoucher"),
|
C_OPEN_TYPE18("C_OPEN_TYPE18","url","/MessagePage/PaymentVoucher"),
|
||||||
C_OPEN_TYPE19("C_OPEN_TYPE19","url","/mineContract/MineContract"),
|
C_OPEN_TYPE19("C_OPEN_TYPE19","url","/mineContract/MineContract"),
|
||||||
C_OPEN_TYPE20("C_OPEN_TYPE20","project",""),
|
C_OPEN_TYPE20("C_OPEN_TYPE20","project",""),
|
||||||
C_OPEN_TYPE21("C_OPEN_TYPE21","url","/mineContract/MineContract");
|
C_OPEN_TYPE21("C_OPEN_TYPE21","url","/mineContract/MineContract"),
|
||||||
|
C_OPEN_TYPE22("C_OPEN_TYPE22","component","MessagePage/ProjectDetailModal");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+13
-3
@@ -84,7 +84,8 @@ public class SendMessageServiceImpl implements SendMessageService {
|
|||||||
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG7.getCode())
|
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG7.getCode())
|
||||||
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG12.getCode())
|
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG12.getCode())
|
||||||
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG20.getCode())
|
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG20.getCode())
|
||||||
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG21.getCode())){
|
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG21.getCode())
|
||||||
|
| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG22.getCode())){
|
||||||
map.put("systemAddress",env.getProperty("message.systemUrl"));
|
map.put("systemAddress",env.getProperty("message.systemUrl"));
|
||||||
map.put("wxName",env.getProperty("message.wxName"));
|
map.put("wxName",env.getProperty("message.wxName"));
|
||||||
}
|
}
|
||||||
@@ -104,7 +105,7 @@ public class SendMessageServiceImpl implements SendMessageService {
|
|||||||
LoginUser loginUser = sysBaseAPI.getUserByName(fromUser);
|
LoginUser loginUser = sysBaseAPI.getUserByName(fromUser);
|
||||||
if(templateType.contains(ProjectCommon.MESSAGE_TYPE2)){
|
if(templateType.contains(ProjectCommon.MESSAGE_TYPE2)){
|
||||||
if(StringUtils.isEmpty(sendMessageDTO.getEmail())){
|
if(StringUtils.isEmpty(sendMessageDTO.getEmail())){
|
||||||
throw new JeroBootException("发送邮件,邮箱地址不能为空!");
|
throw new JeroBootException("邮件发送,邮箱地址不能为空!");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
String email = loginUser.getEmail();
|
String email = loginUser.getEmail();
|
||||||
@@ -218,7 +219,10 @@ public class SendMessageServiceImpl implements SendMessageService {
|
|||||||
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG4.getCode())
|
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG4.getCode())
|
||||||
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG6.getCode())
|
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG6.getCode())
|
||||||
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG7.getCode())
|
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG7.getCode())
|
||||||
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG12.getCode())){
|
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG12.getCode())
|
||||||
|
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG20.getCode())
|
||||||
|
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG21.getCode())
|
||||||
|
|| Objects.equals(sendMessageDTO.getTemplateCode(),CompanyMessageEnums.MSG22.getCode())){
|
||||||
// 短信去掉系统url替换与小程序名称替换
|
// 短信去掉系统url替换与小程序名称替换
|
||||||
if(map.containsKey("systemAddress")){
|
if(map.containsKey("systemAddress")){
|
||||||
map.remove("systemAddress");
|
map.remove("systemAddress");
|
||||||
@@ -471,6 +475,12 @@ public class SendMessageServiceImpl implements SendMessageService {
|
|||||||
signature = "中汽中心标准所";
|
signature = "中汽中心标准所";
|
||||||
templateId = "c6608053b3a2482bb3db7c00820bbd4a";
|
templateId = "c6608053b3a2482bb3db7c00820bbd4a";
|
||||||
break;
|
break;
|
||||||
|
case "QY_22_WJTZ_DEND_FILE":
|
||||||
|
// 中汽中心标准所-企业端-文件通知-22
|
||||||
|
sender = "8821092414406";
|
||||||
|
signature = "中汽中心标准所";
|
||||||
|
templateId = ""; // todo 模板id没有确定
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new JeroBootException("codeType flase.");
|
throw new JeroBootException("codeType flase.");
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -461,8 +461,8 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
|
|||||||
@ApiOperation(value = "工作组成员-设置收费通知", notes = "工作组成员-设置收费通知")
|
@ApiOperation(value = "工作组成员-设置收费通知", notes = "工作组成员-设置收费通知")
|
||||||
@PostMapping(value = "/setCharge")
|
@PostMapping(value = "/setCharge")
|
||||||
public Result<?> setCharge(@RequestBody SetChargeInput input) {
|
public Result<?> setCharge(@RequestBody SetChargeInput input) {
|
||||||
payWorkingGroupSubItemService.setCharge(input);
|
List<String> list = payWorkingGroupSubItemService.setCharge(input);
|
||||||
return Result.OK("设置收费通知成功!");
|
return Result.OK("设置收费通知成功!",list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -540,4 +540,4 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-7
@@ -2,13 +2,11 @@ package com.jero.project.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.jero.project.entity.PayWorkGroupSubletStatistics;
|
import com.jero.project.entity.PayWorkGroupSubletStatistics;
|
||||||
import com.jero.project.entity.PayWorkingGroupSubItem;
|
import com.jero.project.entity.PayWorkingGroupSubItem;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.jero.project.entity.PayWorkingGroupSubletSearch;
|
import com.jero.project.entity.PayWorkingGroupSubletSearch;
|
||||||
import com.jero.project.vo.SetChargeInput;
|
import com.jero.project.vo.SetChargeInput;
|
||||||
import com.jero.statistics.entity.AllProjectStatistics;
|
|
||||||
import com.jero.statistics.entity.AllProjectStatisticsSearch;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -25,9 +23,9 @@ public interface IPayWorkingGroupSubItemService extends IService<PayWorkingGroup
|
|||||||
* @Description 分页查询
|
* @Description 分页查询
|
||||||
* @Author lqt
|
* @Author lqt
|
||||||
* @Date 2021/9/2
|
* @Date 2021/9/2
|
||||||
* @Param
|
* @Param
|
||||||
* @Return
|
* @Return
|
||||||
* @Exception
|
* @Exception
|
||||||
*/
|
*/
|
||||||
IPage<PayWorkingGroupSubItem> queryPageList(Page<PayWorkingGroupSubItem> page,PayWorkingGroupSubItem payWorkingGroupSubitem,String paymentDate);
|
IPage<PayWorkingGroupSubItem> queryPageList(Page<PayWorkingGroupSubItem> page,PayWorkingGroupSubItem payWorkingGroupSubitem,String paymentDate);
|
||||||
/**
|
/**
|
||||||
@@ -109,5 +107,5 @@ public interface IPayWorkingGroupSubItemService extends IService<PayWorkingGroup
|
|||||||
* @Return
|
* @Return
|
||||||
* @Exception
|
* @Exception
|
||||||
*/
|
*/
|
||||||
void setCharge(SetChargeInput input);
|
List<String> setCharge(SetChargeInput input);
|
||||||
}
|
}
|
||||||
|
|||||||
+226
-3
@@ -8,12 +8,16 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.jero.common.common.ProjectCommon;
|
import com.jero.common.common.ProjectCommon;
|
||||||
import com.jero.common.dto.PaySendContactsMessageDTO;
|
import com.jero.common.dto.PaySendContactsMessageDTO;
|
||||||
|
import com.jero.common.dto.SendMessageDTO;
|
||||||
|
import com.jero.common.enums.CompanyMessageEnums;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.common.service.ContractCreateProjectSendMessageService;
|
import com.jero.common.service.ContractCreateProjectSendMessageService;
|
||||||
import com.jero.common.service.ProjectDetailService;
|
import com.jero.common.service.ProjectDetailService;
|
||||||
import com.jero.common.service.RolePermissionService;
|
import com.jero.common.service.RolePermissionService;
|
||||||
|
import com.jero.common.service.SendMessageService;
|
||||||
import com.jero.common.system.vo.LoginUser;
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.common.util.ImportExcelUtil;
|
import com.jero.common.util.ImportExcelUtil;
|
||||||
|
import com.jero.common.util.PasswordUtil;
|
||||||
import com.jero.common.util.ValidUtil;
|
import com.jero.common.util.ValidUtil;
|
||||||
import com.jero.common.vo.ProjectStatusVO;
|
import com.jero.common.vo.ProjectStatusVO;
|
||||||
import com.jero.company.entity.PayCompanyManagement;
|
import com.jero.company.entity.PayCompanyManagement;
|
||||||
@@ -26,6 +30,10 @@ import com.jero.contract.service.IPayIncomeContractAssociatedService;
|
|||||||
import com.jero.contract.service.IPayIncomeContractService;
|
import com.jero.contract.service.IPayIncomeContractService;
|
||||||
import com.jero.meeting.entity.PayMeetingRemindRecord;
|
import com.jero.meeting.entity.PayMeetingRemindRecord;
|
||||||
import com.jero.meeting.service.IPayMeetingRemindRecordService;
|
import com.jero.meeting.service.IPayMeetingRemindRecordService;
|
||||||
|
import com.jero.modules.oss.entity.OSSFile;
|
||||||
|
import com.jero.modules.oss.service.IOSSFileService;
|
||||||
|
import com.jero.modules.system.entity.SysUser;
|
||||||
|
import com.jero.modules.system.service.ISysUserService;
|
||||||
import com.jero.pack.entity.PayPackCompanyProject;
|
import com.jero.pack.entity.PayPackCompanyProject;
|
||||||
import com.jero.pack.service.IPayPackCompanyProjectService;
|
import com.jero.pack.service.IPayPackCompanyProjectService;
|
||||||
import com.jero.payment.service.IPayPaymentCheckService;
|
import com.jero.payment.service.IPayPaymentCheckService;
|
||||||
@@ -49,6 +57,7 @@ import org.apache.shiro.SecurityUtils;
|
|||||||
import org.jeecgframework.poi.excel.ExcelImportCheckUtil;
|
import org.jeecgframework.poi.excel.ExcelImportCheckUtil;
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
@@ -56,6 +65,7 @@ import org.springframework.web.multipart.MultipartHttpServletRequest;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.File;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -100,6 +110,14 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
private RolePermissionService rolePermissionService;
|
private RolePermissionService rolePermissionService;
|
||||||
@Resource
|
@Resource
|
||||||
private IPayPaymentCheckService payPaymentCheckService;
|
private IPayPaymentCheckService payPaymentCheckService;
|
||||||
|
@Resource
|
||||||
|
private ISysUserService sysUserService;
|
||||||
|
@Resource
|
||||||
|
private SendMessageService sendMessageService;
|
||||||
|
@Resource
|
||||||
|
private IOSSFileService iossFileService;
|
||||||
|
@Resource
|
||||||
|
private Environment env;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -170,6 +188,13 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
payWorkingGroupSubItem.setMail(PayProjectCommon.MAIL0);
|
payWorkingGroupSubItem.setMail(PayProjectCommon.MAIL0);
|
||||||
payWorkingGroupSubItem.setChargeUse(PayProjectCommon.CHARGE_USE1);
|
payWorkingGroupSubItem.setChargeUse(PayProjectCommon.CHARGE_USE1);
|
||||||
payWorkingGroupSubItemService.save(payWorkingGroupSubItem);
|
payWorkingGroupSubItemService.save(payWorkingGroupSubItem);
|
||||||
|
List<String> listFile = new ArrayList<>();
|
||||||
|
// 获取收费通知
|
||||||
|
if(Objects.equals(payWorkingGroupSubItem.getChargeWay(),PayProjectCommon.CHARGE_WAY3) && StringUtils.isNotBlank(payWorkingGroupSubItem.getChargeNoticeId())){
|
||||||
|
OSSFile file = iossFileService.getById(payWorkingGroupSubItem.getChargeNoticeId());
|
||||||
|
String path = env.getProperty("jero.path.upload") + File.separator;
|
||||||
|
listFile.add(path + file.getUrl());
|
||||||
|
}
|
||||||
|
|
||||||
// 来款方式为合同,校验合同编号
|
// 来款方式为合同,校验合同编号
|
||||||
if(Objects.equals(payWorkingGroupSubItem.getChargeWay(),PayProjectCommon.CHARGE_WAY2)){
|
if(Objects.equals(payWorkingGroupSubItem.getChargeWay(),PayProjectCommon.CHARGE_WAY2)){
|
||||||
@@ -191,6 +216,12 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
if(Objects.equals(ProjectCommon.FLAG,payWorkingGroupSubItem.getFlag())){
|
if(Objects.equals(ProjectCommon.FLAG,payWorkingGroupSubItem.getFlag())){
|
||||||
contractCreateProjectSendMessageService.contractCreateProjectSendMessageService(payWorkingGroup.getWorkingGroupProject() + "的" + payWorkingGroupSubItem.getChargeCompanyTemporaryName(),payWorkingGroupSubItem.getId(),payWorkingGroup.getPrincipalIdA());
|
contractCreateProjectSendMessageService.contractCreateProjectSendMessageService(payWorkingGroup.getWorkingGroupProject() + "的" + payWorkingGroupSubItem.getChargeCompanyTemporaryName(),payWorkingGroupSubItem.getId(),payWorkingGroup.getPrincipalIdA());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SysUser sysUserInfo = sysUserService.getById(payWorkingGroup.getPrincipalIdA());
|
||||||
|
if(Objects.isNull(sysUserInfo)){
|
||||||
|
throw new JeroBootException("负责人不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("type",ProjectCommon.PROJECT_TYPE2);
|
json.put("type",ProjectCommon.PROJECT_TYPE2);
|
||||||
json.put("workingGroupId",payWorkingGroupSubItem.getWorkingGroupId());
|
json.put("workingGroupId",payWorkingGroupSubItem.getWorkingGroupId());
|
||||||
@@ -214,6 +245,30 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
paySendContactsMessageDTO.setJson(json);
|
paySendContactsMessageDTO.setJson(json);
|
||||||
contractCreateProjectSendMessageService.createProjectSendMessageToContactsService(paySendContactsMessageDTO);
|
contractCreateProjectSendMessageService.createProjectSendMessageToContactsService(paySendContactsMessageDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!CollectionUtils.isEmpty(listFile)){
|
||||||
|
// 发送消息
|
||||||
|
SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||||
|
if(!StringUtils.isBlank(payContactsManagement.getEmail())){
|
||||||
|
sendMessageDTO.setEmail(PasswordUtil.decrypt(payContactsManagement.getEmail()));
|
||||||
|
}
|
||||||
|
if(!StringUtils.isBlank(payContactsManagement.getPhone())){
|
||||||
|
sendMessageDTO.setToUser(PasswordUtil.decrypt(payContactsManagement.getPhone()));
|
||||||
|
sendMessageDTO.setPhone(PasswordUtil.decrypt(payContactsManagement.getPhone()));
|
||||||
|
}
|
||||||
|
HashMap<String,String> map = new HashMap<>();
|
||||||
|
map.put("projectName",payWorkingGroup.getWorkingGroupProject());
|
||||||
|
sendMessageDTO.setFromUser(sysUserInfo.getUsername());
|
||||||
|
sendMessageDTO.setTemplateCode(CompanyMessageEnums.MSG22.getCode());
|
||||||
|
sendMessageDTO.setTemplateParam(map);
|
||||||
|
sendMessageDTO.setBusType("C_OPEN_TYPE22");
|
||||||
|
sendMessageDTO.setListFile(listFile);
|
||||||
|
JSONObject jsonNew = new JSONObject();
|
||||||
|
jsonNew.put("id",payWorkingGroupSubItem.getId());
|
||||||
|
sendMessageDTO.setBusId(jsonNew.toJSONString());
|
||||||
|
sendMessageService.SendMessageService(sendMessageDTO);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// 新建项目 给企业联系人2发送消息
|
// 新建项目 给企业联系人2发送消息
|
||||||
if(!StringUtils.isBlank(payWorkingGroupSubItem.getContactsIdTwo())){
|
if(!StringUtils.isBlank(payWorkingGroupSubItem.getContactsIdTwo())){
|
||||||
@@ -233,6 +288,28 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
paySendContactsMessageDTO.setJson(json);
|
paySendContactsMessageDTO.setJson(json);
|
||||||
contractCreateProjectSendMessageService.createProjectSendMessageToContactsService(paySendContactsMessageDTO);
|
contractCreateProjectSendMessageService.createProjectSendMessageToContactsService(paySendContactsMessageDTO);
|
||||||
}
|
}
|
||||||
|
if(!CollectionUtils.isEmpty(listFile)){
|
||||||
|
// 发送消息
|
||||||
|
SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||||
|
if(!StringUtils.isBlank(payContactsManagement.getEmail())){
|
||||||
|
sendMessageDTO.setEmail(PasswordUtil.decrypt(payContactsManagement.getEmail()));
|
||||||
|
}
|
||||||
|
if(!StringUtils.isBlank(payContactsManagement.getPhone())){
|
||||||
|
sendMessageDTO.setToUser(PasswordUtil.decrypt(payContactsManagement.getPhone()));
|
||||||
|
sendMessageDTO.setPhone(PasswordUtil.decrypt(payContactsManagement.getPhone()));
|
||||||
|
}
|
||||||
|
HashMap<String,String> map = new HashMap<>();
|
||||||
|
map.put("projectName",payWorkingGroup.getWorkingGroupProject());
|
||||||
|
sendMessageDTO.setFromUser(sysUserInfo.getUsername());
|
||||||
|
sendMessageDTO.setTemplateCode(CompanyMessageEnums.MSG22.getCode());
|
||||||
|
sendMessageDTO.setTemplateParam(map);
|
||||||
|
sendMessageDTO.setBusType("C_OPEN_TYPE22");
|
||||||
|
sendMessageDTO.setListFile(listFile);
|
||||||
|
JSONObject jsonNew = new JSONObject();
|
||||||
|
jsonNew.put("id",payWorkingGroupSubItem.getId());
|
||||||
|
sendMessageDTO.setBusId(jsonNew.toJSONString());
|
||||||
|
sendMessageService.SendMessageService(sendMessageDTO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 新建项目 给企业联系人3发送消息
|
// 新建项目 给企业联系人3发送消息
|
||||||
if(!StringUtils.isBlank(payWorkingGroupSubItem.getContactsIdThree())){
|
if(!StringUtils.isBlank(payWorkingGroupSubItem.getContactsIdThree())){
|
||||||
@@ -252,6 +329,28 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
paySendContactsMessageDTO.setJson(json);
|
paySendContactsMessageDTO.setJson(json);
|
||||||
contractCreateProjectSendMessageService.createProjectSendMessageToContactsService(paySendContactsMessageDTO);
|
contractCreateProjectSendMessageService.createProjectSendMessageToContactsService(paySendContactsMessageDTO);
|
||||||
}
|
}
|
||||||
|
if(!CollectionUtils.isEmpty(listFile)){
|
||||||
|
// 发送消息
|
||||||
|
SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||||
|
if(!StringUtils.isBlank(payContactsManagement.getEmail())){
|
||||||
|
sendMessageDTO.setEmail(PasswordUtil.decrypt(payContactsManagement.getEmail()));
|
||||||
|
}
|
||||||
|
if(!StringUtils.isBlank(payContactsManagement.getPhone())){
|
||||||
|
sendMessageDTO.setToUser(PasswordUtil.decrypt(payContactsManagement.getPhone()));
|
||||||
|
sendMessageDTO.setPhone(PasswordUtil.decrypt(payContactsManagement.getPhone()));
|
||||||
|
}
|
||||||
|
HashMap<String,String> map = new HashMap<>();
|
||||||
|
map.put("projectName",payWorkingGroup.getWorkingGroupProject());
|
||||||
|
sendMessageDTO.setFromUser(sysUserInfo.getUsername());
|
||||||
|
sendMessageDTO.setTemplateCode(CompanyMessageEnums.MSG22.getCode());
|
||||||
|
sendMessageDTO.setTemplateParam(map);
|
||||||
|
sendMessageDTO.setBusType("C_OPEN_TYPE22");
|
||||||
|
sendMessageDTO.setListFile(listFile);
|
||||||
|
JSONObject jsonNew = new JSONObject();
|
||||||
|
jsonNew.put("id",payWorkingGroupSubItem.getId());
|
||||||
|
sendMessageDTO.setBusId(jsonNew.toJSONString());
|
||||||
|
sendMessageService.SendMessageService(sendMessageDTO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -720,7 +819,7 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void setCharge(SetChargeInput input) {
|
public List<String> setCharge(SetChargeInput input) {
|
||||||
if (StringUtils.isBlank(input.getIds())) {
|
if (StringUtils.isBlank(input.getIds())) {
|
||||||
throw new JeroBootException("id不能为空!");
|
throw new JeroBootException("id不能为空!");
|
||||||
}
|
}
|
||||||
@@ -730,10 +829,44 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
throw new JeroBootException("id不能为空!");
|
throw new JeroBootException("id不能为空!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
List<String> listFile = new ArrayList<>();
|
||||||
|
if(!StringUtils.isBlank(input.getChargeNoticeId())){
|
||||||
|
OSSFile file = iossFileService.getById(input.getChargeNoticeId());
|
||||||
|
String path = env.getProperty("jero.path.upload") + File.separator;
|
||||||
|
listFile.add(path + file.getUrl());
|
||||||
|
}
|
||||||
List<PayWorkingGroupSubItem> list = payWorkingGroupSubItemService.listByIds(Arrays.asList(s));
|
List<PayWorkingGroupSubItem> list = payWorkingGroupSubItemService.listByIds(Arrays.asList(s));
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
List<String> listMsg = new ArrayList<>();
|
||||||
if(!CollectionUtils.isEmpty(list)){
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
|
List<String> listContacts = new ArrayList<>();
|
||||||
|
List<String> listOne = list.stream().map(PayWorkingGroupSubItem::getContactsTemporaryIdOne).collect(Collectors.toList());
|
||||||
|
if(!CollectionUtils.isEmpty(listOne)){
|
||||||
|
listContacts.addAll(listOne);
|
||||||
|
}
|
||||||
|
List<String> listTwo = list.stream().map(PayWorkingGroupSubItem::getContactsTemporaryIdTwo).collect(Collectors.toList());
|
||||||
|
if(!CollectionUtils.isEmpty(listTwo)){
|
||||||
|
listContacts.addAll(listTwo);
|
||||||
|
}
|
||||||
|
List<String> listThree = list.stream().map(PayWorkingGroupSubItem::getContactsTemporaryIdThree).collect(Collectors.toList());
|
||||||
|
if(!CollectionUtils.isEmpty(listThree)){
|
||||||
|
listContacts.addAll(listThree);
|
||||||
|
}
|
||||||
|
// 获取所有联系人
|
||||||
|
List<PayContactsManagementTemporary> listPayContactsManagementTemporary = payContactsManagementTemporaryService.listByIds(listContacts);
|
||||||
|
if(CollectionUtils.isEmpty(listPayContactsManagementTemporary)){
|
||||||
|
throw new JeroBootException("联系人不存在!");
|
||||||
|
}
|
||||||
list.forEach(p->{
|
list.forEach(p->{
|
||||||
|
// 获取工作组信息
|
||||||
|
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(list.get(0).getWorkingGroupId());
|
||||||
|
if(Objects.isNull(payWorkingGroup)){
|
||||||
|
throw new JeroBootException("工作组不存在!");
|
||||||
|
}
|
||||||
|
SysUser sysUserInfo = sysUserService.getById(payWorkingGroup.getPrincipalIdA());
|
||||||
|
if(Objects.isNull(sysUserInfo)){
|
||||||
|
throw new JeroBootException("负责人不存在!");
|
||||||
|
}
|
||||||
LambdaUpdateWrapper<PayWorkingGroupSubItem> updatePayWorkingGroupSubItem = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<PayWorkingGroupSubItem> updatePayWorkingGroupSubItem = new LambdaUpdateWrapper<>();
|
||||||
// 变更应收金额,重新校验状态
|
// 变更应收金额,重新校验状态
|
||||||
ProjectStatusVO projectStatusVO = projectDetailService.getStatus(p.getId(),input.getReceivableAmount(),p.getNeedInvoice());
|
ProjectStatusVO projectStatusVO = projectDetailService.getStatus(p.getId(),input.getReceivableAmount(),p.getNeedInvoice());
|
||||||
@@ -758,10 +891,100 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getUpdateBy,sysUser.getUsername());
|
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getUpdateBy,sysUser.getUsername());
|
||||||
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getUpdateTime,new Date());
|
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getUpdateTime,new Date());
|
||||||
payWorkingGroupSubItemService.update(updatePayWorkingGroupSubItem);
|
payWorkingGroupSubItemService.update(updatePayWorkingGroupSubItem);
|
||||||
|
if(CollectionUtils.isEmpty(listFile)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 发消息 项目负责人发给企业联系人、工作组1、2、3联系人
|
||||||
|
List<PayContactsManagementTemporary> listContactsOne = listPayContactsManagementTemporary.stream().filter(item->Objects.equals(p.getContactsTemporaryIdOne(),item.getId())).collect(Collectors.toList());
|
||||||
|
if(!CollectionUtils.isEmpty(listContactsOne)){
|
||||||
|
try {
|
||||||
|
// 发送消息
|
||||||
|
SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||||
|
if(!StringUtils.isBlank(listContactsOne.get(0).getEmail())){
|
||||||
|
sendMessageDTO.setEmail(PasswordUtil.decrypt(listContactsOne.get(0).getEmail()));
|
||||||
|
}
|
||||||
|
if(!StringUtils.isBlank(listContactsOne.get(0).getPhone())){
|
||||||
|
sendMessageDTO.setToUser(PasswordUtil.decrypt(listContactsOne.get(0).getPhone()));
|
||||||
|
sendMessageDTO.setPhone(PasswordUtil.decrypt(listContactsOne.get(0).getPhone()));
|
||||||
|
}
|
||||||
|
HashMap<String,String> map = new HashMap<>();
|
||||||
|
map.put("projectName",payWorkingGroup.getWorkingGroupProject());
|
||||||
|
sendMessageDTO.setFromUser(sysUserInfo.getUsername());
|
||||||
|
sendMessageDTO.setTemplateCode(CompanyMessageEnums.MSG22.getCode());
|
||||||
|
sendMessageDTO.setTemplateParam(map);
|
||||||
|
sendMessageDTO.setBusType("C_OPEN_TYPE22");
|
||||||
|
sendMessageDTO.setListFile(listFile);
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("id",p.getId());
|
||||||
|
sendMessageDTO.setBusId(json.toJSONString());
|
||||||
|
sendMessageService.SendMessageService(sendMessageDTO);
|
||||||
|
}catch (Exception e){
|
||||||
|
if(e.getMessage().contains("邮件发送") && !listMsg.contains(p.getChargeCompanyTemporaryName() + "单位邮箱发送失败")){
|
||||||
|
listMsg.add(p.getChargeCompanyTemporaryName() + "单位邮箱发送失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<PayContactsManagementTemporary> listContactsTwo = listPayContactsManagementTemporary.stream().filter(item->Objects.equals(p.getContactsTemporaryIdTwo(),item.getId())).collect(Collectors.toList());
|
||||||
|
if(!CollectionUtils.isEmpty(listContactsTwo)){
|
||||||
|
try {
|
||||||
|
// 发送消息
|
||||||
|
SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||||
|
if(!StringUtils.isBlank(listContactsTwo.get(0).getEmail())){
|
||||||
|
sendMessageDTO.setEmail(PasswordUtil.decrypt(listContactsTwo.get(0).getEmail()));
|
||||||
|
}
|
||||||
|
if(!StringUtils.isBlank(listContactsTwo.get(0).getPhone())){
|
||||||
|
sendMessageDTO.setToUser(PasswordUtil.decrypt(listContactsTwo.get(0).getPhone()));
|
||||||
|
sendMessageDTO.setPhone(PasswordUtil.decrypt(listContactsTwo.get(0).getPhone()));
|
||||||
|
}
|
||||||
|
HashMap<String,String> map = new HashMap<>();
|
||||||
|
map.put("projectName",payWorkingGroup.getWorkingGroupProject());
|
||||||
|
sendMessageDTO.setFromUser(sysUserInfo.getUsername());
|
||||||
|
sendMessageDTO.setTemplateCode(CompanyMessageEnums.MSG22.getCode());
|
||||||
|
sendMessageDTO.setTemplateParam(map);
|
||||||
|
sendMessageDTO.setBusType("C_OPEN_TYPE22");
|
||||||
|
sendMessageDTO.setListFile(listFile);
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("id",p.getId());
|
||||||
|
sendMessageDTO.setBusId(json.toJSONString());
|
||||||
|
sendMessageService.SendMessageService(sendMessageDTO);
|
||||||
|
}catch (Exception e){
|
||||||
|
if(e.getMessage().contains("邮件发送") && !listMsg.contains(p.getChargeCompanyTemporaryName() + "单位邮箱发送失败")){
|
||||||
|
listMsg.add(p.getChargeCompanyTemporaryName() + "单位邮箱发送失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<PayContactsManagementTemporary> listContactsThree = listPayContactsManagementTemporary.stream().filter(item->Objects.equals(p.getContactsTemporaryIdThree(),item.getId())).collect(Collectors.toList());
|
||||||
|
if(!CollectionUtils.isEmpty(listContactsThree)){
|
||||||
|
try {
|
||||||
|
// 发送消息
|
||||||
|
SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||||
|
if(!StringUtils.isBlank(listContactsThree.get(0).getEmail())){
|
||||||
|
sendMessageDTO.setEmail(PasswordUtil.decrypt(listContactsThree.get(0).getEmail()));
|
||||||
|
}
|
||||||
|
if(!StringUtils.isBlank(listContactsThree.get(0).getPhone())){
|
||||||
|
sendMessageDTO.setToUser(PasswordUtil.decrypt(listContactsThree.get(0).getPhone()));
|
||||||
|
sendMessageDTO.setPhone(PasswordUtil.decrypt(listContactsThree.get(0).getPhone()));
|
||||||
|
}
|
||||||
|
HashMap<String,String> map = new HashMap<>();
|
||||||
|
map.put("projectName",payWorkingGroup.getWorkingGroupProject());
|
||||||
|
sendMessageDTO.setFromUser(sysUserInfo.getUsername());
|
||||||
|
sendMessageDTO.setTemplateCode(CompanyMessageEnums.MSG22.getCode());
|
||||||
|
sendMessageDTO.setTemplateParam(map);
|
||||||
|
sendMessageDTO.setBusType("C_OPEN_TYPE22");
|
||||||
|
sendMessageDTO.setListFile(listFile);
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("id",p.getId());
|
||||||
|
sendMessageDTO.setBusId(json.toJSONString());
|
||||||
|
sendMessageService.SendMessageService(sendMessageDTO);
|
||||||
|
}catch (Exception e){
|
||||||
|
if(e.getMessage().contains("邮件发送") && !listMsg.contains(p.getChargeCompanyTemporaryName() + "单位邮箱发送失败")){
|
||||||
|
listMsg.add(p.getChargeCompanyTemporaryName() + "单位邮箱发送失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
return listMsg;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user