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

xignzi006 发布系统代码 [Spring Boot]

上级 5e42e5ba
......@@ -58,7 +58,7 @@ public class Hr_resume_line extends EntityMP implements Serializable {
@JsonProperty("name")
private String name;
/**
* ID
* 员工
*/
@DEField(name = "employee_id")
@TableField(value = "employee_id")
......@@ -66,13 +66,27 @@ public class Hr_resume_line extends EntityMP implements Serializable {
@JsonProperty("employee_id")
private Long employeeId;
/**
* ID
* 类型
*/
@DEField(name = "line_type_id")
@TableField(value = "line_type_id")
@JSONField(name = "line_type_id")
@JsonProperty("line_type_id")
private Long lineTypeId;
/**
* 员工
*/
@TableField(exist = false)
@JSONField(name = "employee_id_text")
@JsonProperty("employee_id_text")
private String employeeIdText;
/**
* 类型
*/
@TableField(exist = false)
@JSONField(name = "line_type_id_text")
@JsonProperty("line_type_id_text")
private String lineTypeIdText;
/**
*
......@@ -101,7 +115,7 @@ public class Hr_resume_line extends EntityMP implements Serializable {
}
/**
* 设置 [ID]
* 设置 [员工]
*/
public void setEmployeeId(Long employeeId){
this.employeeId = employeeId ;
......@@ -109,7 +123,7 @@ public class Hr_resume_line extends EntityMP implements Serializable {
}
/**
* 设置 [ID]
* 设置 [类型]
*/
public void setLineTypeId(Long lineTypeId){
this.lineTypeId = lineTypeId ;
......
......@@ -34,20 +34,48 @@ public class Hr_resume_lineSearchContext extends QueryWrapperContext<Hr_resume_l
this.getSearchCond().like("name", n_name_like);
}
}
private Long n_employee_id_eq;//[ID]
private Long n_employee_id_eq;//[员工]
public void setN_employee_id_eq(Long n_employee_id_eq) {
this.n_employee_id_eq = n_employee_id_eq;
if(!ObjectUtils.isEmpty(this.n_employee_id_eq)){
this.getSearchCond().eq("employee_id", n_employee_id_eq);
}
}
private Long n_line_type_id_eq;//[ID]
private Long n_line_type_id_eq;//[类型]
public void setN_line_type_id_eq(Long n_line_type_id_eq) {
this.n_line_type_id_eq = n_line_type_id_eq;
if(!ObjectUtils.isEmpty(this.n_line_type_id_eq)){
this.getSearchCond().eq("line_type_id", n_line_type_id_eq);
}
}
private String n_employee_id_text_eq;//[员工]
public void setN_employee_id_text_eq(String n_employee_id_text_eq) {
this.n_employee_id_text_eq = n_employee_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_employee_id_text_eq)){
this.getSearchCond().eq("employee_id_text", n_employee_id_text_eq);
}
}
private String n_employee_id_text_like;//[员工]
public void setN_employee_id_text_like(String n_employee_id_text_like) {
this.n_employee_id_text_like = n_employee_id_text_like;
if(!ObjectUtils.isEmpty(this.n_employee_id_text_like)){
this.getSearchCond().like("employee_id_text", n_employee_id_text_like);
}
}
private String n_line_type_id_text_eq;//[类型]
public void setN_line_type_id_text_eq(String n_line_type_id_text_eq) {
this.n_line_type_id_text_eq = n_line_type_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_line_type_id_text_eq)){
this.getSearchCond().eq("line_type_id_text", n_line_type_id_text_eq);
}
}
private String n_line_type_id_text_like;//[类型]
public void setN_line_type_id_text_like(String n_line_type_id_text_like) {
this.n_line_type_id_text_like = n_line_type_id_text_like;
if(!ObjectUtils.isEmpty(this.n_line_type_id_text_like)){
this.getSearchCond().like("line_type_id_text", n_line_type_id_text_like);
}
}
/**
* 启用快速搜索
......
......@@ -75,6 +75,7 @@ public class Hr_resume_lineServiceImpl extends EBSServiceImpl<Hr_resume_lineMapp
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;
CachedBeanCopier.copy(get(et.getId()),et);
......@@ -96,6 +97,7 @@ public class Hr_resume_lineServiceImpl extends EBSServiceImpl<Hr_resume_lineMapp
@Override
@Transactional
public void createBatch(List<Hr_resume_line> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
......@@ -105,6 +107,7 @@ public class Hr_resume_lineServiceImpl extends EBSServiceImpl<Hr_resume_lineMapp
Hr_resume_line old = new Hr_resume_line() ;
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 Hr_resume_lineServiceImpl extends EBSServiceImpl<Hr_resume_lineMapp
@Override
@Transactional
public void updateBatch(List<Hr_resume_line> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
......@@ -148,6 +152,7 @@ public class Hr_resume_lineServiceImpl extends EBSServiceImpl<Hr_resume_lineMapp
@Override
public Hr_resume_line getDraft(Hr_resume_line et) {
fillParentData(et);
return et;
}
......@@ -176,6 +181,7 @@ public class Hr_resume_lineServiceImpl extends EBSServiceImpl<Hr_resume_lineMapp
@Override
@Transactional
public boolean saveBatch(Collection<Hr_resume_line> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
......@@ -183,6 +189,7 @@ public class Hr_resume_lineServiceImpl extends EBSServiceImpl<Hr_resume_lineMapp
@Override
@Transactional
public void saveBatch(List<Hr_resume_line> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
......@@ -217,6 +224,32 @@ public class Hr_resume_lineServiceImpl extends EBSServiceImpl<Hr_resume_lineMapp
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(Hr_resume_line et){
//实体关系[DER1N_HR_RESUME_LINE_HR_EMPLOYEE_EMPLOYEE_ID]
if(!ObjectUtils.isEmpty(et.getEmployeeId())){
cn.ibizlab.businesscentral.core.odoo_hr.domain.Hr_employee odooEmployee=et.getOdooEmployee();
if(ObjectUtils.isEmpty(odooEmployee)){
cn.ibizlab.businesscentral.core.odoo_hr.domain.Hr_employee majorEntity=hrEmployeeService.get(et.getEmployeeId());
et.setOdooEmployee(majorEntity);
odooEmployee=majorEntity;
}
et.setEmployeeIdText(odooEmployee.getName());
}
//实体关系[DER1N_HR_RESUME_LINE_HR_RESUME_LINE_TYPE_LINE_TYPE_ID]
if(!ObjectUtils.isEmpty(et.getLineTypeId())){
cn.ibizlab.businesscentral.core.odoo_hr.domain.Hr_resume_line_type odooResumeLineType=et.getOdooResumeLineType();
if(ObjectUtils.isEmpty(odooResumeLineType)){
cn.ibizlab.businesscentral.core.odoo_hr.domain.Hr_resume_line_type majorEntity=hrResumeLineTypeService.get(et.getLineTypeId());
et.setOdooResumeLineType(majorEntity);
odooResumeLineType=majorEntity;
}
et.setLineTypeIdText(odooResumeLineType.getName());
}
}
......
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Hr_resume_lineResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.EMPLOYEE_ID, t1.ID, t1.LINE_TYPE_ID, t1.NAME FROM HR_RESUME_LINE t1 ) t1 where id=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.EMPLOYEE_ID, t21.NAME AS EMPLOYEE_ID_TEXT, t1.ID, t1.LINE_TYPE_ID, t31.NAME AS LINE_TYPE_ID_TEXT, t1.NAME FROM HR_RESUME_LINE t1 LEFT JOIN HR_EMPLOYEE t11 ON t1.EMPLOYEE_ID = t11.ID LEFT JOIN RESOURCE_RESOURCE t21 ON t11.RESOURCE_ID = t21.ID LEFT JOIN HR_RESUME_LINE_TYPE t31 ON t1.LINE_TYPE_ID = t31.ID ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -13,6 +13,8 @@
<id property="id" column="id" /><!--主键字段映射-->
<result property="employeeId" column="employee_id" />
<result property="lineTypeId" column="line_type_id" />
<result property="employeeIdText" column="employee_id_text" />
<result property="lineTypeIdText" column="line_type_id_text" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
......@@ -47,12 +49,12 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="postgresql">
<![CDATA[ SELECT t1.EMPLOYEE_ID, t1.ID, t1.LINE_TYPE_ID, t1.NAME FROM HR_RESUME_LINE t1
<![CDATA[ SELECT t1.EMPLOYEE_ID, t21.NAME AS EMPLOYEE_ID_TEXT, t1.ID, t1.LINE_TYPE_ID, t31.NAME AS LINE_TYPE_ID_TEXT, t1.NAME FROM HR_RESUME_LINE t1 LEFT JOIN HR_EMPLOYEE t11 ON t1.EMPLOYEE_ID = t11.ID LEFT JOIN RESOURCE_RESOURCE t21 ON t11.RESOURCE_ID = t21.ID LEFT JOIN HR_RESUME_LINE_TYPE t31 ON t1.LINE_TYPE_ID = t31.ID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.EMPLOYEE_ID, t1.ID, t1.LINE_TYPE_ID, t1.NAME FROM HR_RESUME_LINE t1
<![CDATA[ SELECT t1.EMPLOYEE_ID, t21.NAME AS EMPLOYEE_ID_TEXT, t1.ID, t1.LINE_TYPE_ID, t31.NAME AS LINE_TYPE_ID_TEXT, t1.NAME FROM HR_RESUME_LINE t1 LEFT JOIN HR_EMPLOYEE t11 ON t1.EMPLOYEE_ID = t11.ID LEFT JOIN RESOURCE_RESOURCE t21 ON t11.RESOURCE_ID = t21.ID LEFT JOIN HR_RESUME_LINE_TYPE t31 ON t1.LINE_TYPE_ID = t31.ID
]]>
</sql>
......
......@@ -74152,7 +74152,7 @@
{
"fieldname":"EMPLOYEE_ID" ,
"codename":"Employee_id",
"field_logic_name":"ID",
"field_logic_name":"员工",
"entity_name":"Hr_resume_line",
"ref_de":"HR_EMPLOYEE",
"ref_field_name":"ID",
......@@ -74169,7 +74169,7 @@
{
"fieldname":"LINE_TYPE_ID" ,
"codename":"Line_type_id",
"field_logic_name":"ID",
"field_logic_name":"类型",
"entity_name":"Hr_resume_line",
"ref_de":"HR_RESUME_LINE_TYPE",
"ref_field_name":"ID",
......@@ -74183,6 +74183,42 @@
"key_field":0,
"show_order":1000,
"major_field":0
},
{
"fieldname":"EMPLOYEE_ID_TEXT" ,
"codename":"Employee_id_text",
"field_logic_name":"员工",
"entity_name":"Hr_resume_line",
"ref_de":"HR_EMPLOYEE",
"ref_field_name":"NAME",
"relation_name":"DER1N_HR_RESUME_LINE_HR_EMPLOYEE_EMPLOYEE_ID",
"relation_codename":"Odoo_employee",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"show_order":1000,
"major_field":0
},
{
"fieldname":"LINE_TYPE_ID_TEXT" ,
"codename":"Line_type_id_text",
"field_logic_name":"类型",
"entity_name":"Hr_resume_line",
"ref_de":"HR_RESUME_LINE_TYPE",
"ref_field_name":"NAME",
"relation_name":"DER1N_HR_RESUME_LINE_HR_RESUME_LINE_TYPE_LINE_TYPE_ID",
"relation_codename":"Odoo_resume_line_type",
"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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册