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

xignzi006 发布系统代码

上级 29cc693c
......@@ -66,6 +66,20 @@ public class Res_supplier_res_partner_category_rel extends EntityMP implements S
@JSONField(name = "partner_id")
@JsonProperty("partner_id")
private Long partnerId;
/**
* 标签名
*/
@TableField(exist = false)
@JSONField(name = "category_name")
@JsonProperty("category_name")
private String categoryName;
/**
* 名称
*/
@TableField(exist = false)
@JSONField(name = "partner_name")
@JsonProperty("partner_name")
private String partnerName;
/**
*
......
......@@ -48,6 +48,34 @@ public class Res_supplier_res_partner_category_relSearchContext extends QueryWra
this.getSearchCond().eq("partner_id", n_partner_id_eq);
}
}
private String n_category_name_eq;//[标签名]
public void setN_category_name_eq(String n_category_name_eq) {
this.n_category_name_eq = n_category_name_eq;
if(!ObjectUtils.isEmpty(this.n_category_name_eq)){
this.getSearchCond().eq("category_name", n_category_name_eq);
}
}
private String n_category_name_like;//[标签名]
public void setN_category_name_like(String n_category_name_like) {
this.n_category_name_like = n_category_name_like;
if(!ObjectUtils.isEmpty(this.n_category_name_like)){
this.getSearchCond().like("category_name", n_category_name_like);
}
}
private String n_partner_name_eq;//[名称]
public void setN_partner_name_eq(String n_partner_name_eq) {
this.n_partner_name_eq = n_partner_name_eq;
if(!ObjectUtils.isEmpty(this.n_partner_name_eq)){
this.getSearchCond().eq("partner_name", n_partner_name_eq);
}
}
private String n_partner_name_like;//[名称]
public void setN_partner_name_like(String n_partner_name_like) {
this.n_partner_name_like = n_partner_name_like;
if(!ObjectUtils.isEmpty(this.n_partner_name_like)){
this.getSearchCond().like("partner_name", n_partner_name_like);
}
}
/**
* 启用快速搜索
......
......@@ -75,6 +75,7 @@ public class Res_supplier_res_partner_category_relServiceImpl extends EBSService
boolean mail_create_nosubscribe = et.get("mail_create_nosubscribe") != null;
boolean mail_create_nolog = et.get("mail_create_nolog") != null;
boolean mail_notrack = et.get("mail_notrack") != null;
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
......@@ -96,6 +97,7 @@ public class Res_supplier_res_partner_category_relServiceImpl extends EBSService
@Override
@Transactional
public void createBatch(List<Res_supplier_res_partner_category_rel> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
......@@ -105,6 +107,7 @@ public class Res_supplier_res_partner_category_relServiceImpl extends EBSService
Res_supplier_res_partner_category_rel old = new Res_supplier_res_partner_category_rel() ;
CachedBeanCopier.copy(get(et.getId()), old);
boolean mail_notrack = et.get("mail_notrack") != null;
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("id",et.getId())))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
......@@ -117,6 +120,7 @@ public class Res_supplier_res_partner_category_relServiceImpl extends EBSService
@Override
@Transactional
public void updateBatch(List<Res_supplier_res_partner_category_rel> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
......@@ -147,6 +151,7 @@ public class Res_supplier_res_partner_category_relServiceImpl extends EBSService
@Override
public Res_supplier_res_partner_category_rel getDraft(Res_supplier_res_partner_category_rel et) {
fillParentData(et);
return et;
}
......@@ -175,6 +180,7 @@ public class Res_supplier_res_partner_category_relServiceImpl extends EBSService
@Override
@Transactional
public boolean saveBatch(Collection<Res_supplier_res_partner_category_rel> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
......@@ -182,6 +188,7 @@ public class Res_supplier_res_partner_category_relServiceImpl extends EBSService
@Override
@Transactional
public void saveBatch(List<Res_supplier_res_partner_category_rel> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
......@@ -218,6 +225,32 @@ public class Res_supplier_res_partner_category_relServiceImpl extends EBSService
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(Res_supplier_res_partner_category_rel et){
//实体关系[DER1N_RES_SUPPLIER_RES_PARTNER_CATEGORY_REL_RES_PARTNER_CATEGORY_CATEGORY_ID]
if(!ObjectUtils.isEmpty(et.getCategoryId())){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_partner_category odooCategory=et.getOdooCategory();
if(ObjectUtils.isEmpty(odooCategory)){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_partner_category majorEntity=resPartnerCategoryService.get(et.getCategoryId());
et.setOdooCategory(majorEntity);
odooCategory=majorEntity;
}
et.setCategoryName(odooCategory.getName());
}
//实体关系[DER1N_RES_SUPPLIER_RES_PARTNER_CATEGORY_REL_RES_SUPPLIER_PARTNER_ID]
if(!ObjectUtils.isEmpty(et.getPartnerId())){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_supplier odooSupplier=et.getOdooSupplier();
if(ObjectUtils.isEmpty(odooSupplier)){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_supplier majorEntity=resSupplierService.get(et.getPartnerId());
et.setOdooSupplier(majorEntity);
odooSupplier=majorEntity;
}
et.setPartnerName(odooSupplier.getName());
}
}
......
......@@ -5,13 +5,15 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Res_supplier_res_partner_category_relResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.CATEGORY_ID, t1.PARTNER_ID FROM res_partner_res_partner_category_rel t1 ) t1 where id=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.CATEGORY_ID, t11.NAME AS CATEGORY_NAME, t1.PARTNER_ID, t21.NAME AS PARTNER_NAME FROM res_partner_res_partner_category_rel t1 LEFT JOIN RES_PARTNER_CATEGORY t11 ON t1.CATEGORY_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t1.PARTNER_ID = t21.ID ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Res_supplier_res_partner_category_relResultMap" type="cn.ibizlab.businesscentral.core.odoo_base.domain.Res_supplier_res_partner_category_rel" autoMapping="true">
<result property="categoryId" column="category_id" />
<result property="partnerId" column="partner_id" />
<result property="categoryName" column="category_name" />
<result property="partnerName" column="partner_name" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
......@@ -46,12 +48,12 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="postgresql">
<![CDATA[ SELECT t1.CATEGORY_ID, t1.PARTNER_ID FROM res_partner_res_partner_category_rel t1
<![CDATA[ SELECT t1.CATEGORY_ID, t11.NAME AS CATEGORY_NAME, t1.PARTNER_ID, t21.NAME AS PARTNER_NAME FROM res_partner_res_partner_category_rel t1 LEFT JOIN RES_PARTNER_CATEGORY t11 ON t1.CATEGORY_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t1.PARTNER_ID = t21.ID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.CATEGORY_ID, t1.PARTNER_ID FROM res_partner_res_partner_category_rel t1
<![CDATA[ SELECT t1.CATEGORY_ID, t11.NAME AS CATEGORY_NAME, t1.PARTNER_ID, t21.NAME AS PARTNER_NAME FROM res_partner_res_partner_category_rel t1 LEFT JOIN RES_PARTNER_CATEGORY t11 ON t1.CATEGORY_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t1.PARTNER_ID = t21.ID
]]>
</sql>
</mapper>
......
......@@ -151479,6 +151479,42 @@
"key_field":0,
"show_order":1000,
"major_field":0
},
{
"fieldname":"CATEGORY_NAME" ,
"codename":"Category_name",
"field_logic_name":"标签名",
"entity_name":"Res_supplier_res_partner_category_rel",
"ref_de":"RES_PARTNER_CATEGORY",
"ref_field_name":"NAME",
"relation_name":"DER1N_RES_SUPPLIER_RES_PARTNER_CATEGORY_REL_RES_PARTNER_CATEGORY_CATEGORY_ID",
"relation_codename":"Odoo_category",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"show_order":1000,
"major_field":0
},
{
"fieldname":"PARTNER_NAME" ,
"codename":"Partner_name",
"field_logic_name":"名称",
"entity_name":"Res_supplier_res_partner_category_rel",
"ref_de":"RES_SUPPLIER",
"ref_field_name":"NAME",
"relation_name":"DER1N_RES_SUPPLIER_RES_PARTNER_CATEGORY_REL_RES_SUPPLIER_PARTNER_ID",
"relation_codename":"Odoo_supplier",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"show_order":1000,
"major_field":0
}
],
"subEntitys":[
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册