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

lab_gzf 发布系统代码

上级 a923b33d
...@@ -66,10 +66,6 @@ public class Ir_sequenceServiceImpl extends ServiceImpl<Ir_sequenceMapper, Ir_se ...@@ -66,10 +66,6 @@ public class Ir_sequenceServiceImpl extends ServiceImpl<Ir_sequenceMapper, Ir_se
@Lazy @Lazy
protected cn.ibizlab.businesscentral.core.odoo_ir.service.logic.IIr_sequencealter_sequenceLogic alter_sequenceLogic; protected cn.ibizlab.businesscentral.core.odoo_ir.service.logic.IIr_sequencealter_sequenceLogic alter_sequenceLogic;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.odoo_ir.service.logic.IIr_sequencedrop_sequenceLogic drop_sequenceLogic;
protected int batchSize = 500; protected int batchSize = 500;
@Override @Override
...@@ -111,10 +107,7 @@ public class Ir_sequenceServiceImpl extends ServiceImpl<Ir_sequenceMapper, Ir_se ...@@ -111,10 +107,7 @@ public class Ir_sequenceServiceImpl extends ServiceImpl<Ir_sequenceMapper, Ir_se
@Override @Override
@Transactional @Transactional
public boolean remove(Long key) { public boolean remove(Long key) {
Ir_sequence et=new Ir_sequence();
et.set("id",key);
boolean result=removeById(key); boolean result=removeById(key);
drop_sequenceLogic.execute(et);
return result ; return result ;
} }
......
...@@ -58,4 +58,27 @@ public class product_attributeFallback implements product_attributeFeignClient{ ...@@ -58,4 +58,27 @@ public class product_attributeFallback implements product_attributeFeignClient{
return null; return null;
} }
public Product_attribute getDraft(){
return null;
}
public Boolean checkKey(Product_attribute product_attribute){
return false;
}
public Boolean save(Product_attribute product_attribute){
return false;
}
public Boolean saveBatch(List<Product_attribute> product_attributes){
return false;
}
public Page<Product_attribute> searchDefault(Product_attributeSearchContext context){
return null;
}
} }
...@@ -56,4 +56,24 @@ public interface product_attributeFeignClient { ...@@ -56,4 +56,24 @@ public interface product_attributeFeignClient {
Page<Product_attribute> select(); Page<Product_attribute> select();
@RequestMapping(method = RequestMethod.GET, value = "/product_attributes/getdraft")
Product_attribute getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/product_attributes/checkkey")
Boolean checkKey(@RequestBody Product_attribute product_attribute);
@RequestMapping(method = RequestMethod.POST, value = "/product_attributes/save")
Boolean save(@RequestBody Product_attribute product_attribute);
@RequestMapping(method = RequestMethod.POST, value = "/product_attributes/savebatch")
Boolean saveBatch(@RequestBody List<Product_attribute> product_attributes);
@RequestMapping(method = RequestMethod.POST, value = "/product_attributes/searchdefault")
Page<Product_attribute> searchDefault(@RequestBody Product_attributeSearchContext context);
} }
...@@ -58,4 +58,27 @@ public class product_template_attribute_lineFallback implements product_template ...@@ -58,4 +58,27 @@ public class product_template_attribute_lineFallback implements product_template
return null; return null;
} }
public Product_template_attribute_line getDraft(){
return null;
}
public Boolean checkKey(Product_template_attribute_line product_template_attribute_line){
return false;
}
public Boolean save(Product_template_attribute_line product_template_attribute_line){
return false;
}
public Boolean saveBatch(List<Product_template_attribute_line> product_template_attribute_lines){
return false;
}
public Page<Product_template_attribute_line> searchDefault(Product_template_attribute_lineSearchContext context){
return null;
}
} }
...@@ -56,4 +56,24 @@ public interface product_template_attribute_lineFeignClient { ...@@ -56,4 +56,24 @@ public interface product_template_attribute_lineFeignClient {
Page<Product_template_attribute_line> select(); Page<Product_template_attribute_line> select();
@RequestMapping(method = RequestMethod.GET, value = "/product_template_attribute_lines/getdraft")
Product_template_attribute_line getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/product_template_attribute_lines/checkkey")
Boolean checkKey(@RequestBody Product_template_attribute_line product_template_attribute_line);
@RequestMapping(method = RequestMethod.POST, value = "/product_template_attribute_lines/save")
Boolean save(@RequestBody Product_template_attribute_line product_template_attribute_line);
@RequestMapping(method = RequestMethod.POST, value = "/product_template_attribute_lines/savebatch")
Boolean saveBatch(@RequestBody List<Product_template_attribute_line> product_template_attribute_lines);
@RequestMapping(method = RequestMethod.POST, value = "/product_template_attribute_lines/searchdefault")
Page<Product_template_attribute_line> searchDefault(@RequestBody Product_template_attribute_lineSearchContext context);
} }
...@@ -27,6 +27,69 @@ import cn.ibizlab.businesscentral.core.odoo_product.domain.Product_attribute; ...@@ -27,6 +27,69 @@ import cn.ibizlab.businesscentral.core.odoo_product.domain.Product_attribute;
@Data @Data
public class Product_attributeSearchContext extends QueryWrapperContext<Product_attribute> { public class Product_attributeSearchContext extends QueryWrapperContext<Product_attribute> {
private String n_create_variant_eq;//[创建变体]
public void setN_create_variant_eq(String n_create_variant_eq) {
this.n_create_variant_eq = n_create_variant_eq;
if(!ObjectUtils.isEmpty(this.n_create_variant_eq)){
this.getSearchCond().eq("create_variant", n_create_variant_eq);
}
}
private String n_type_eq;//[类型]
public void setN_type_eq(String n_type_eq) {
this.n_type_eq = n_type_eq;
if(!ObjectUtils.isEmpty(this.n_type_eq)){
this.getSearchCond().eq("type", n_type_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);
}
}
/** /**
* 启用快速搜索 * 启用快速搜索
......
...@@ -27,6 +27,90 @@ import cn.ibizlab.businesscentral.core.odoo_product.domain.Product_template_attr ...@@ -27,6 +27,90 @@ import cn.ibizlab.businesscentral.core.odoo_product.domain.Product_template_attr
@Data @Data
public class Product_template_attribute_lineSearchContext extends QueryWrapperContext<Product_template_attribute_line> { public class Product_template_attribute_lineSearchContext extends QueryWrapperContext<Product_template_attribute_line> {
private String n_product_tmpl_id_text_eq;//[产品模板]
public void setN_product_tmpl_id_text_eq(String n_product_tmpl_id_text_eq) {
this.n_product_tmpl_id_text_eq = n_product_tmpl_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_product_tmpl_id_text_eq)){
this.getSearchCond().eq("product_tmpl_id_text", n_product_tmpl_id_text_eq);
}
}
private String n_product_tmpl_id_text_like;//[产品模板]
public void setN_product_tmpl_id_text_like(String n_product_tmpl_id_text_like) {
this.n_product_tmpl_id_text_like = n_product_tmpl_id_text_like;
if(!ObjectUtils.isEmpty(this.n_product_tmpl_id_text_like)){
this.getSearchCond().like("product_tmpl_id_text", n_product_tmpl_id_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 String n_attribute_id_text_eq;//[属性]
public void setN_attribute_id_text_eq(String n_attribute_id_text_eq) {
this.n_attribute_id_text_eq = n_attribute_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_attribute_id_text_eq)){
this.getSearchCond().eq("attribute_id_text", n_attribute_id_text_eq);
}
}
private String n_attribute_id_text_like;//[属性]
public void setN_attribute_id_text_like(String n_attribute_id_text_like) {
this.n_attribute_id_text_like = n_attribute_id_text_like;
if(!ObjectUtils.isEmpty(this.n_attribute_id_text_like)){
this.getSearchCond().like("attribute_id_text", n_attribute_id_text_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 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);
}
}
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_attribute_id_eq;//[属性]
public void setN_attribute_id_eq(Long n_attribute_id_eq) {
this.n_attribute_id_eq = n_attribute_id_eq;
if(!ObjectUtils.isEmpty(this.n_attribute_id_eq)){
this.getSearchCond().eq("attribute_id", n_attribute_id_eq);
}
}
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);
}
}
/** /**
* 启用快速搜索 * 启用快速搜索
......
...@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
public interface Product_attributeMapper extends BaseMapper<Product_attribute>{ public interface Product_attributeMapper extends BaseMapper<Product_attribute>{
Page<Product_attribute> searchDefault(IPage page, @Param("srf") Product_attributeSearchContext context, @Param("ew") Wrapper<Product_attribute> wrapper) ;
@Override @Override
Product_attribute selectById(Serializable id); Product_attribute selectById(Serializable id);
@Override @Override
...@@ -61,4 +62,8 @@ public interface Product_attributeMapper extends BaseMapper<Product_attribute>{ ...@@ -61,4 +62,8 @@ public interface Product_attributeMapper extends BaseMapper<Product_attribute>{
@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_attribute> selectByCreateUid(@Param("id") Serializable id) ;
List<Product_attribute> 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_template_attribute_lineMapper extends BaseMapper<Product_template_attribute_line>{ public interface Product_template_attribute_lineMapper extends BaseMapper<Product_template_attribute_line>{
Page<Product_template_attribute_line> searchDefault(IPage page, @Param("srf") Product_template_attribute_lineSearchContext context, @Param("ew") Wrapper<Product_template_attribute_line> wrapper) ;
@Override @Override
Product_template_attribute_line selectById(Serializable id); Product_template_attribute_line selectById(Serializable id);
@Override @Override
...@@ -61,4 +62,12 @@ public interface Product_template_attribute_lineMapper extends BaseMapper<Produc ...@@ -61,4 +62,12 @@ public interface Product_template_attribute_lineMapper extends BaseMapper<Produc
@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_attribute_line> selectByAttributeId(@Param("id") Serializable id) ;
List<Product_template_attribute_line> selectByProductTmplId(@Param("id") Serializable id) ;
List<Product_template_attribute_line> selectByCreateUid(@Param("id") Serializable id) ;
List<Product_template_attribute_line> selectByWriteUid(@Param("id") Serializable id) ;
} }
...@@ -33,6 +33,15 @@ public interface IProduct_attributeService extends IService<Product_attribute>{ ...@@ -33,6 +33,15 @@ public interface IProduct_attributeService extends IService<Product_attribute>{
boolean remove(Long key) ; boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ; void removeBatch(Collection<Long> idList) ;
Product_attribute get(Long key) ; Product_attribute get(Long key) ;
Product_attribute getDraft(Product_attribute et) ;
boolean checkKey(Product_attribute et) ;
boolean save(Product_attribute et) ;
void saveBatch(List<Product_attribute> list) ;
Page<Product_attribute> searchDefault(Product_attributeSearchContext context) ;
List<Product_attribute> selectByCreateUid(Long id) ;
void removeByCreateUid(Long id) ;
List<Product_attribute> 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,19 @@ public interface IProduct_template_attribute_lineService extends IService<Produc ...@@ -33,6 +33,19 @@ public interface IProduct_template_attribute_lineService extends IService<Produc
boolean remove(Long key) ; boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ; void removeBatch(Collection<Long> idList) ;
Product_template_attribute_line get(Long key) ; Product_template_attribute_line get(Long key) ;
Product_template_attribute_line getDraft(Product_template_attribute_line et) ;
boolean checkKey(Product_template_attribute_line et) ;
boolean save(Product_template_attribute_line et) ;
void saveBatch(List<Product_template_attribute_line> list) ;
Page<Product_template_attribute_line> searchDefault(Product_template_attribute_lineSearchContext context) ;
List<Product_template_attribute_line> selectByAttributeId(Long id) ;
void removeByAttributeId(Long id) ;
List<Product_template_attribute_line> selectByProductTmplId(Long id) ;
void removeByProductTmplId(Long id) ;
List<Product_template_attribute_line> selectByCreateUid(Long id) ;
void removeByCreateUid(Long id) ;
List<Product_template_attribute_line> 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}
......
...@@ -120,7 +120,79 @@ public class Product_attributeServiceImpl extends ServiceImpl<Product_attributeM ...@@ -120,7 +120,79 @@ public class Product_attributeServiceImpl extends ServiceImpl<Product_attributeM
return et; return et;
} }
@Override
public Product_attribute getDraft(Product_attribute et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(Product_attribute et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Product_attribute et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Product_attribute et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Product_attribute> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Product_attribute> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Product_attribute> selectByCreateUid(Long id) {
return baseMapper.selectByCreateUid(id);
}
@Override
public void removeByCreateUid(Long id) {
this.remove(new QueryWrapper<Product_attribute>().eq("create_uid",id));
}
@Override
public List<Product_attribute> selectByWriteUid(Long id) {
return baseMapper.selectByWriteUid(id);
}
@Override
public void removeByWriteUid(Long id) {
this.remove(new QueryWrapper<Product_attribute>().eq("write_uid",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Product_attribute> searchDefault(Product_attributeSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Product_attribute> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Product_attribute>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
......
...@@ -120,7 +120,99 @@ public class Product_template_attribute_lineServiceImpl extends ServiceImpl<Prod ...@@ -120,7 +120,99 @@ public class Product_template_attribute_lineServiceImpl extends ServiceImpl<Prod
return et; return et;
} }
@Override
public Product_template_attribute_line getDraft(Product_template_attribute_line et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(Product_template_attribute_line et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Product_template_attribute_line et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Product_template_attribute_line et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Product_template_attribute_line> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Product_template_attribute_line> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Product_template_attribute_line> selectByAttributeId(Long id) {
return baseMapper.selectByAttributeId(id);
}
@Override
public void removeByAttributeId(Long id) {
this.remove(new QueryWrapper<Product_template_attribute_line>().eq("attribute_id",id));
}
@Override
public List<Product_template_attribute_line> selectByProductTmplId(Long id) {
return baseMapper.selectByProductTmplId(id);
}
@Override
public void removeByProductTmplId(Long id) {
this.remove(new QueryWrapper<Product_template_attribute_line>().eq("product_tmpl_id",id));
}
@Override
public List<Product_template_attribute_line> selectByCreateUid(Long id) {
return baseMapper.selectByCreateUid(id);
}
@Override
public void removeByCreateUid(Long id) {
this.remove(new QueryWrapper<Product_template_attribute_line>().eq("create_uid",id));
}
@Override
public List<Product_template_attribute_line> selectByWriteUid(Long id) {
return baseMapper.selectByWriteUid(id);
}
@Override
public void removeByWriteUid(Long id) {
this.remove(new QueryWrapper<Product_template_attribute_line>().eq("write_uid",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Product_template_attribute_line> searchDefault(Product_template_attribute_lineSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Product_template_attribute_line> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Product_template_attribute_line>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
<mapper namespace="cn.ibizlab.businesscentral.core.odoo_product.mapper.Product_attributeMapper"> <mapper namespace="cn.ibizlab.businesscentral.core.odoo_product.mapper.Product_attributeMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性--> <!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Product_attributeResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.CREATE_DATE, t1.CREATE_UID, t21.NAME AS CREATE_UID_TEXT, t1.CREATE_VARIANT, t1.ID, t1.NAME, t1.SEQUENCE, t1.TYPE, t1.WRITE_DATE, t1.WRITE_UID, t41.NAME AS WRITE_UID_TEXT FROM PRODUCT_ATTRIBUTE t1 LEFT JOIN RES_USERS t11 ON t1.CREATE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.WRITE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 --> <!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Product_attributeResultMap" type="cn.ibizlab.businesscentral.core.odoo_product.domain.Product_attribute" autoMapping="true"> <resultMap id="Product_attributeResultMap" type="cn.ibizlab.businesscentral.core.odoo_product.domain.Product_attribute" autoMapping="true">
...@@ -28,7 +31,38 @@ ...@@ -28,7 +31,38 @@
</resultMap> </resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_ATTRIBUTE__RES_USERS__CREATE_UID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_ATTRIBUTE__RES_USERS__CREATE_UID] -->
<select id="selectByCreateUid" resultMap="Product_attributeResultMap">
select t1.* from (
<include refid="Default" />
) t1
where create_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_ATTRIBUTE__RES_USERS__WRITE_UID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_ATTRIBUTE__RES_USERS__WRITE_UID] -->
<select id="selectByWriteUid" resultMap="Product_attributeResultMap">
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_attributeSearchContext" resultMap="Product_attributeResultMap">
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.CREATE_DATE, t1.CREATE_UID, t21.NAME AS CREATE_UID_TEXT, t1.CREATE_VARIANT, t1.ID, t1.NAME, t1.SEQUENCE, t1.TYPE, t1.WRITE_DATE, t1.WRITE_UID, t41.NAME AS WRITE_UID_TEXT FROM PRODUCT_ATTRIBUTE t1 LEFT JOIN RES_USERS t11 ON t1.CREATE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.WRITE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.CREATE_DATE, t1.CREATE_UID, t21.NAME AS CREATE_UID_TEXT, t1.CREATE_VARIANT, t1.ID, t1.NAME, t1.SEQUENCE, t1.TYPE, t1.WRITE_DATE, t1.WRITE_UID, t41.NAME AS WRITE_UID_TEXT FROM PRODUCT_ATTRIBUTE t1 LEFT JOIN RES_USERS t11 ON t1.CREATE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN RES_USERS t31 ON t1.WRITE_UID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_ID = t41.ID
]]>
</sql>
</mapper> </mapper>
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
<mapper namespace="cn.ibizlab.businesscentral.core.odoo_product.mapper.Product_template_attribute_lineMapper"> <mapper namespace="cn.ibizlab.businesscentral.core.odoo_product.mapper.Product_template_attribute_lineMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性--> <!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Product_template_attribute_lineResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.ATTRIBUTE_ID, t41.NAME AS ATTRIBUTE_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t61.NAME AS CREATE_UID_TEXT, t1.ID, t1.PRODUCT_TMPL_ID, t11.NAME AS PRODUCT_TMPL_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t31.NAME AS WRITE_UID_TEXT FROM PRODUCT_TEMPLATE_ATTRIBUTE_LINE t1 LEFT JOIN PRODUCT_TEMPLATE t11 ON t1.PRODUCT_TMPL_ID = t11.ID LEFT JOIN RES_USERS t21 ON t1.WRITE_UID = t21.ID LEFT JOIN RES_PARTNER t31 ON t21.PARTNER_ID = t31.ID LEFT JOIN PRODUCT_ATTRIBUTE t41 ON t1.ATTRIBUTE_ID = t41.ID LEFT JOIN RES_USERS t51 ON t1.CREATE_UID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 --> <!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Product_template_attribute_lineResultMap" type="cn.ibizlab.businesscentral.core.odoo_product.domain.Product_template_attribute_line" autoMapping="true"> <resultMap id="Product_template_attribute_lineResultMap" type="cn.ibizlab.businesscentral.core.odoo_product.domain.Product_template_attribute_line" autoMapping="true">
...@@ -35,9 +38,52 @@ ...@@ -35,9 +38,52 @@
</resultMap> </resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE_ATTRIBUTE_LINE__PRODUCT_ATTRIBUTE__ATTRIBUTE_ID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE_ATTRIBUTE_LINE__PRODUCT_ATTRIBUTE__ATTRIBUTE_ID] -->
<select id="selectByAttributeId" resultMap="Product_template_attribute_lineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where attribute_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE_ATTRIBUTE_LINE__PRODUCT_TEMPLATE__PRODUCT_TMPL_ID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE_ATTRIBUTE_LINE__PRODUCT_TEMPLATE__PRODUCT_TMPL_ID] -->
<select id="selectByProductTmplId" resultMap="Product_template_attribute_lineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where product_tmpl_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE_ATTRIBUTE_LINE__RES_USERS__CREATE_UID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE_ATTRIBUTE_LINE__RES_USERS__CREATE_UID] -->
<select id="selectByCreateUid" resultMap="Product_template_attribute_lineResultMap">
select t1.* from (
<include refid="Default" />
) t1
where create_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE_ATTRIBUTE_LINE__RES_USERS__WRITE_UID] --> <!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_TEMPLATE_ATTRIBUTE_LINE__RES_USERS__WRITE_UID] -->
<select id="selectByWriteUid" resultMap="Product_template_attribute_lineResultMap">
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_template_attribute_lineSearchContext" resultMap="Product_template_attribute_lineResultMap">
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.ATTRIBUTE_ID, t41.NAME AS ATTRIBUTE_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t61.NAME AS CREATE_UID_TEXT, t1.ID, t1.PRODUCT_TMPL_ID, t11.NAME AS PRODUCT_TMPL_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t31.NAME AS WRITE_UID_TEXT FROM PRODUCT_TEMPLATE_ATTRIBUTE_LINE t1 LEFT JOIN PRODUCT_TEMPLATE t11 ON t1.PRODUCT_TMPL_ID = t11.ID LEFT JOIN RES_USERS t21 ON t1.WRITE_UID = t21.ID LEFT JOIN RES_PARTNER t31 ON t21.PARTNER_ID = t31.ID LEFT JOIN PRODUCT_ATTRIBUTE t41 ON t1.ATTRIBUTE_ID = t41.ID LEFT JOIN RES_USERS t51 ON t1.CREATE_UID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.ATTRIBUTE_ID, t41.NAME AS ATTRIBUTE_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t61.NAME AS CREATE_UID_TEXT, t1.ID, t1.PRODUCT_TMPL_ID, t11.NAME AS PRODUCT_TMPL_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t31.NAME AS WRITE_UID_TEXT FROM PRODUCT_TEMPLATE_ATTRIBUTE_LINE t1 LEFT JOIN PRODUCT_TEMPLATE t11 ON t1.PRODUCT_TMPL_ID = t11.ID LEFT JOIN RES_USERS t21 ON t1.WRITE_UID = t21.ID LEFT JOIN RES_PARTNER t31 ON t21.PARTNER_ID = t31.ID LEFT JOIN PRODUCT_ATTRIBUTE t41 ON t1.ATTRIBUTE_ID = t41.ID LEFT JOIN RES_USERS t51 ON t1.CREATE_UID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID
]]>
</sql>
</mapper> </mapper>
...@@ -109,6 +109,55 @@ public class Product_attributeResource { ...@@ -109,6 +109,55 @@ public class Product_attributeResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@ApiOperation(value = "获取产品属性草稿", tags = {"产品属性" }, notes = "获取产品属性草稿")
@RequestMapping(method = RequestMethod.GET, value = "/product_attributes/getdraft")
public ResponseEntity<Product_attributeDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(product_attributeMapping.toDto(product_attributeService.getDraft(new Product_attribute())));
}
@ApiOperation(value = "检查产品属性", tags = {"产品属性" }, notes = "检查产品属性")
@RequestMapping(method = RequestMethod.POST, value = "/product_attributes/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody Product_attributeDTO product_attributedto) {
return ResponseEntity.status(HttpStatus.OK).body(product_attributeService.checkKey(product_attributeMapping.toDomain(product_attributedto)));
}
@PreAuthorize("hasPermission(this.product_attributeMapping.toDomain(#product_attributedto),'iBizBusinessCentral-Product_attribute-Save')")
@ApiOperation(value = "保存产品属性", tags = {"产品属性" }, notes = "保存产品属性")
@RequestMapping(method = RequestMethod.POST, value = "/product_attributes/save")
public ResponseEntity<Boolean> save(@RequestBody Product_attributeDTO product_attributedto) {
return ResponseEntity.status(HttpStatus.OK).body(product_attributeService.save(product_attributeMapping.toDomain(product_attributedto)));
}
@PreAuthorize("hasPermission(this.product_attributeMapping.toDomain(#product_attributedtos),'iBizBusinessCentral-Product_attribute-Save')")
@ApiOperation(value = "批量保存产品属性", tags = {"产品属性" }, notes = "批量保存产品属性")
@RequestMapping(method = RequestMethod.POST, value = "/product_attributes/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<Product_attributeDTO> product_attributedtos) {
product_attributeService.saveBatch(product_attributeMapping.toDomain(product_attributedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Product_attribute-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Product_attribute-Get')")
@ApiOperation(value = "获取数据集", tags = {"产品属性" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/product_attributes/fetchdefault")
public ResponseEntity<List<Product_attributeDTO>> fetchDefault(Product_attributeSearchContext context) {
Page<Product_attribute> domains = product_attributeService.searchDefault(context) ;
List<Product_attributeDTO> list = product_attributeMapping.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_attribute-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Product_attribute-Get')")
@ApiOperation(value = "查询数据集", tags = {"产品属性" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/product_attributes/searchdefault")
public ResponseEntity<Page<Product_attributeDTO>> searchDefault(@RequestBody Product_attributeSearchContext context) {
Page<Product_attribute> domains = product_attributeService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(product_attributeMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
} }
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册