消息修改
This commit is contained in:
+30
-5
@@ -14,17 +14,17 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.common.ProjectCommon;
|
||||
import com.jero.common.constant.GlobalConstants;
|
||||
import com.jero.common.dto.SendMessageDTO;
|
||||
import com.jero.common.enums.CompanyMessageEnums;
|
||||
import com.jero.common.service.ProjectDetailService;
|
||||
import com.jero.common.service.SendMessageService;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.common.vo.ProjectDetailVO;
|
||||
import com.jero.company.entity.PayContactsManagement;
|
||||
import com.jero.company.service.IPayContactsManagementService;
|
||||
import com.jero.mail.commont.constant;
|
||||
import com.jero.mail.entity.PayMailBill;
|
||||
import com.jero.mail.entity.PayMailBillProject;
|
||||
import com.jero.mail.entity.PayMailBillSearch;
|
||||
import com.jero.mail.entity.PayMailContract;
|
||||
import com.jero.mail.service.IPayMailBillProjectService;
|
||||
import com.jero.mail.service.IPayMailBillService;
|
||||
import com.jero.meeting.entity.PayMeetingSituation;
|
||||
@@ -41,6 +41,7 @@ import com.jero.util.AmountUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -48,7 +49,9 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Description: 邮寄票据
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-09-02
|
||||
@@ -78,6 +81,8 @@ public class PayMailBillController extends JeroController<PayMailBill, IPayMailB
|
||||
private IPayWorkingGroupSubItemService payWorkingGroupSubItemService;
|
||||
@Autowired
|
||||
private ITbMemberProjectSubitemService tbMemberProjectSubitemService;
|
||||
@Resource
|
||||
private SendMessageService sendMessageService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
@@ -262,6 +267,26 @@ public class PayMailBillController extends JeroController<PayMailBill, IPayMailB
|
||||
payMailBillService.pushSendToStandards(payMailBill,one.getProjectId());
|
||||
}
|
||||
}
|
||||
PayMailBill payMailBillData = payMailBillService.getById(payMailBill.getId());
|
||||
if(!Objects.isNull(payMailBillData)){
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// 发送消息
|
||||
SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||
if(!StringUtils.isBlank(payMailBillData.getEmail())){
|
||||
sendMessageDTO.setEmail(PasswordUtil.decrypt(payMailBillData.getEmail()));
|
||||
}
|
||||
if(!StringUtils.isBlank(payMailBillData.getContactMobile())){
|
||||
sendMessageDTO.setToUser(payMailBillData.getContactMobile());
|
||||
sendMessageDTO.setPhone(payMailBillData.getContactMobile());
|
||||
}
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("projectName",payMailBillData.getProjectName());
|
||||
sendMessageDTO.setFromUser(sysUser.getUsername());
|
||||
sendMessageDTO.setTemplateCode(CompanyMessageEnums.MSG9.getCode());
|
||||
sendMessageDTO.setTemplateParam(map);
|
||||
sendMessageDTO.setBusType("C_OPEN_TYPE9");
|
||||
sendMessageService.SendMessageService(sendMessageDTO);
|
||||
}
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
|
||||
+43
-5
@@ -1,14 +1,24 @@
|
||||
package com.jero.mail.controller;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.common.ProjectCommon;
|
||||
import com.jero.common.dto.SendMessageDTO;
|
||||
import com.jero.common.enums.CompanyMessageEnums;
|
||||
import com.jero.common.service.SendMessageService;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.contract.entity.PayIncomeContract;
|
||||
import com.jero.contract.service.IPayIncomeContractService;
|
||||
import com.jero.mail.entity.PayMailBillList;
|
||||
import com.jero.mail.entity.PayMailContract;
|
||||
import com.jero.mail.service.IPayMailContractService;
|
||||
@@ -17,7 +27,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.util.AmountUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -34,8 +44,12 @@ import io.swagger.annotations.ApiOperation;
|
||||
@RequestMapping("/payMailContract/payMailContract")
|
||||
@Slf4j
|
||||
public class PayMailContractController extends JeroController<PayMailContract, IPayMailContractService> {
|
||||
@Autowired
|
||||
@Resource
|
||||
private IPayMailContractService payMailContractService;
|
||||
@Resource
|
||||
private IPayIncomeContractService payIncomeContractService;
|
||||
@Resource
|
||||
private SendMessageService sendMessageService;
|
||||
|
||||
/**
|
||||
* 邮寄合同-分页列表查询
|
||||
@@ -64,8 +78,32 @@ public class PayMailContractController extends JeroController<PayMailContract, I
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@RequestBody PayMailContract payMailContract
|
||||
) {
|
||||
PayMailContract payMailContractData = payMailContractService.getById(payMailContract.getId());
|
||||
payMailContract.setPostStatus(1);
|
||||
payMailContractService.updateById(payMailContract);
|
||||
|
||||
if(!Objects.isNull(payMailContractData) && Objects.equals(payMailContractData.getPostStatus(), ProjectCommon.POST_STATUS0)){
|
||||
PayIncomeContract payIncomeContract = payIncomeContractService.getById(payMailContractData.getContractId());
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// 发送消息
|
||||
SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||
if(!StringUtils.isBlank(payMailContractData.getEmail())){
|
||||
sendMessageDTO.setEmail(PasswordUtil.decrypt(payMailContractData.getEmail()));
|
||||
}
|
||||
if(!StringUtils.isBlank(payMailContractData.getMobile())){
|
||||
sendMessageDTO.setToUser(PasswordUtil.decrypt(payMailContractData.getMobile()));
|
||||
sendMessageDTO.setPhone(PasswordUtil.decrypt(payMailContractData.getMobile()));
|
||||
}
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
if(Objects.isNull(payIncomeContract)){
|
||||
map.put("contractName",payIncomeContract.getContractName());
|
||||
}
|
||||
sendMessageDTO.setFromUser(sysUser.getUsername());
|
||||
sendMessageDTO.setTemplateCode(CompanyMessageEnums.MSG10.getCode());
|
||||
sendMessageDTO.setTemplateParam(map);
|
||||
sendMessageDTO.setBusType("C_OPEN_TYPE10");
|
||||
sendMessageService.SendMessageService(sendMessageDTO);
|
||||
}
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
|
||||
@@ -81,4 +81,7 @@ public class PayMailContract implements Serializable {
|
||||
@Excel(name = "联系人手机号", width = 15)
|
||||
@ApiModelProperty(value = "联系人手机号")
|
||||
private java.lang.String mobile;
|
||||
/**联系人邮箱*/
|
||||
@ApiModelProperty(value = "联系人邮箱")
|
||||
private String email;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user