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

xignzi006 发布系统代码

上级 147414bf
...@@ -58,4 +58,27 @@ public class product_productFallback implements product_productFeignClient{ ...@@ -58,4 +58,27 @@ public class product_productFallback implements product_productFeignClient{
return null; return null;
} }
public Product_product getDraft(){
return null;
}
public Boolean checkKey(Product_product product_product){
return false;
}
public Boolean save(Product_product product_product){
return false;
}
public Boolean saveBatch(List<Product_product> product_products){
return false;
}
public Page<Product_product> searchDefault(Product_productSearchContext context){
return null;
}
} }
...@@ -56,4 +56,24 @@ public interface product_productFeignClient { ...@@ -56,4 +56,24 @@ public interface product_productFeignClient {
Page<Product_product> select(); Page<Product_product> select();
@RequestMapping(method = RequestMethod.GET, value = "/product_products/getdraft")
Product_product getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/product_products/checkkey")
Boolean checkKey(@RequestBody Product_product product_product);
@RequestMapping(method = RequestMethod.POST, value = "/product_products/save")
Boolean save(@RequestBody Product_product product_product);
@RequestMapping(method = RequestMethod.POST, value = "/product_products/savebatch")
Boolean saveBatch(@RequestBody List<Product_product> product_products);
@RequestMapping(method = RequestMethod.POST, value = "/product_products/searchdefault")
Page<Product_product> searchDefault(@RequestBody Product_productSearchContext context);
} }
...@@ -58,4 +58,27 @@ public class product_templateFallback implements product_templateFeignClient{ ...@@ -58,4 +58,27 @@ public class product_templateFallback implements product_templateFeignClient{
return null; return null;
} }
public Product_template getDraft(){
return null;
}
public Boolean checkKey(Product_template product_template){
return false;
}
public Boolean save(Product_template product_template){
return false;
}
public Boolean saveBatch(List<Product_template> product_templates){
return false;
}
public Page<Product_template> searchDefault(Product_templateSearchContext context){
return null;
}
} }
...@@ -56,4 +56,24 @@ public interface product_templateFeignClient { ...@@ -56,4 +56,24 @@ public interface product_templateFeignClient {
Page<Product_template> select(); Page<Product_template> select();
@RequestMapping(method = RequestMethod.GET, value = "/product_templates/getdraft")
Product_template getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/product_templates/checkkey")
Boolean checkKey(@RequestBody Product_template product_template);
@RequestMapping(method = RequestMethod.POST, value = "/product_templates/save")
Boolean save(@RequestBody Product_template product_template);
@RequestMapping(method = RequestMethod.POST, value = "/product_templates/savebatch")
Boolean saveBatch(@RequestBody List<Product_template> product_templates);
@RequestMapping(method = RequestMethod.POST, value = "/product_templates/searchdefault")
Page<Product_template> searchDefault(@RequestBody Product_templateSearchContext context);
} }
...@@ -27,6 +27,76 @@ import cn.ibizlab.businesscentral.core.odoo_product.domain.Product_product; ...@@ -27,6 +27,76 @@ import cn.ibizlab.businesscentral.core.odoo_product.domain.Product_product;
@Data @Data
public class Product_productSearchContext extends QueryWrapperContext<Product_product> { public class Product_productSearchContext extends QueryWrapperContext<Product_product> {
private String n_activity_state_eq;//[活动状态]
public void setN_activity_state_eq(String n_activity_state_eq) {
this.n_activity_state_eq = n_activity_state_eq;
if(!ObjectUtils.isEmpty(this.n_activity_state_eq)){
this.getSearchCond().eq("activity_state", n_activity_state_eq);
}
}
private String n_name_eq;//[名称]
public void setN_name_eq(String n_name_eq) {
this.n_name_eq = n_name_eq;
if(!ObjectUtils.isEmpty(this.n_name_eq)){
this.getSearchCond().eq("name", n_name_eq);
}
}
private String n_name_like;//[名称]
public void setN_name_like(String n_name_like) {
this.n_name_like = n_name_like;
if(!ObjectUtils.isEmpty(this.n_name_like)){
this.getSearchCond().like("name", n_name_like);
}
}
private String n_create_uid_text_eq;//[创建人]
public void setN_create_uid_text_eq(String n_create_uid_text_eq) {
this.n_create_uid_text_eq = n_create_uid_text_eq;
if(!ObjectUtils.isEmpty(this.n_create_uid_text_eq)){
this.getSearchCond().eq("create_uid_text", n_create_uid_text_eq);
}
}
private String n_create_uid_text_like;//[创建人]
public void setN_create_uid_text_like(String n_create_uid_text_like) {
this.n_create_uid_text_like = n_create_uid_text_like;
if(!ObjectUtils.isEmpty(this.n_create_uid_text_like)){
this.getSearchCond().like("create_uid_text", n_create_uid_text_like);
}
}
private String n_write_uid_text_eq;//[最后更新人]
public void setN_write_uid_text_eq(String n_write_uid_text_eq) {
this.n_write_uid_text_eq = n_write_uid_text_eq;
if(!ObjectUtils.isEmpty(this.n_write_uid_text_eq)){
this.getSearchCond().eq("write_uid_text", n_write_uid_text_eq);
}
}
private String n_write_uid_text_like;//[最后更新人]
public void setN_write_uid_text_like(String n_write_uid_text_like) {
this.n_write_uid_text_like = n_write_uid_text_like;
if(!ObjectUtils.isEmpty(this.n_write_uid_text_like)){
this.getSearchCond().like("write_uid_text", n_write_uid_text_like);
}
}
private Long n_create_uid_eq;//[创建人]
public void setN_create_uid_eq(Long n_create_uid_eq) {
this.n_create_uid_eq = n_create_uid_eq;
if(!ObjectUtils.isEmpty(this.n_create_uid_eq)){
this.getSearchCond().eq("create_uid", n_create_uid_eq);
}
}
private Long n_write_uid_eq;//[最后更新人]
public void setN_write_uid_eq(Long n_write_uid_eq) {
this.n_write_uid_eq = n_write_uid_eq;
if(!ObjectUtils.isEmpty(this.n_write_uid_eq)){
this.getSearchCond().eq("write_uid", n_write_uid_eq);
}
}
private Long n_product_tmpl_id_eq;//[产品模板]
public void setN_product_tmpl_id_eq(Long n_product_tmpl_id_eq) {
this.n_product_tmpl_id_eq = n_product_tmpl_id_eq;
if(!ObjectUtils.isEmpty(this.n_product_tmpl_id_eq)){
this.getSearchCond().eq("product_tmpl_id", n_product_tmpl_id_eq);
}
}
/** /**
* 启用快速搜索 * 启用快速搜索
......
...@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
public interface Product_productMapper extends BaseMapper<Product_product>{ public interface Product_productMapper extends BaseMapper<Product_product>{
Page<Product_product> searchDefault(IPage page, @Param("srf") Product_productSearchContext context, @Param("ew") Wrapper<Product_product> wrapper) ;
@Override @Override
Product_product selectById(Serializable id); Product_product selectById(Serializable id);
@Override @Override
...@@ -61,4 +62,10 @@ public interface Product_productMapper extends BaseMapper<Product_product>{ ...@@ -61,4 +62,10 @@ public interface Product_productMapper extends BaseMapper<Product_product>{
@Delete("${sql}") @Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param); boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<Product_product> selectByProductTmplId(@Param("id") Serializable id) ;
List<Product_product> selectByCreateUid(@Param("id") Serializable id) ;
List<Product_product> selectByWriteUid(@Param("id") Serializable id) ;
} }
...@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
public interface Product_templateMapper extends BaseMapper<Product_template>{ public interface Product_templateMapper extends BaseMapper<Product_template>{
Page<Product_template> searchDefault(IPage page, @Param("srf") Product_templateSearchContext context, @Param("ew") Wrapper<Product_template> wrapper) ;
@Override @Override
Product_template selectById(Serializable id); Product_template selectById(Serializable id);
@Override @Override
...@@ -61,4 +62,18 @@ public interface Product_templateMapper extends BaseMapper<Product_template>{ ...@@ -61,4 +62,18 @@ public interface Product_templateMapper extends BaseMapper<Product_template>{
@Delete("${sql}") @Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param); boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<Product_template> selectByCategId(@Param("id") Serializable id) ;
List<Product_template> selectByCompanyId(@Param("id") Serializable id) ;
List<Product_template> selectByCreateUid(@Param("id") Serializable id) ;
List<Product_template> selectByResponsibleId(@Param("id") Serializable id) ;
List<Product_template> selectByWriteUid(@Param("id") Serializable id) ;
List<Product_template> selectByUomId(@Param("id") Serializable id) ;
List<Product_template> selectByUomPoId(@Param("id") Serializable id) ;
} }
...@@ -33,6 +33,17 @@ public interface IProduct_productService extends IService<Product_product>{ ...@@ -33,6 +33,17 @@ public interface IProduct_productService extends IService<Product_product>{
boolean remove(Long key) ; boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ; void removeBatch(Collection<Long> idList) ;
Product_product get(Long key) ; Product_product get(Long key) ;
Product_product getDraft(Product_product et) ;
boolean checkKey(Product_product et) ;
boolean save(Product_product et) ;
void saveBatch(List<Product_product> list) ;
Page<Product_product> searchDefault(Product_productSearchContext context) ;
List<Product_product> selectByProductTmplId(Long id) ;
void removeByProductTmplId(Long id) ;
List<Product_product> selectByCreateUid(Long id) ;
void removeByCreateUid(Long id) ;
List<Product_product> selectByWriteUid(Long id) ;
void removeByWriteUid(Long id) ;
/** /**
*自定义查询SQL *自定义查询SQL
* @param sql select * from table where id =#{et.param} * @param sql select * from table where id =#{et.param}
......
...@@ -33,6 +33,25 @@ public interface IProduct_templateService extends IService<Product_template>{ ...@@ -33,6 +33,25 @@ public interface IProduct_templateService extends IService<Product_template>{
boolean remove(Long key) ; boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ; void removeBatch(Collection<Long> idList) ;
Product_template get(Long key) ; Product_template get(Long key) ;
Product_template getDraft(Product_template et) ;
boolean checkKey(Product_template et) ;
boolean save(Product_template et) ;
void saveBatch(List<Product_template> list) ;
Page<Product_template> searchDefault(Product_templateSearchContext context) ;
List<Product_template> selectByCategId(Long id) ;
void removeByCategId(Long id) ;
List<Product_template> selectByCompanyId(Long id) ;
void removeByCompanyId(Long id) ;
List<Product_template> selectByCreateUid(Long id) ;
void removeByCreateUid(Long id) ;
List<Product_template> selectByResponsibleId(Long id) ;
void removeByResponsibleId(Long id) ;
List<Product_template> selectByWriteUid(Long id) ;
void removeByWriteUid(Long id) ;
List<Product_template> selectByUomId(Long id) ;
void removeByUomId(Long id) ;
List<Product_template> selectByUomPoId(Long id) ;
void removeByUomPoId(Long id) ;
/** /**
*自定义查询SQL *自定义查询SQL
* @param sql select * from table where id =#{et.param} * @param sql select * from table where id =#{et.param}
......
...@@ -267,7 +267,89 @@ public class Product_productServiceImpl extends ServiceImpl<Product_productMappe ...@@ -267,7 +267,89 @@ public class Product_productServiceImpl extends ServiceImpl<Product_productMappe
return et; return et;
} }
@Override
public Product_product getDraft(Product_product et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(Product_product et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Product_product et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Product_product et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Product_product> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Product_product> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Product_product> selectByProductTmplId(Long id) {
return baseMapper.selectByProductTmplId(id);
}
@Override
public void removeByProductTmplId(Long id) {
this.remove(new QueryWrapper<Product_product>().eq("product_tmpl_id",id));
}
@Override
public List<Product_product> selectByCreateUid(Long id) {
return baseMapper.selectByCreateUid(id);
}
@Override
public void removeByCreateUid(Long id) {
this.remove(new QueryWrapper<Product_product>().eq("create_uid",id));
}
@Override
public List<Product_product> selectByWriteUid(Long id) {
return baseMapper.selectByWriteUid(id);
}
@Override
public void removeByWriteUid(Long id) {
this.remove(new QueryWrapper<Product_product>().eq("write_uid",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Product_product> searchDefault(Product_productSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Product_product> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Product_product>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
......
...@@ -165,7 +165,129 @@ public class Product_templateServiceImpl extends ServiceImpl<Product_templateMap ...@@ -165,7 +165,129 @@ public class Product_templateServiceImpl extends ServiceImpl<Product_templateMap
return et; return et;
} }
@Override
public Product_template getDraft(Product_template et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(Product_template et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Product_template et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Product_template et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Product_template> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Product_template> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Product_template> selectByCategId(Long id) {
return baseMapper.selectByCategId(id);
}
@Override
public void removeByCategId(Long id) {
this.remove(new QueryWrapper<Product_template>().eq("categ_id",id));
}
@Override
public List<Product_template> selectByCompanyId(Long id) {
return baseMapper.selectByCompanyId(id);
}
@Override
public void removeByCompanyId(Long id) {
this.remove(new QueryWrapper<Product_template>().eq("company_id",id));
}
@Override
public List<Product_template> selectByCreateUid(Long id) {
return baseMapper.selectByCreateUid(id);
}
@Override
public void removeByCreateUid(Long id) {
this.remove(new QueryWrapper<Product_template>().eq("create_uid",id));
}
@Override
public List<Product_template> selectByResponsibleId(Long id) {
return baseMapper.selectByResponsibleId(id);
}
@Override
public void removeByResponsibleId(Long id) {
this.remove(new QueryWrapper<Product_template>().eq("responsible_id",id));
}
@Override
public List<Product_template> selectByWriteUid(Long id) {
return baseMapper.selectByWriteUid(id);
}
@Override
public void removeByWriteUid(Long id) {
this.remove(new QueryWrapper<Product_template>().eq("write_uid",id));
}
@Override
public List<Product_template> selectByUomId(Long id) {
return baseMapper.selectByUomId(id);
}
@Override
public void removeByUomId(Long id) {
this.remove(new QueryWrapper<Product_template>().eq("uom_id",id));
}
@Override
public List<Product_template> selectByUomPoId(Long id) {
return baseMapper.selectByUomPoId(id);
}
@Override
public void removeByUomPoId(Long id) {
this.remove(new QueryWrapper<Product_template>().eq("uom_po_id",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Product_template> searchDefault(Product_templateSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Product_template> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Product_template>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
<mapper namespace="cn.ibizlab.businesscentral.core.odoo_product.mapper.Product_productMapper"> <mapper namespace="cn.ibizlab.businesscentral.core.odoo_product.mapper.Product_productMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性--> <!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Product_productResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.ACTIVE, t11.AVAILABLE_IN_POS, t11.AVAILABLE_THRESHOLD, t1.BARCODE, t11.CAN_BE_EXPENSED, t11.CATEG_ID, t11.COLOR, t11.COMPANY_ID, t1.CREATE_DATE, t1.CREATE_UID, t31.NAME AS CREATE_UID_TEXT, t11.CUSTOM_MESSAGE, t1.DEFAULT_CODE, t11.DESCRIPTION, t11.DESCRIPTION_PICKING, t11.DESCRIPTION_PICKINGIN, t11.DESCRIPTION_PICKINGOUT, t11.DESCRIPTION_PURCHASE, t11.DESCRIPTION_SALE, t11.EVENT_OK, t11.EXPENSE_POLICY, t1.ID, t11.INVENTORY_AVAILABILITY, t11.INVOICE_POLICY, t11.ISPARTS, t11.IS_PUBLISHED, t11.LIST_PRICE, t1.MESSAGE_MAIN_ATTACHMENT_ID, t11.NAME, t11.POS_CATEG_ID, t11.PRODUCE_DELAY, t1.PRODUCT_TMPL_ID, t11.PURCHASE_LINE_WARN, t11.PURCHASE_LINE_WARN_MSG, t11.PURCHASE_METHOD, t11.PURCHASE_OK, t11.RATING_LAST_VALUE, t11.RENTAL, t11.RESPONSIBLE_ID, t11.SALE_DELAY, t11.SALE_LINE_WARN, t11.SALE_LINE_WARN_MSG, t11.SALE_OK, t11.SEQUENCE, t11.SERVICE_TO_PURCHASE, t11.SERVICE_TYPE, t11.TO_WEIGHT, t11.TRACKING, t11.TYPE, t11.UOM_ID, t61.NAME AS UOM_NAME, t11.UOM_PO_ID, t1.VOLUME, t11.WEBSITE_DESCRIPTION, t11.WEBSITE_ID, t11.WEBSITE_META_DESCRIPTION, t11.WEBSITE_META_KEYWORDS, t11.WEBSITE_META_OG_IMG, t11.WEBSITE_META_TITLE, t11.WEBSITE_SEQUENCE, t11.WEBSITE_SIZE_X, t11.WEBSITE_SIZE_Y, t1.WEIGHT, t1.WRITE_DATE, t1.WRITE_UID, t51.NAME AS WRITE_UID_TEXT FROM PRODUCT_PRODUCT t1 LEFT JOIN PRODUCT_TEMPLATE t11 ON t1.PRODUCT_TMPL_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 RES_USERS t41 ON t1.WRITE_UID = t41.ID LEFT JOIN RES_PARTNER t51 ON t41.PARTNER_ID = t51.ID LEFT JOIN UOM_UOM t61 ON t11.UOM_ID = t61.ID ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 --> <!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Product_productResultMap" type="cn.ibizlab.businesscentral.core.odoo_product.domain.Product_product" autoMapping="true"> <resultMap id="Product_productResultMap" type="cn.ibizlab.businesscentral.core.odoo_product.domain.Product_product" autoMapping="true">
...@@ -183,8 +186,45 @@ ...@@ -183,8 +186,45 @@
</resultMap> </resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_PRODUCT__PRODUCT_TEMPLATE__PRODUCT_TMPL_ID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_PRODUCT__PRODUCT_TEMPLATE__PRODUCT_TMPL_ID] -->
<select id="selectByProductTmplId" resultMap="Product_productResultMap">
select t1.* from (
<include refid="Default" />
) t1
where product_tmpl_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_PRODUCT__RES_USERS__CREATE_UID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_PRODUCT__RES_USERS__CREATE_UID] -->
<select id="selectByCreateUid" resultMap="Product_productResultMap">
select t1.* from (
<include refid="Default" />
) t1
where create_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_PRODUCT__RES_USERS__WRITE_UID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_PRODUCT__RES_USERS__WRITE_UID] -->
<select id="selectByWriteUid" resultMap="Product_productResultMap">
select t1.* from (
<include refid="Default" />
) t1
where write_uid=#{id}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.odoo_product.filter.Product_productSearchContext" resultMap="Product_productResultMap">
select t1.* from (
<include refid="Default" />
)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]-->
<sql id="Default" databaseId="postgresql">
<![CDATA[ SELECT t1.ACTIVE, t11.AVAILABLE_IN_POS, t11.AVAILABLE_THRESHOLD, t1.BARCODE, t11.CAN_BE_EXPENSED, t11.CATEG_ID, t11.COLOR, t11.COMPANY_ID, t1.CREATE_DATE, t1.CREATE_UID, t31.NAME AS CREATE_UID_TEXT, t1.DEFAULT_CODE, t11.EVENT_OK, t11.EXPENSE_POLICY, t1.ID, t11.INVENTORY_AVAILABILITY, t11.INVOICE_POLICY, t11.ISPARTS, t11.IS_PUBLISHED, t11.LIST_PRICE, t1.MESSAGE_MAIN_ATTACHMENT_ID, t11.NAME, t11.POS_CATEG_ID, t11.PRODUCE_DELAY, t1.PRODUCT_TMPL_ID, t11.PURCHASE_LINE_WARN, t11.PURCHASE_METHOD, t11.PURCHASE_OK, t11.RATING_LAST_VALUE, t11.RENTAL, t11.RESPONSIBLE_ID, t11.SALE_DELAY, t11.SALE_LINE_WARN, t11.SALE_OK, t11.SEQUENCE, t11.SERVICE_TO_PURCHASE, t11.SERVICE_TYPE, t11.TO_WEIGHT, t11.TRACKING, t11.TYPE, t11.UOM_ID, t61.NAME AS UOM_NAME, t11.UOM_PO_ID, t1.VOLUME, t11.WEBSITE_ID, t11.WEBSITE_META_KEYWORDS, t11.WEBSITE_META_OG_IMG, t11.WEBSITE_META_TITLE, t11.WEBSITE_SEQUENCE, t11.WEBSITE_SIZE_X, t11.WEBSITE_SIZE_Y, t1.WEIGHT, t1.WRITE_DATE, t1.WRITE_UID, t51.NAME AS WRITE_UID_TEXT FROM PRODUCT_PRODUCT t1 LEFT JOIN PRODUCT_TEMPLATE t11 ON t1.PRODUCT_TMPL_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 RES_USERS t41 ON t1.WRITE_UID = t41.ID LEFT JOIN RES_PARTNER t51 ON t41.PARTNER_ID = t51.ID LEFT JOIN UOM_UOM t61 ON t11.UOM_ID = t61.ID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.ACTIVE, t11.AVAILABLE_IN_POS, t11.AVAILABLE_THRESHOLD, t1.BARCODE, t11.CAN_BE_EXPENSED, t11.CATEG_ID, t11.COLOR, t11.COMPANY_ID, t1.CREATE_DATE, t1.CREATE_UID, t31.NAME AS CREATE_UID_TEXT, t11.CUSTOM_MESSAGE, t1.DEFAULT_CODE, t11.DESCRIPTION, t11.DESCRIPTION_PICKING, t11.DESCRIPTION_PICKINGIN, t11.DESCRIPTION_PICKINGOUT, t11.DESCRIPTION_PURCHASE, t11.DESCRIPTION_SALE, t11.EVENT_OK, t11.EXPENSE_POLICY, t1.ID, t11.INVENTORY_AVAILABILITY, t11.INVOICE_POLICY, t11.ISPARTS, t11.IS_PUBLISHED, t11.LIST_PRICE, t1.MESSAGE_MAIN_ATTACHMENT_ID, t11.NAME, t11.POS_CATEG_ID, t11.PRODUCE_DELAY, t1.PRODUCT_TMPL_ID, t11.PURCHASE_LINE_WARN, t11.PURCHASE_LINE_WARN_MSG, t11.PURCHASE_METHOD, t11.PURCHASE_OK, t11.RATING_LAST_VALUE, t11.RENTAL, t11.RESPONSIBLE_ID, t11.SALE_DELAY, t11.SALE_LINE_WARN, t11.SALE_LINE_WARN_MSG, t11.SALE_OK, t11.SEQUENCE, t11.SERVICE_TO_PURCHASE, t11.SERVICE_TYPE, t11.TO_WEIGHT, t11.TRACKING, t11.TYPE, t11.UOM_ID, t61.NAME AS UOM_NAME, t11.UOM_PO_ID, t1.VOLUME, t11.WEBSITE_DESCRIPTION, t11.WEBSITE_ID, t11.WEBSITE_META_DESCRIPTION, t11.WEBSITE_META_KEYWORDS, t11.WEBSITE_META_OG_IMG, t11.WEBSITE_META_TITLE, t11.WEBSITE_SEQUENCE, t11.WEBSITE_SIZE_X, t11.WEBSITE_SIZE_Y, t1.WEIGHT, t1.WRITE_DATE, t1.WRITE_UID, t51.NAME AS WRITE_UID_TEXT FROM PRODUCT_PRODUCT t1 LEFT JOIN PRODUCT_TEMPLATE t11 ON t1.PRODUCT_TMPL_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 RES_USERS t41 ON t1.WRITE_UID = t41.ID LEFT JOIN RES_PARTNER t51 ON t41.PARTNER_ID = t51.ID LEFT JOIN UOM_UOM t61 ON t11.UOM_ID = t61.ID
]]>
</sql>
</mapper> </mapper>
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
<mapper namespace="cn.ibizlab.businesscentral.core.odoo_product.mapper.Product_templateMapper"> <mapper namespace="cn.ibizlab.businesscentral.core.odoo_product.mapper.Product_templateMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性--> <!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Product_templateResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.ACTIVE, t1.AVAILABLE_IN_POS, t1.AVAILABLE_THRESHOLD, t1.CAN_BE_EXPENSED, t1.CATEG_ID, t91.NAME AS CATEG_ID_TEXT, t1.COLOR, t1.COMPANY_ID, t21.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t81.NAME AS CREATE_UID_TEXT, t1.CUSTOM_MESSAGE, t1.DEFAULT_CODE, t1.DESCRIPTION, t1.DESCRIPTION_PICKING, t1.DESCRIPTION_PICKINGIN, t1.DESCRIPTION_PICKINGOUT, t1.DESCRIPTION_PURCHASE, t1.DESCRIPTION_SALE, t1.EVENT_OK, t1.EXPENSE_POLICY, t1.ID, t1.INVENTORY_AVAILABILITY, t1.INVOICE_POLICY, t1.ISPARTS, t1.IS_PUBLISHED, t1.LIST_PRICE, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.NAME, t1.POS_CATEG_ID, t1.PRODUCE_DELAY, t1.PURCHASE_LINE_WARN, t1.PURCHASE_LINE_WARN_MSG, t1.PURCHASE_METHOD, t1.PURCHASE_OK, t1.RATING_LAST_VALUE, t1.RENTAL, t1.RESPONSIBLE_ID, t61.NAME AS RESPONSIBLE_ID_TEXT, t1.SALE_DELAY, t1.SALE_LINE_WARN, t1.SALE_LINE_WARN_MSG, t1.SALE_OK, t1.SEQUENCE, t1.SERVICE_TO_PURCHASE, t1.SERVICE_TYPE, t1.TO_WEIGHT, t1.TRACKING, t1.TYPE, t1.UOM_ID, t41.NAME AS UOM_NAME, t1.UOM_PO_ID, t31.NAME AS UOM_PO_ID_TEXT, t1.VOLUME, t1.WEBSITE_DESCRIPTION, t1.WEBSITE_ID, t1.WEBSITE_META_DESCRIPTION, t1.WEBSITE_META_KEYWORDS, t1.WEBSITE_META_OG_IMG, t1.WEBSITE_META_TITLE, t1.WEBSITE_SEQUENCE, t1.WEBSITE_SIZE_X, t1.WEBSITE_SIZE_Y, t1.WEIGHT, t1.WRITE_DATE, t1.WRITE_UID, t111.NAME AS WRITE_UID_TEXT FROM PRODUCT_TEMPLATE t1 LEFT JOIN RES_COMPANY t11 ON t1.COMPANY_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN UOM_UOM t31 ON t1.UOM_PO_ID = t31.ID LEFT JOIN UOM_UOM t41 ON t1.UOM_ID = t41.ID LEFT JOIN RES_USERS t51 ON t1.RESPONSIBLE_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN RES_USERS t71 ON t1.CREATE_UID = t71.ID LEFT JOIN RES_PARTNER t81 ON t71.PARTNER_ID = t81.ID LEFT JOIN PRODUCT_CATEGORY t91 ON t1.CATEG_ID = t91.ID LEFT JOIN RES_USERS t101 ON t1.WRITE_UID = t101.ID LEFT JOIN RES_PARTNER t111 ON t101.PARTNER_ID = t111.ID ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 --> <!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Product_templateResultMap" type="cn.ibizlab.businesscentral.core.odoo_product.domain.Product_template" autoMapping="true"> <resultMap id="Product_templateResultMap" type="cn.ibizlab.businesscentral.core.odoo_product.domain.Product_template" autoMapping="true">
...@@ -177,12 +180,73 @@ ...@@ -177,12 +180,73 @@
</resultMap> </resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE__PRODUCT_CATEGORY__CATEG_ID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE__PRODUCT_CATEGORY__CATEG_ID] -->
<select id="selectByCategId" resultMap="Product_templateResultMap">
select t1.* from (
<include refid="Default" />
) t1
where categ_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE__RES_COMPANY__COMPANY_ID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE__RES_COMPANY__COMPANY_ID] -->
<select id="selectByCompanyId" resultMap="Product_templateResultMap">
select t1.* from (
<include refid="Default" />
) t1
where company_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE__RES_USERS__CREATE_UID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE__RES_USERS__CREATE_UID] -->
<select id="selectByCreateUid" resultMap="Product_templateResultMap">
select t1.* from (
<include refid="Default" />
) t1
where create_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE__RES_USERS__RESPONSIBLE_ID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE__RES_USERS__RESPONSIBLE_ID] -->
<select id="selectByResponsibleId" resultMap="Product_templateResultMap">
select t1.* from (
<include refid="Default" />
) t1
where responsible_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE__RES_USERS__WRITE_UID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE__RES_USERS__WRITE_UID] -->
<select id="selectByWriteUid" resultMap="Product_templateResultMap">
select t1.* from (
<include refid="Default" />
) t1
where write_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE__UOM_UOM__UOM_ID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE__UOM_UOM__UOM_ID] -->
<select id="selectByUomId" resultMap="Product_templateResultMap">
select t1.* from (
<include refid="Default" />
) t1
where uom_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE__UOM_UOM__UOM_PO_ID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE__UOM_UOM__UOM_PO_ID] -->
<select id="selectByUomPoId" resultMap="Product_templateResultMap">
select t1.* from (
<include refid="Default" />
) t1
where uom_po_id=#{id}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.odoo_product.filter.Product_templateSearchContext" resultMap="Product_templateResultMap">
select t1.* from (
<include refid="Default" />
)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]-->
<sql id="Default" databaseId="postgresql">
<![CDATA[ SELECT t1.ACTIVE, t1.AVAILABLE_IN_POS, t1.AVAILABLE_THRESHOLD, t1.CAN_BE_EXPENSED, t1.CATEG_ID, t91.NAME AS CATEG_ID_TEXT, t1.COLOR, t1.COMPANY_ID, t21.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t81.NAME AS CREATE_UID_TEXT, t1.DEFAULT_CODE, t1.EVENT_OK, t1.EXPENSE_POLICY, t1.ID, t1.INVENTORY_AVAILABILITY, t1.INVOICE_POLICY, t1.ISPARTS, t1.IS_PUBLISHED, t1.LIST_PRICE, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.NAME, t1.POS_CATEG_ID, t1.PRODUCE_DELAY, t1.PURCHASE_LINE_WARN, t1.PURCHASE_METHOD, t1.PURCHASE_OK, t1.RATING_LAST_VALUE, t1.RENTAL, t1.RESPONSIBLE_ID, t61.NAME AS RESPONSIBLE_ID_TEXT, t1.SALE_DELAY, t1.SALE_LINE_WARN, t1.SALE_OK, t1.SEQUENCE, t1.SERVICE_TO_PURCHASE, t1.SERVICE_TYPE, t1.TO_WEIGHT, t1.TRACKING, t1.TYPE, t1.UOM_ID, t41.NAME AS UOM_NAME, t1.UOM_PO_ID, t31.NAME AS UOM_PO_ID_TEXT, t1.VOLUME, t1.WEBSITE_ID, t1.WEBSITE_META_KEYWORDS, t1.WEBSITE_META_OG_IMG, t1.WEBSITE_META_TITLE, t1.WEBSITE_SEQUENCE, t1.WEBSITE_SIZE_X, t1.WEBSITE_SIZE_Y, t1.WEIGHT, t1.WRITE_DATE, t1.WRITE_UID, t111.NAME AS WRITE_UID_TEXT FROM PRODUCT_TEMPLATE t1 LEFT JOIN RES_COMPANY t11 ON t1.COMPANY_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN UOM_UOM t31 ON t1.UOM_PO_ID = t31.ID LEFT JOIN UOM_UOM t41 ON t1.UOM_ID = t41.ID LEFT JOIN RES_USERS t51 ON t1.RESPONSIBLE_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN RES_USERS t71 ON t1.CREATE_UID = t71.ID LEFT JOIN RES_PARTNER t81 ON t71.PARTNER_ID = t81.ID LEFT JOIN PRODUCT_CATEGORY t91 ON t1.CATEG_ID = t91.ID LEFT JOIN RES_USERS t101 ON t1.WRITE_UID = t101.ID LEFT JOIN RES_PARTNER t111 ON t101.PARTNER_ID = t111.ID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.ACTIVE, t1.AVAILABLE_IN_POS, t1.AVAILABLE_THRESHOLD, t1.CAN_BE_EXPENSED, t1.CATEG_ID, t91.NAME AS CATEG_ID_TEXT, t1.COLOR, t1.COMPANY_ID, t21.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t81.NAME AS CREATE_UID_TEXT, t1.CUSTOM_MESSAGE, t1.DEFAULT_CODE, t1.DESCRIPTION, t1.DESCRIPTION_PICKING, t1.DESCRIPTION_PICKINGIN, t1.DESCRIPTION_PICKINGOUT, t1.DESCRIPTION_PURCHASE, t1.DESCRIPTION_SALE, t1.EVENT_OK, t1.EXPENSE_POLICY, t1.ID, t1.INVENTORY_AVAILABILITY, t1.INVOICE_POLICY, t1.ISPARTS, t1.IS_PUBLISHED, t1.LIST_PRICE, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.NAME, t1.POS_CATEG_ID, t1.PRODUCE_DELAY, t1.PURCHASE_LINE_WARN, t1.PURCHASE_LINE_WARN_MSG, t1.PURCHASE_METHOD, t1.PURCHASE_OK, t1.RATING_LAST_VALUE, t1.RENTAL, t1.RESPONSIBLE_ID, t61.NAME AS RESPONSIBLE_ID_TEXT, t1.SALE_DELAY, t1.SALE_LINE_WARN, t1.SALE_LINE_WARN_MSG, t1.SALE_OK, t1.SEQUENCE, t1.SERVICE_TO_PURCHASE, t1.SERVICE_TYPE, t1.TO_WEIGHT, t1.TRACKING, t1.TYPE, t1.UOM_ID, t41.NAME AS UOM_NAME, t1.UOM_PO_ID, t31.NAME AS UOM_PO_ID_TEXT, t1.VOLUME, t1.WEBSITE_DESCRIPTION, t1.WEBSITE_ID, t1.WEBSITE_META_DESCRIPTION, t1.WEBSITE_META_KEYWORDS, t1.WEBSITE_META_OG_IMG, t1.WEBSITE_META_TITLE, t1.WEBSITE_SEQUENCE, t1.WEBSITE_SIZE_X, t1.WEBSITE_SIZE_Y, t1.WEIGHT, t1.WRITE_DATE, t1.WRITE_UID, t111.NAME AS WRITE_UID_TEXT FROM PRODUCT_TEMPLATE t1 LEFT JOIN RES_COMPANY t11 ON t1.COMPANY_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN UOM_UOM t31 ON t1.UOM_PO_ID = t31.ID LEFT JOIN UOM_UOM t41 ON t1.UOM_ID = t41.ID LEFT JOIN RES_USERS t51 ON t1.RESPONSIBLE_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN RES_USERS t71 ON t1.CREATE_UID = t71.ID LEFT JOIN RES_PARTNER t81 ON t71.PARTNER_ID = t81.ID LEFT JOIN PRODUCT_CATEGORY t91 ON t1.CATEG_ID = t91.ID LEFT JOIN RES_USERS t101 ON t1.WRITE_UID = t101.ID LEFT JOIN RES_PARTNER t111 ON t101.PARTNER_ID = t111.ID
]]>
</sql>
</mapper> </mapper>
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对象[Purchase_requisitionDTO]
*/
@Data
public class Purchase_requisitionDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [ID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 属性 [NAME]
*
*/
@JSONField(name = "name")
@JsonProperty("name")
@NotBlank(message = "[申请编号]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String name;
/**
* 属性 [CREATE_DATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "create_date" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("create_date")
private Timestamp createDate;
/**
* 属性 [WRITE_DATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "write_date" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("write_date")
private Timestamp writeDate;
/**
* 属性 [WRITE_UID]
*
*/
@JSONField(name = "write_uid")
@JsonProperty("write_uid")
@JsonSerialize(using = ToStringSerializer.class)
private Long writeUid;
/**
* 属性 [CREATE_UID]
*
*/
@JSONField(name = "create_uid")
@JsonProperty("create_uid")
@JsonSerialize(using = ToStringSerializer.class)
private Long createUid;
/**
* 属性 [WRITE_UNAME]
*
*/
@JSONField(name = "write_uname")
@JsonProperty("write_uname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String writeUname;
/**
* 属性 [CREATE_UNAME]
*
*/
@JSONField(name = "create_uname")
@JsonProperty("create_uname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String createUname;
/**
* 属性 [__LAST_UPDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "__last_update" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("__last_update")
private Timestamp LastUpdate;
/**
* 属性 [ACTIVITY_STATE]
*
*/
@JSONField(name = "activity_state")
@JsonProperty("activity_state")
@Size(min = 0, max = 60, message = "内容长度必须小于等于[60]")
private String activityState;
/**
* 属性 [ACTIVITY_DATE_DEADLINE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "activity_date_deadline" , format="yyyy-MM-dd")
@JsonProperty("activity_date_deadline")
private Timestamp activityDateDeadline;
/**
* 属性 [ORIGIN]
*
*/
@JSONField(name = "origin")
@JsonProperty("origin")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String origin;
/**
* 属性 [ORDER_COUNT]
*
*/
@JSONField(name = "order_count")
@JsonProperty("order_count")
private Integer orderCount;
/**
* 属性 [VENDOR_ID]
*
*/
@JSONField(name = "vendor_id")
@JsonProperty("vendor_id")
@JsonSerialize(using = ToStringSerializer.class)
private Long vendorId;
/**
* 属性 [VENDOR_ID_TEXT]
*
*/
@JSONField(name = "vendor_id_text")
@JsonProperty("vendor_id_text")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String vendorIdText;
/**
* 属性 [ORDERING_DATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "ordering_date" , format="yyyy-MM-dd")
@JsonProperty("ordering_date")
private Timestamp orderingDate;
/**
* 属性 [DATE_END]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "date_end" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("date_end")
private Timestamp dateEnd;
/**
* 属性 [SCHEDULE_DATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "schedule_date" , format="yyyy-MM-dd")
@JsonProperty("schedule_date")
private Timestamp scheduleDate;
/**
* 设置 [NAME]
*/
public void setName(String name){
this.name = name ;
this.modify("name",name);
}
/**
* 设置 [CREATE_DATE]
*/
public void setCreateDate(Timestamp createDate){
this.createDate = createDate ;
this.modify("create_date",createDate);
}
/**
* 设置 [WRITE_DATE]
*/
public void setWriteDate(Timestamp writeDate){
this.writeDate = writeDate ;
this.modify("write_date",writeDate);
}
/**
* 设置 [WRITE_UID]
*/
public void setWriteUid(Long writeUid){
this.writeUid = writeUid ;
this.modify("write_uid",writeUid);
}
/**
* 设置 [CREATE_UID]
*/
public void setCreateUid(Long createUid){
this.createUid = createUid ;
this.modify("create_uid",createUid);
}
/**
* 设置 [ACTIVITY_STATE]
*/
public void setActivityState(String activityState){
this.activityState = activityState ;
this.modify("activity_state",activityState);
}
/**
* 设置 [ACTIVITY_DATE_DEADLINE]
*/
public void setActivityDateDeadline(Timestamp activityDateDeadline){
this.activityDateDeadline = activityDateDeadline ;
this.modify("activity_date_deadline",activityDateDeadline);
}
/**
* 设置 [ORIGIN]
*/
public void setOrigin(String origin){
this.origin = origin ;
this.modify("origin",origin);
}
/**
* 设置 [ORDER_COUNT]
*/
public void setOrderCount(Integer orderCount){
this.orderCount = orderCount ;
this.modify("order_count",orderCount);
}
/**
* 设置 [VENDOR_ID]
*/
public void setVendorId(Long vendorId){
this.vendorId = vendorId ;
this.modify("vendor_id",vendorId);
}
/**
* 设置 [ORDERING_DATE]
*/
public void setOrderingDate(Timestamp orderingDate){
this.orderingDate = orderingDate ;
this.modify("ordering_date",orderingDate);
}
/**
* 设置 [DATE_END]
*/
public void setDateEnd(Timestamp dateEnd){
this.dateEnd = dateEnd ;
this.modify("date_end",dateEnd);
}
/**
* 设置 [SCHEDULE_DATE]
*/
public void setScheduleDate(Timestamp scheduleDate){
this.scheduleDate = scheduleDate ;
this.modify("schedule_date",scheduleDate);
}
}
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对象[Purchase_requisition_typeDTO]
*/
@Data
public class Purchase_requisition_typeDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [NAME]
*
*/
@JSONField(name = "name")
@JsonProperty("name")
@NotBlank(message = "[申请类型]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String name;
/**
* 属性 [CREATE_DATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "create_date" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("create_date")
private Timestamp createDate;
/**
* 属性 [ID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 属性 [WRITE_DATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "write_date" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("write_date")
private Timestamp writeDate;
/**
* 属性 [WRITE_UID]
*
*/
@JSONField(name = "write_uid")
@JsonProperty("write_uid")
@JsonSerialize(using = ToStringSerializer.class)
private Long writeUid;
/**
* 属性 [WRITE_UNAME]
*
*/
@JSONField(name = "write_uname")
@JsonProperty("write_uname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String writeUname;
/**
* 属性 [CREATE_UID]
*
*/
@JSONField(name = "create_uid")
@JsonProperty("create_uid")
@JsonSerialize(using = ToStringSerializer.class)
private Long createUid;
/**
* 属性 [CREATE_UNAME]
*
*/
@JSONField(name = "create_uname")
@JsonProperty("create_uname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String createUname;
/**
* 属性 [__LAST_UPDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "__last_update" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("__last_update")
private Timestamp LastUpdate;
/**
* 设置 [NAME]
*/
public void setName(String name){
this.name = name ;
this.modify("name",name);
}
/**
* 设置 [CREATE_DATE]
*/
public void setCreateDate(Timestamp createDate){
this.createDate = createDate ;
this.modify("create_date",createDate);
}
/**
* 设置 [WRITE_DATE]
*/
public void setWriteDate(Timestamp writeDate){
this.writeDate = writeDate ;
this.modify("write_date",writeDate);
}
/**
* 设置 [WRITE_UID]
*/
public void setWriteUid(Long writeUid){
this.writeUid = writeUid ;
this.modify("write_uid",writeUid);
}
/**
* 设置 [CREATE_UID]
*/
public void setCreateUid(Long createUid){
this.createUid = createUid ;
this.modify("create_uid",createUid);
}
}
package cn.ibizlab.businesscentral.core.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition;
import cn.ibizlab.businesscentral.core.dto.Purchase_requisitionDTO;
import cn.ibizlab.businesscentral.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="CorePurchase_requisitionMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface Purchase_requisitionMapping extends MappingBase<Purchase_requisitionDTO, Purchase_requisition> {
}
package cn.ibizlab.businesscentral.core.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition_line;
import cn.ibizlab.businesscentral.core.dto.Purchase_requisition_lineDTO;
import cn.ibizlab.businesscentral.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="CorePurchase_requisition_lineMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface Purchase_requisition_lineMapping extends MappingBase<Purchase_requisition_lineDTO, Purchase_requisition_line> {
}
package cn.ibizlab.businesscentral.core.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition_type;
import cn.ibizlab.businesscentral.core.dto.Purchase_requisition_typeDTO;
import cn.ibizlab.businesscentral.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="CorePurchase_requisition_typeMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface Purchase_requisition_typeMapping extends MappingBase<Purchase_requisition_typeDTO, Purchase_requisition_type> {
}
...@@ -109,6 +109,55 @@ public class Product_productResource { ...@@ -109,6 +109,55 @@ public class Product_productResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@ApiOperation(value = "获取产品草稿", tags = {"产品" }, notes = "获取产品草稿")
@RequestMapping(method = RequestMethod.GET, value = "/product_products/getdraft")
public ResponseEntity<Product_productDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(product_productMapping.toDto(product_productService.getDraft(new Product_product())));
}
@ApiOperation(value = "检查产品", tags = {"产品" }, notes = "检查产品")
@RequestMapping(method = RequestMethod.POST, value = "/product_products/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody Product_productDTO product_productdto) {
return ResponseEntity.status(HttpStatus.OK).body(product_productService.checkKey(product_productMapping.toDomain(product_productdto)));
}
@PreAuthorize("hasPermission(this.product_productMapping.toDomain(#product_productdto),'iBizBusinessCentral-Product_product-Save')")
@ApiOperation(value = "保存产品", tags = {"产品" }, notes = "保存产品")
@RequestMapping(method = RequestMethod.POST, value = "/product_products/save")
public ResponseEntity<Boolean> save(@RequestBody Product_productDTO product_productdto) {
return ResponseEntity.status(HttpStatus.OK).body(product_productService.save(product_productMapping.toDomain(product_productdto)));
}
@PreAuthorize("hasPermission(this.product_productMapping.toDomain(#product_productdtos),'iBizBusinessCentral-Product_product-Save')")
@ApiOperation(value = "批量保存产品", tags = {"产品" }, notes = "批量保存产品")
@RequestMapping(method = RequestMethod.POST, value = "/product_products/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<Product_productDTO> product_productdtos) {
product_productService.saveBatch(product_productMapping.toDomain(product_productdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Product_product-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Product_product-Get')")
@ApiOperation(value = "获取数据集", tags = {"产品" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/product_products/fetchdefault")
public ResponseEntity<List<Product_productDTO>> fetchDefault(Product_productSearchContext context) {
Page<Product_product> domains = product_productService.searchDefault(context) ;
List<Product_productDTO> list = product_productMapping.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-Product_product-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Product_product-Get')")
@ApiOperation(value = "查询数据集", tags = {"产品" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/product_products/searchdefault")
public ResponseEntity<Page<Product_productDTO>> searchDefault(@RequestBody Product_productSearchContext context) {
Page<Product_product> domains = product_productService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(product_productMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
} }
...@@ -109,6 +109,55 @@ public class Product_templateResource { ...@@ -109,6 +109,55 @@ public class Product_templateResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@ApiOperation(value = "获取产品模板草稿", tags = {"产品模板" }, notes = "获取产品模板草稿")
@RequestMapping(method = RequestMethod.GET, value = "/product_templates/getdraft")
public ResponseEntity<Product_templateDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(product_templateMapping.toDto(product_templateService.getDraft(new Product_template())));
}
@ApiOperation(value = "检查产品模板", tags = {"产品模板" }, notes = "检查产品模板")
@RequestMapping(method = RequestMethod.POST, value = "/product_templates/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody Product_templateDTO product_templatedto) {
return ResponseEntity.status(HttpStatus.OK).body(product_templateService.checkKey(product_templateMapping.toDomain(product_templatedto)));
}
@PreAuthorize("hasPermission(this.product_templateMapping.toDomain(#product_templatedto),'iBizBusinessCentral-Product_template-Save')")
@ApiOperation(value = "保存产品模板", tags = {"产品模板" }, notes = "保存产品模板")
@RequestMapping(method = RequestMethod.POST, value = "/product_templates/save")
public ResponseEntity<Boolean> save(@RequestBody Product_templateDTO product_templatedto) {
return ResponseEntity.status(HttpStatus.OK).body(product_templateService.save(product_templateMapping.toDomain(product_templatedto)));
}
@PreAuthorize("hasPermission(this.product_templateMapping.toDomain(#product_templatedtos),'iBizBusinessCentral-Product_template-Save')")
@ApiOperation(value = "批量保存产品模板", tags = {"产品模板" }, notes = "批量保存产品模板")
@RequestMapping(method = RequestMethod.POST, value = "/product_templates/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<Product_templateDTO> product_templatedtos) {
product_templateService.saveBatch(product_templateMapping.toDomain(product_templatedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Product_template-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Product_template-Get')")
@ApiOperation(value = "获取数据集", tags = {"产品模板" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/product_templates/fetchdefault")
public ResponseEntity<List<Product_templateDTO>> fetchDefault(Product_templateSearchContext context) {
Page<Product_template> domains = product_templateService.searchDefault(context) ;
List<Product_templateDTO> list = product_templateMapping.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-Product_template-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Product_template-Get')")
@ApiOperation(value = "查询数据集", tags = {"产品模板" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/product_templates/searchdefault")
public ResponseEntity<Page<Product_templateDTO>> searchDefault(@RequestBody Product_templateSearchContext context) {
Page<Product_template> domains = product_templateService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(product_templateMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
} }
package cn.ibizlab.businesscentral.core.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.businesscentral.core.dto.*;
import cn.ibizlab.businesscentral.core.mapping.*;
import cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition;
import cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisitionService;
import cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_requisitionSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"采购申请" })
@RestController("Core-purchase_requisition")
@RequestMapping("")
public class Purchase_requisitionResource {
@Autowired
public IPurchase_requisitionService purchase_requisitionService;
@Autowired
@Lazy
public Purchase_requisitionMapping purchase_requisitionMapping;
}
package cn.ibizlab.businesscentral.core.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.businesscentral.core.dto.*;
import cn.ibizlab.businesscentral.core.mapping.*;
import cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition_line;
import cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisition_lineService;
import cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_requisition_lineSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"采购申请行" })
@RestController("Core-purchase_requisition_line")
@RequestMapping("")
public class Purchase_requisition_lineResource {
@Autowired
public IPurchase_requisition_lineService purchase_requisition_lineService;
@Autowired
@Lazy
public Purchase_requisition_lineMapping purchase_requisition_lineMapping;
}
package cn.ibizlab.businesscentral.core.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.businesscentral.core.dto.*;
import cn.ibizlab.businesscentral.core.mapping.*;
import cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition_type;
import cn.ibizlab.businesscentral.core.odoo_purchase.service.IPurchase_requisition_typeService;
import cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_requisition_typeSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"采购申请类型" })
@RestController("Core-purchase_requisition_type")
@RequestMapping("")
public class Purchase_requisition_typeResource {
@Autowired
public IPurchase_requisition_typeService purchase_requisition_typeService;
@Autowired
@Lazy
public Purchase_requisition_typeMapping purchase_requisition_typeMapping;
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册