提交 547144c8 编写于 作者: ibizdev's avatar ibizdev

xignzi006 发布系统代码

上级 65d39887
......@@ -58,4 +58,9 @@ public class mail_followersFallback implements mail_followersFeignClient{
return null;
}
public Page<Mail_followers> searchByRes(Mail_followersSearchContext context){
return null;
}
}
......@@ -56,4 +56,9 @@ public interface mail_followersFeignClient {
Page<Mail_followers> select();
@RequestMapping(method = RequestMethod.POST, value = "/mail_followers/searchbyres")
Page<Mail_followers> searchByRes(@RequestBody Mail_followersSearchContext context);
}
......@@ -84,6 +84,11 @@ public class mail_messageFallback implements mail_messageFeignClient{
return false;
}
public Page<Mail_message> searchByRes(Mail_messageSearchContext context){
return null;
}
public Page<Mail_message> searchDefault(Mail_messageSearchContext context){
return null;
}
......
......@@ -80,6 +80,11 @@ public interface mail_messageFeignClient {
@RequestMapping(method = RequestMethod.POST, value = "/mail_messages/searchbyres")
Page<Mail_message> searchByRes(@RequestBody Mail_messageSearchContext context);
@RequestMapping(method = RequestMethod.POST, value = "/mail_messages/searchdefault")
Page<Mail_message> searchDefault(@RequestBody Mail_messageSearchContext context);
......
......@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
public interface Mail_followersMapper extends BaseMapper<Mail_followers>{
Page<Mail_followers> searchByRes(IPage page, @Param("srf") Mail_followersSearchContext context, @Param("ew") Wrapper<Mail_followers> wrapper) ;
@Override
Mail_followers selectById(Serializable id);
@Override
......
......@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
public interface Mail_messageMapper extends BaseMapper<Mail_message>{
Page<Mail_message> searchByRes(IPage page, @Param("srf") Mail_messageSearchContext context, @Param("ew") Wrapper<Mail_message> wrapper) ;
Page<Mail_message> searchDefault(IPage page, @Param("srf") Mail_messageSearchContext context, @Param("ew") Wrapper<Mail_message> wrapper) ;
@Override
Mail_message selectById(Serializable id);
......
......@@ -33,6 +33,7 @@ public interface IMail_followersService extends IService<Mail_followers>{
boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ;
Mail_followers get(Long key) ;
Page<Mail_followers> searchByRes(Mail_followersSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
......
......@@ -39,6 +39,7 @@ public interface IMail_messageService extends IService<Mail_message>{
Mail_message post_message(Mail_message et) ;
boolean save(Mail_message et) ;
void saveBatch(List<Mail_message> list) ;
Page<Mail_message> searchByRes(Mail_messageSearchContext context) ;
Page<Mail_message> searchDefault(Mail_messageSearchContext context) ;
List<Mail_message> selectByMailActivityTypeId(Long id) ;
void removeByMailActivityTypeId(Long id) ;
......
......@@ -156,6 +156,15 @@ public class Mail_followersServiceImpl extends EBSServiceImpl<Mail_followersMapp
/**
* 查询集合 ByRes
*/
@Override
public Page<Mail_followers> searchByRes(Mail_followersSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Mail_followers> pages=baseMapper.searchByRes(context.getPages(),context,context.getSelectCond());
return new PageImpl<Mail_followers>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
......
......@@ -320,6 +320,15 @@ public class Mail_messageServiceImpl extends EBSServiceImpl<Mail_messageMapper,
}
/**
* 查询集合 ByRes
*/
@Override
public Page<Mail_message> searchByRes(Mail_messageSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Mail_message> pages=baseMapper.searchByRes(context.getPages(),context,context.getSelectCond());
return new PageImpl<Mail_message>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 数据集
*/
......
......@@ -28,5 +28,20 @@
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_MAIL_FOLLOWERS__MAIL_CHANNEL__CHANNEL_ID] -->
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_MAIL_FOLLOWERS__RES_PARTNER__PARTNER_ID] -->
<!--数据集合[ByRes]-->
<select id="searchByRes" parameterType="cn.ibizlab.businesscentral.core.odoo_mail.filter.Mail_followersSearchContext" resultMap="Mail_followersResultMap">
select t1.* from (
<include refid="ByRes" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[ByRes]-->
<sql id="ByRes" databaseId="postgresql">
<![CDATA[ SELECT t1.CHANNEL_ID, t21.NAME AS CHANNEL_ID_TEXT, t1.ID, t1.PARTNER_ID, t11.NAME AS PARTNER_ID_TEXT, t1.RES_ID, t1.RES_MODEL FROM MAIL_FOLLOWERS t1 LEFT JOIN RES_PARTNER t11 ON t1.PARTNER_ID = t11.ID LEFT JOIN MAIL_CHANNEL t21 ON t1.CHANNEL_ID = t21.ID
WHERE ( t1.RES_MODEL = #{srf.webcontext.res_model} AND t1.RES_ID = #{srf.webcontext.res_id} )
]]>
</sql>
</mapper>
......@@ -120,6 +120,15 @@
where write_uid=#{id}
</select>
<!--数据集合[ByRes]-->
<select id="searchByRes" parameterType="cn.ibizlab.businesscentral.core.odoo_mail.filter.Mail_messageSearchContext" resultMap="Mail_messageResultMap">
select t1.* from (
<include refid="ByRes" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.odoo_mail.filter.Mail_messageSearchContext" resultMap="Mail_messageResultMap">
select t1.* from (
......@@ -129,6 +138,12 @@
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[ByRes]-->
<sql id="ByRes" databaseId="postgresql">
<![CDATA[ SELECT t1.ADD_SIGN, t1.AUTHOR_ID, t11.NAME AS AUTHOR_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t31.NAME AS CREATE_UID_TEXT, t1.DATE, t1.EMAIL_FROM, t1.ID, t1.MAIL_ACTIVITY_TYPE_ID, t41.NAME AS MAIL_ACTIVITY_TYPE_ID_TEXT, t1.MAIL_SERVER_ID, t1.MESSAGE_ID, t1.MESSAGE_TYPE, t1.MODEL, t1.MODERATION_STATUS, t1.MODERATOR_ID, t61.NAME AS MODERATOR_ID_TEXT, t1.NO_AUTO_THREAD, t1.PARENT_ID, t1.RECORD_NAME, t1.REPLY_TO, t1.RES_ID, t1.SUBJECT, t1.SUBTYPE_ID, t91.NAME AS SUBTYPE_ID_TEXT, t1.WEBSITE_PUBLISHED, t1.WRITE_DATE, t1.WRITE_UID, t81.NAME AS WRITE_UID_TEXT FROM MAIL_MESSAGE t1 LEFT JOIN RES_PARTNER t11 ON t1.AUTHOR_ID = t11.ID LEFT JOIN RES_USERS t21 ON t1.CREATE_UID = t21.ID LEFT JOIN RES_PARTNER t31 ON t21.PARTNER_ID = t31.ID LEFT JOIN MAIL_ACTIVITY_TYPE t41 ON t1.MAIL_ACTIVITY_TYPE_ID = t41.ID LEFT JOIN RES_USERS t51 ON t1.MODERATOR_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN RES_USERS t71 ON t1.WRITE_UID = t71.ID LEFT JOIN RES_PARTNER t81 ON t71.PARTNER_ID = t81.ID LEFT JOIN MAIL_MESSAGE_SUBTYPE t91 ON t1.SUBTYPE_ID = t91.ID
WHERE ( t1.MODEL = #{srf.webcontext.res_model} AND t1.RES_ID = #{srf.webcontext.res_id} )
]]>
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="postgresql">
<![CDATA[ SELECT t1.ADD_SIGN, t1.AUTHOR_ID, t11.NAME AS AUTHOR_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t31.NAME AS CREATE_UID_TEXT, t1.DATE, t1.EMAIL_FROM, t1.ID, t1.MAIL_ACTIVITY_TYPE_ID, t41.NAME AS MAIL_ACTIVITY_TYPE_ID_TEXT, t1.MAIL_SERVER_ID, t1.MESSAGE_ID, t1.MESSAGE_TYPE, t1.MODEL, t1.MODERATION_STATUS, t1.MODERATOR_ID, t61.NAME AS MODERATOR_ID_TEXT, t1.NO_AUTO_THREAD, t1.PARENT_ID, t1.RECORD_NAME, t1.REPLY_TO, t1.RES_ID, t1.SUBJECT, t1.SUBTYPE_ID, t91.NAME AS SUBTYPE_ID_TEXT, t1.WEBSITE_PUBLISHED, t1.WRITE_DATE, t1.WRITE_UID, t81.NAME AS WRITE_UID_TEXT FROM MAIL_MESSAGE t1 LEFT JOIN RES_PARTNER t11 ON t1.AUTHOR_ID = t11.ID LEFT JOIN RES_USERS t21 ON t1.CREATE_UID = t21.ID LEFT JOIN RES_PARTNER t31 ON t21.PARTNER_ID = t31.ID LEFT JOIN MAIL_ACTIVITY_TYPE t41 ON t1.MAIL_ACTIVITY_TYPE_ID = t41.ID LEFT JOIN RES_USERS t51 ON t1.MODERATOR_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN RES_USERS t71 ON t1.WRITE_UID = t71.ID LEFT JOIN RES_PARTNER t81 ON t71.PARTNER_ID = t81.ID LEFT JOIN MAIL_MESSAGE_SUBTYPE t91 ON t1.SUBTYPE_ID = t91.ID
......
package cn.ibizlab.businesscentral.core.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.ibizlab.businesscentral.util.domain.DTOBase;
import cn.ibizlab.businesscentral.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[Message_attachment_relDTO]
*/
@Data
public class Message_attachment_relDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [ID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 属性 [MESSAGE_ID]
*
*/
@JSONField(name = "message_id")
@JsonProperty("message_id")
@JsonSerialize(using = ToStringSerializer.class)
private Long messageId;
/**
* 属性 [ATTACHMENT_ID]
*
*/
@JSONField(name = "attachment_id")
@JsonProperty("attachment_id")
@JsonSerialize(using = ToStringSerializer.class)
private Long attachmentId;
/**
* 设置 [MESSAGE_ID]
*/
public void setMessageId(Long messageId){
this.messageId = messageId ;
this.modify("message_id",messageId);
}
/**
* 设置 [ATTACHMENT_ID]
*/
public void setAttachmentId(Long attachmentId){
this.attachmentId = attachmentId ;
this.modify("attachment_id",attachmentId);
}
}
package cn.ibizlab.businesscentral.core.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.odoo_mail.domain.Message_attachment_rel;
import cn.ibizlab.businesscentral.core.dto.Message_attachment_relDTO;
import cn.ibizlab.businesscentral.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="CoreMessage_attachment_relMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface Message_attachment_relMapping extends MappingBase<Message_attachment_relDTO, Message_attachment_rel> {
}
......@@ -108,6 +108,28 @@ public class Mail_followersResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Mail_followers-searchByRes-all')")
@ApiOperation(value = "获取ByRes", tags = {"文档关注者" } ,notes = "获取ByRes")
@RequestMapping(method= RequestMethod.GET , value="/mail_followers/fetchbyres")
public ResponseEntity<List<Mail_followersDTO>> fetchByRes(Mail_followersSearchContext context) {
Page<Mail_followers> domains = mail_followersService.searchByRes(context) ;
List<Mail_followersDTO> list = mail_followersMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Mail_followers-searchByRes-all')")
@ApiOperation(value = "查询ByRes", tags = {"文档关注者" } ,notes = "查询ByRes")
@RequestMapping(method= RequestMethod.POST , value="/mail_followers/searchbyres")
public ResponseEntity<Page<Mail_followersDTO>> searchByRes(@RequestBody Mail_followersSearchContext context) {
Page<Mail_followers> domains = mail_followersService.searchByRes(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(mail_followersMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -158,6 +158,28 @@ public class Mail_messageResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Mail_message-searchByRes-all') and hasPermission(#context,'iBizBusinessCentral-Mail_message-Get')")
@ApiOperation(value = "获取ByRes", tags = {"消息" } ,notes = "获取ByRes")
@RequestMapping(method= RequestMethod.GET , value="/mail_messages/fetchbyres")
public ResponseEntity<List<Mail_messageDTO>> fetchByRes(Mail_messageSearchContext context) {
Page<Mail_message> domains = mail_messageService.searchByRes(context) ;
List<Mail_messageDTO> list = mail_messageMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Mail_message-searchByRes-all') and hasPermission(#context,'iBizBusinessCentral-Mail_message-Get')")
@ApiOperation(value = "查询ByRes", tags = {"消息" } ,notes = "查询ByRes")
@RequestMapping(method= RequestMethod.POST , value="/mail_messages/searchbyres")
public ResponseEntity<Page<Mail_messageDTO>> searchByRes(@RequestBody Mail_messageSearchContext context) {
Page<Mail_message> domains = mail_messageService.searchByRes(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(mail_messageMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Mail_message-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Mail_message-Get')")
@ApiOperation(value = "获取数据集", tags = {"消息" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/mail_messages/fetchdefault")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册