提交 2c8cb345 编写于 作者: misaka's avatar misaka

update

上级 83633ba3
package cn.ibizlab.businesscentral.core.extensions.service; package cn.ibizlab.businesscentral.core.extensions.service;
import cn.ibizlab.businesscentral.core.odoo_base.domain.Res_partner;
import cn.ibizlab.businesscentral.core.odoo_base.service.IRes_partnerService;
import cn.ibizlab.businesscentral.core.odoo_mail.domain.Mail_message; import cn.ibizlab.businesscentral.core.odoo_mail.domain.Mail_message;
import cn.ibizlab.businesscentral.core.odoo_mail.service.impl.Mail_messageServiceImpl; import cn.ibizlab.businesscentral.core.odoo_mail.service.impl.Mail_messageServiceImpl;
import cn.ibizlab.businesscentral.core.util.helper.EBSServiceImpl;
import cn.ibizlab.businesscentral.util.domain.EntityMP;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Random; import java.util.Random;
...@@ -13,11 +19,32 @@ import java.util.Random; ...@@ -13,11 +19,32 @@ import java.util.Random;
@Service("Mail_messageExService") @Service("Mail_messageExService")
public class Mail_messageExService extends Mail_messageServiceImpl { public class Mail_messageExService extends Mail_messageServiceImpl {
@Autowired
IRes_partnerService res_partnerService ;
@Override @Override
protected Class currentModelClass() { protected Class currentModelClass() {
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1); return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
} }
@Transactional
public <T extends EntityMP> void add_default_create_message(EBSServiceImpl service, T et) {
Mail_message message = new Mail_message();
message.setModel(service.getIrModel());
message.setResId(((Long) et.get("id")).intValue());
message.setBody(service.getIrModel() + " create");
message.setSubtypeId(2l);
message.setMessageType("notification");
Res_partner res_partner = res_partnerService.get(3l);
message.setAuthorId(res_partner.getId());
message.setEmailFrom(String.format("\"%s\" <%s>", res_partner.getName(), res_partner.getEmail()));
message.setReplyTo("");
message.setAddSign(true);
message.setWebsitePublished(true);
this.create(message);
}
@Override @Override
public Mail_message generate_tracking_message_id(Mail_message et) { public Mail_message generate_tracking_message_id(Mail_message et) {
System.out.println(System.currentTimeMillis()/1000); System.out.println(System.currentTimeMillis()/1000);
......
...@@ -56,17 +56,6 @@ public class Mail_tracking_valueExService extends Mail_tracking_valueServiceImpl ...@@ -56,17 +56,6 @@ public class Mail_tracking_valueExService extends Mail_tracking_valueServiceImpl
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1); return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
} }
@Transactional
public <T extends EntityMP> void add_default_create_message(EBSServiceImpl service, T et) {
Mail_message message = new Mail_message();
message.setModel(service.getIrModel());
message.setResId(((Long) et.get("id")).intValue());
message.setBody(service.getIrModel() + " create");
message.setSubtypeId(2l);
message.setMessageType("notification");
// SpringContextHolder.getBean(IMail_messageService.class).create(null);
}
@Transactional @Transactional
public <T extends EntityMP> List<Mail_tracking_value> message_track(EBSServiceImpl service, T _old, T _new) { public <T extends EntityMP> List<Mail_tracking_value> message_track(EBSServiceImpl service, T _old, T _new) {
List<Mail_tracking_value> tracking_values = new ArrayList<>(); List<Mail_tracking_value> tracking_values = new ArrayList<>();
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册