Commit d9e40b57 authored by chenjian's avatar chenjian

修改

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