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

xignzi006 发布系统代码

上级 eaeea462
...@@ -200,6 +200,21 @@ public class Purchase_requisition extends EntityMP implements Serializable { ...@@ -200,6 +200,21 @@ public class Purchase_requisition extends EntityMP implements Serializable {
@JSONField(name = "quantity_copy") @JSONField(name = "quantity_copy")
@JsonProperty("quantity_copy") @JsonProperty("quantity_copy")
private String quantityCopy; private String quantityCopy;
/**
* 采购员
*/
@DEField(name = "user_id")
@TableField(value = "user_id")
@JSONField(name = "user_id")
@JsonProperty("user_id")
private Long userId;
/**
* 采购员
*/
@TableField(exist = false)
@JSONField(name = "user_name")
@JsonProperty("user_name")
private String userName;
/** /**
* *
...@@ -225,6 +240,14 @@ public class Purchase_requisition extends EntityMP implements Serializable { ...@@ -225,6 +240,14 @@ public class Purchase_requisition extends EntityMP implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooCreate; private cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooCreate;
/**
* 采购员
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooUser;
/** /**
* *
*/ */
...@@ -381,6 +404,14 @@ public class Purchase_requisition extends EntityMP implements Serializable { ...@@ -381,6 +404,14 @@ public class Purchase_requisition extends EntityMP implements Serializable {
this.modify("vendor_id",vendorId); this.modify("vendor_id",vendorId);
} }
/**
* 设置 [采购员]
*/
public void setUserId(Long userId){
this.userId = userId ;
this.modify("user_id",userId);
}
@Override @Override
public Serializable getDefaultKey(boolean gen) { public Serializable getDefaultKey(boolean gen) {
......
...@@ -125,6 +125,27 @@ public class Purchase_requisitionSearchContext extends QueryWrapperContext<Purch ...@@ -125,6 +125,27 @@ public class Purchase_requisitionSearchContext extends QueryWrapperContext<Purch
this.getSearchCond().like("vendor_id_text", n_vendor_id_text_like); this.getSearchCond().like("vendor_id_text", n_vendor_id_text_like);
} }
} }
private Long n_user_id_eq;//[采购员]
public void setN_user_id_eq(Long n_user_id_eq) {
this.n_user_id_eq = n_user_id_eq;
if(!ObjectUtils.isEmpty(this.n_user_id_eq)){
this.getSearchCond().eq("user_id", n_user_id_eq);
}
}
private String n_user_name_eq;//[采购员]
public void setN_user_name_eq(String n_user_name_eq) {
this.n_user_name_eq = n_user_name_eq;
if(!ObjectUtils.isEmpty(this.n_user_name_eq)){
this.getSearchCond().eq("user_name", n_user_name_eq);
}
}
private String n_user_name_like;//[采购员]
public void setN_user_name_like(String n_user_name_like) {
this.n_user_name_like = n_user_name_like;
if(!ObjectUtils.isEmpty(this.n_user_name_like)){
this.getSearchCond().like("user_name", n_user_name_like);
}
}
/** /**
* 启用快速搜索 * 启用快速搜索
......
...@@ -68,6 +68,8 @@ public interface Purchase_requisitionMapper extends BaseMapper<Purchase_requisit ...@@ -68,6 +68,8 @@ public interface Purchase_requisitionMapper extends BaseMapper<Purchase_requisit
List<Purchase_requisition> selectByCreateUid(@Param("id") Serializable id) ; List<Purchase_requisition> selectByCreateUid(@Param("id") Serializable id) ;
List<Purchase_requisition> selectByUserId(@Param("id") Serializable id) ;
List<Purchase_requisition> selectByWriteUid(@Param("id") Serializable id) ; List<Purchase_requisition> selectByWriteUid(@Param("id") Serializable id) ;
} }
...@@ -50,6 +50,8 @@ public interface IPurchase_requisitionService extends IService<Purchase_requisit ...@@ -50,6 +50,8 @@ public interface IPurchase_requisitionService extends IService<Purchase_requisit
void removeByVendorId(Long id) ; void removeByVendorId(Long id) ;
List<Purchase_requisition> selectByCreateUid(Long id) ; List<Purchase_requisition> selectByCreateUid(Long id) ;
void removeByCreateUid(Long id) ; void removeByCreateUid(Long id) ;
List<Purchase_requisition> selectByUserId(Long id) ;
void removeByUserId(Long id) ;
List<Purchase_requisition> selectByWriteUid(Long id) ; List<Purchase_requisition> selectByWriteUid(Long id) ;
void removeByWriteUid(Long id) ; void removeByWriteUid(Long id) ;
/** /**
......
...@@ -242,6 +242,16 @@ public class Purchase_requisitionServiceImpl extends ServiceImpl<Purchase_requis ...@@ -242,6 +242,16 @@ public class Purchase_requisitionServiceImpl extends ServiceImpl<Purchase_requis
this.remove(new QueryWrapper<Purchase_requisition>().eq("create_uid",id)); this.remove(new QueryWrapper<Purchase_requisition>().eq("create_uid",id));
} }
@Override
public List<Purchase_requisition> selectByUserId(Long id) {
return baseMapper.selectByUserId(id);
}
@Override
public void removeByUserId(Long id) {
this.remove(new QueryWrapper<Purchase_requisition>().eq("user_id",id));
}
@Override @Override
public List<Purchase_requisition> selectByWriteUid(Long id) { public List<Purchase_requisition> selectByWriteUid(Long id) {
return baseMapper.selectByWriteUid(id); return baseMapper.selectByWriteUid(id);
...@@ -300,6 +310,16 @@ public class Purchase_requisitionServiceImpl extends ServiceImpl<Purchase_requis ...@@ -300,6 +310,16 @@ public class Purchase_requisitionServiceImpl extends ServiceImpl<Purchase_requis
} }
et.setCreateUname(odooCreate.getName()); et.setCreateUname(odooCreate.getName());
} }
//实体关系[DER1N_PURCHASE_REQUISITION_RES_USERS_USER_ID]
if(!ObjectUtils.isEmpty(et.getUserId())){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooUser=et.getOdooUser();
if(ObjectUtils.isEmpty(odooUser)){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users majorEntity=resUsersService.get(et.getUserId());
et.setOdooUser(majorEntity);
odooUser=majorEntity;
}
et.setUserName(odooUser.getName());
}
//实体关系[DER1N_PURCHASE_REQUISITION_RES_USERS_WRITE_UID] //实体关系[DER1N_PURCHASE_REQUISITION_RES_USERS_WRITE_UID]
if(!ObjectUtils.isEmpty(et.getWriteUid())){ if(!ObjectUtils.isEmpty(et.getWriteUid())){
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooWrite=et.getOdooWrite(); cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users odooWrite=et.getOdooWrite();
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性--> <!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Purchase_requisitionResultMap" databaseId="postgresql"> <select id="selectById" resultMap="Purchase_requisitionResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.CREATE_DATE, t1.CREATE_UID, t41.NAME AS CREATE_UNAME, t1.DATE_END, t1.ID, t1.NAME, t1.ORDERING_DATE, t1.ORIGIN, t51.QUANTITY_COPY, t1.SCHEDULE_DATE, t1.STATE, t1.TYPE_ID, t51.NAME AS TYPE_ID_TEXT, t1.VENDOR_ID, t61.NAME AS VENDOR_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UNAME FROM PURCHASE_REQUISITION t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.CREATE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID LEFT JOIN PURCHASE_REQUISITION_TYPE t51 ON t1.TYPE_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t1.VENDOR_ID = t61.ID ) t1 where id=#{id}]]> <![CDATA[select t1.* from (SELECT t1.CREATE_DATE, t1.CREATE_UID, t41.NAME AS CREATE_UNAME, t1.DATE_END, t1.ID, t1.NAME, t1.ORDERING_DATE, t1.ORIGIN, t51.QUANTITY_COPY, t1.SCHEDULE_DATE, t1.STATE, t1.TYPE_ID, t51.NAME AS TYPE_ID_TEXT, t1.USER_ID, t81.NAME AS USER_NAME, t1.VENDOR_ID, t61.NAME AS VENDOR_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UNAME FROM PURCHASE_REQUISITION t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.CREATE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID LEFT JOIN PURCHASE_REQUISITION_TYPE t51 ON t1.TYPE_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t1.VENDOR_ID = t61.ID LEFT JOIN RES_USERS t71 ON t1.USER_ID = t71.ID LEFT JOIN RES_PARTNER t81 ON t71.PARTNER_ID = t81.ID ) t1 where id=#{id}]]>
</select> </select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 --> <!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
<result property="vendorId" column="vendor_id" /> <result property="vendorId" column="vendor_id" />
<result property="vendorIdText" column="vendor_id_text" /> <result property="vendorIdText" column="vendor_id_text" />
<result property="quantityCopy" column="quantity_copy" /> <result property="quantityCopy" column="quantity_copy" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 --> <!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
...@@ -36,6 +38,8 @@ ...@@ -36,6 +38,8 @@
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 --> <!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="odooCreate" javaType="cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users" column="create_uid" select="cn.ibizlab.businesscentral.core.odoo_base.mapper.Res_usersMapper.selectById" fetchType="lazy"></association> <association property="odooCreate" javaType="cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users" column="create_uid" select="cn.ibizlab.businesscentral.core.odoo_base.mapper.Res_usersMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 --> <!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="odooUser" javaType="cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users" column="user_id" select="cn.ibizlab.businesscentral.core.odoo_base.mapper.Res_usersMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="odooWrite" javaType="cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users" column="write_uid" select="cn.ibizlab.businesscentral.core.odoo_base.mapper.Res_usersMapper.selectById" fetchType="lazy"></association> <association property="odooWrite" javaType="cn.ibizlab.businesscentral.core.odoo_base.domain.Res_users" column="write_uid" select="cn.ibizlab.businesscentral.core.odoo_base.mapper.Res_usersMapper.selectById" fetchType="lazy"></association>
</resultMap> </resultMap>
...@@ -59,6 +63,13 @@ ...@@ -59,6 +63,13 @@
<include refid="Default" /> <include refid="Default" />
) t1 ) t1
where create_uid=#{id} where create_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_RES_USERS_USER_ID] -->
<select id="selectByUserId" resultMap="Purchase_requisitionResultMap">
select t1.* from (
<include refid="Default" />
) t1
where user_id=#{id}
</select> </select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_RES_USERS_WRITE_UID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_REQUISITION_RES_USERS_WRITE_UID] -->
<select id="selectByWriteUid" resultMap="Purchase_requisitionResultMap"> <select id="selectByWriteUid" resultMap="Purchase_requisitionResultMap">
...@@ -79,12 +90,12 @@ ...@@ -79,12 +90,12 @@
<!--数据查询[Default]--> <!--数据查询[Default]-->
<sql id="Default" databaseId="postgresql"> <sql id="Default" databaseId="postgresql">
<![CDATA[ SELECT t1.CREATE_DATE, t1.CREATE_UID, t41.NAME AS CREATE_UNAME, t1.DATE_END, t1.ID, t1.NAME, t1.ORDERING_DATE, t1.ORIGIN, t51.QUANTITY_COPY, t1.SCHEDULE_DATE, t1.STATE, t1.TYPE_ID, t51.NAME AS TYPE_ID_TEXT, t1.VENDOR_ID, t61.NAME AS VENDOR_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UNAME FROM PURCHASE_REQUISITION t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.CREATE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID LEFT JOIN PURCHASE_REQUISITION_TYPE t51 ON t1.TYPE_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t1.VENDOR_ID = t61.ID <![CDATA[ SELECT t1.CREATE_DATE, t1.CREATE_UID, t41.NAME AS CREATE_UNAME, t1.DATE_END, t1.ID, t1.NAME, t1.ORDERING_DATE, t1.ORIGIN, t51.QUANTITY_COPY, t1.SCHEDULE_DATE, t1.STATE, t1.TYPE_ID, t51.NAME AS TYPE_ID_TEXT, t1.USER_ID, t81.NAME AS USER_NAME, t1.VENDOR_ID, t61.NAME AS VENDOR_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UNAME FROM PURCHASE_REQUISITION t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.CREATE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID LEFT JOIN PURCHASE_REQUISITION_TYPE t51 ON t1.TYPE_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t1.VENDOR_ID = t61.ID LEFT JOIN RES_USERS t71 ON t1.USER_ID = t71.ID LEFT JOIN RES_PARTNER t81 ON t71.PARTNER_ID = t81.ID
]]> ]]>
</sql> </sql>
<!--数据查询[View]--> <!--数据查询[View]-->
<sql id="View" databaseId="postgresql"> <sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.CREATE_DATE, t1.CREATE_UID, t41.NAME AS CREATE_UNAME, t1.DATE_END, t1.ID, t1.NAME, t1.ORDERING_DATE, t1.ORIGIN, t51.QUANTITY_COPY, t1.SCHEDULE_DATE, t1.STATE, t1.TYPE_ID, t51.NAME AS TYPE_ID_TEXT, t1.VENDOR_ID, t61.NAME AS VENDOR_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UNAME FROM PURCHASE_REQUISITION t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.CREATE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID LEFT JOIN PURCHASE_REQUISITION_TYPE t51 ON t1.TYPE_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t1.VENDOR_ID = t61.ID <![CDATA[ SELECT t1.CREATE_DATE, t1.CREATE_UID, t41.NAME AS CREATE_UNAME, t1.DATE_END, t1.ID, t1.NAME, t1.ORDERING_DATE, t1.ORIGIN, t51.QUANTITY_COPY, t1.SCHEDULE_DATE, t1.STATE, t1.TYPE_ID, t51.NAME AS TYPE_ID_TEXT, t1.USER_ID, t81.NAME AS USER_NAME, t1.VENDOR_ID, t61.NAME AS VENDOR_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UNAME FROM PURCHASE_REQUISITION t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.CREATE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID LEFT JOIN PURCHASE_REQUISITION_TYPE t51 ON t1.TYPE_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t1.VENDOR_ID = t61.ID LEFT JOIN RES_USERS t71 ON t1.USER_ID = t71.ID LEFT JOIN RES_PARTNER t81 ON t71.PARTNER_ID = t81.ID
]]> ]]>
</sql> </sql>
</mapper> </mapper>
......
...@@ -124584,6 +124584,39 @@ ...@@ -124584,6 +124584,39 @@
"data_length":60, "data_length":60,
"key_field":0, "key_field":0,
"major_field":0 "major_field":0
},
{
"fieldname":"USER_ID" ,
"codename":"User_id",
"field_logic_name":"采购员",
"entity_name":"Purchase_requisition",
"ref_de":"RES_USERS",
"ref_field_name":"ID",
"relation_name":"DER1N_PURCHASE_REQUISITION_RES_USERS_USER_ID",
"relation_codename":"Odoo_user",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"USER_NAME" ,
"codename":"User_name",
"field_logic_name":"采购员",
"entity_name":"Purchase_requisition",
"ref_de":"RES_USERS",
"ref_field_name":"NAME",
"relation_name":"DER1N_PURCHASE_REQUISITION_RES_USERS_USER_ID",
"relation_codename":"Odoo_user",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
} }
], ],
"subEntitys":[ "subEntitys":[
...@@ -124619,6 +124652,12 @@ ...@@ -124619,6 +124652,12 @@
"entity_name":"PURCHASE_REQUISITION", "entity_name":"PURCHASE_REQUISITION",
"ref_entity_name":"RES_USERS" "ref_entity_name":"RES_USERS"
}, },
{"name":"DER1N_PURCHASE_REQUISITION_RES_USERS_USER_ID",
"relation_type":"DER1N",
"code_name":"Odoo_user",
"entity_name":"PURCHASE_REQUISITION",
"ref_entity_name":"RES_USERS"
},
{"name":"DER1N_PURCHASE_REQUISITION_RES_USERS_WRITE_UID", {"name":"DER1N_PURCHASE_REQUISITION_RES_USERS_WRITE_UID",
"relation_type":"DER1N", "relation_type":"DER1N",
"code_name":"Odoo_write", "code_name":"Odoo_write",
...@@ -147636,6 +147675,12 @@ ...@@ -147636,6 +147675,12 @@
"entity_name":"PURCHASE_REQUISITION", "entity_name":"PURCHASE_REQUISITION",
"ref_entity_name":"RES_USERS" "ref_entity_name":"RES_USERS"
}, },
{"name":"DER1N_PURCHASE_REQUISITION_RES_USERS_USER_ID",
"relation_type":"DER1N",
"code_name":"Odoo_user",
"entity_name":"PURCHASE_REQUISITION",
"ref_entity_name":"RES_USERS"
},
{"name":"DER1N_PURCHASE_REQUISITION_RES_USERS_WRITE_UID", {"name":"DER1N_PURCHASE_REQUISITION_RES_USERS_WRITE_UID",
"relation_type":"DER1N", "relation_type":"DER1N",
"code_name":"Odoo_write", "code_name":"Odoo_write",
...@@ -209,6 +209,24 @@ public class Purchase_requisitionDTO extends DTOBase implements Serializable { ...@@ -209,6 +209,24 @@ public class Purchase_requisitionDTO extends DTOBase implements Serializable {
@Size(min = 0, max = 60, message = "内容长度必须小于等于[60]") @Size(min = 0, max = 60, message = "内容长度必须小于等于[60]")
private String quantityCopy; private String quantityCopy;
/**
* 属性 [USER_ID]
*
*/
@JSONField(name = "user_id")
@JsonProperty("user_id")
@JsonSerialize(using = ToStringSerializer.class)
private Long userId;
/**
* 属性 [USER_NAME]
*
*/
@JSONField(name = "user_name")
@JsonProperty("user_name")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String userName;
/** /**
* 设置 [NAME] * 设置 [NAME]
...@@ -306,6 +324,14 @@ public class Purchase_requisitionDTO extends DTOBase implements Serializable { ...@@ -306,6 +324,14 @@ public class Purchase_requisitionDTO extends DTOBase implements Serializable {
this.modify("vendor_id",vendorId); this.modify("vendor_id",vendorId);
} }
/**
* 设置 [USER_ID]
*/
public void setUserId(Long userId){
this.userId = userId ;
this.modify("user_id",userId);
}
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册