Commit d9e40b57 authored by chenjian's avatar chenjian

修改

parent 93c86fed
Pipeline #10 failed with stages
package com.ebo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import com.ebo.framework.mybatis.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 继承BaseEntity完成公共字段填充
* @TableName work_order
*/
@EqualsAndHashCode(callSuper = true)
@TableName(value ="work_order")
@Data
public class WorkOrderEntity extends BaseEntity implements Serializable {
......@@ -333,6 +335,6 @@ public class WorkOrderEntity extends BaseEntity implements Serializable {
*/
private Integer oaFlowStatus;
// @TableField(exist = false)
// private static final long serialVersionUID = 1L;
@TableField(exist = true)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -43,7 +43,7 @@ public class CloseWorkOrderServiceBtnEnhance implements BtnServerEnhanceJavaInte
//等于服务工单
if(workOrderEntity.getWorkOrderType().equals("1")){
/**
* 底层没改完动不了
* 底层没改完动不了,需要进行workordernum相连,然后更改工单状态
* @TODO
*/
// if(workOrderEntity.getCloseOrderType().equals("1")){
......
......@@ -25,10 +25,11 @@ public class DeleteWorkOrder implements BtnServerEnhanceJavaInter {
@Override
public void executeAfter(String tableName, String buttonCode, Map data) throws ServerException, MalformedURLException {
log.info("-----业务增强,删除草稿箱工单------");
System.out.println(WorkOrderEntity.class);
WorkOrderEntity workOrderEntity = workOrderMapper.selectById((Serializable) data.get("id"));
log.info("idWei{}",workOrderMapper.selectById((Serializable) data.get("id")));
if(workOrderEntity.getStatus().equals("7")){
workOrderEntity.setDeleteFlag(1);
workOrderMapper.updateById(workOrderEntity);
workOrderMapper.deleteById(workOrderEntity);
}else{
throw new RuntimeException("工单不在草稿箱无法删除");
}
......
......@@ -6,11 +6,12 @@ import org.springframework.stereotype.Component;
@Data
@Component
@ConfigurationProperties(prefix = "xxljob.executor.qqemail")
public class QQEmailConfig {
@ConfigurationProperties(prefix = "xxljob.executor.email")
public class EmailConfig {
private String toEmail;
private String smtpHost;
private int smtpPort;
private String smtpUser;
private String smtpPass;
private String smtpAuth;
}
\ No newline at end of file
......@@ -21,7 +21,7 @@ public class MemoryMonitorHandler extends IJobHandler {
log.info("Memory Monitor Job Start");
Mem men = new Mem();
double usage = men.getUsage();
double threshold = 90.0;
double threshold = 80.0;
if (usage > threshold) {
try{
log.info("开始发送邮箱");
......
package com.ebo.module.utils;
import com.ebo.module.config.QQEmailConfig;
import com.ebo.module.config.EmailConfig;
import jakarta.mail.*;
import jakarta.mail.internet.InternetAddress;
import jakarta.mail.internet.MimeMessage;
......@@ -14,30 +14,30 @@ import java.util.Properties;
@Slf4j
@Component
public class SendMessageEmail {
private final QQEmailConfig qqemailConfig;
private final EmailConfig emailConfig;
@Autowired
public SendMessageEmail(QQEmailConfig qqemailConfig) {
this.qqemailConfig = qqemailConfig;
public SendMessageEmail(EmailConfig emailConfig) {
this.emailConfig = emailConfig;
}
public void sendAlert(String subject, String message) {
// 发送邮件
Properties props = new Properties();
props.put("mail.smtp.host", qqemailConfig.getSmtpHost());
props.put("mail.smtp.port", qqemailConfig.getSmtpPort());
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.host", emailConfig.getSmtpHost());
props.put("mail.smtp.port", emailConfig.getSmtpPort());
props.put("mail.smtp.auth", emailConfig.getSmtpAuth());
props.put("mail.smtp.ssl.enable", "true");
Session session = Session.getInstance(props, new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(qqemailConfig.getSmtpUser(), qqemailConfig.getSmtpPass());
return new PasswordAuthentication(emailConfig.getSmtpUser(), emailConfig.getSmtpPass());
}
});
try {
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(qqemailConfig.getSmtpUser(), false));
msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(qqemailConfig.getToEmail(), false));
msg.setFrom(new InternetAddress(emailConfig.getSmtpUser(), false));
msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(emailConfig.getToEmail(), false));
msg.setSubject(subject);
msg.setText(message);
msg.setSentDate(new Date());
......
......@@ -66,10 +66,11 @@ mybatis:
xxljob:
executor:
qqemail:
smtp-host: smtp.qq.com
smtp-port: 587
smtp-user: 1498377512@qq.com
smtp-pass: fumtxqlqsudliaia
to-email: 1498377512@qq.com
email:
smtp-host: smtp.exmail.qq.com
smtp-port: 465
smtp-user: mail@cyunsing.com
smtp-pass: U8nK2VKRVTmcqiNv
to-email: mail@cyunsing.com
smtp-auth: true
......@@ -60,3 +60,13 @@ mybatis:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
xxljob:
executor:
email:
smtp-host: smtp.exmail.qq.com
smtp-port: 465
smtp-user: mail@cyunsing.com
smtp-pass: U8nK2VKRVTmcqiNv
to-email: mail@cyunsing.com
smtp-auth: true
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