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

xignzi006 发布系统代码

上级 1ab6c331
......@@ -58,4 +58,27 @@ public class product_supplierinfoFallback implements product_supplierinfoFeignCl
return null;
}
public Product_supplierinfo getDraft(){
return null;
}
public Boolean checkKey(Product_supplierinfo product_supplierinfo){
return false;
}
public Boolean save(Product_supplierinfo product_supplierinfo){
return false;
}
public Boolean saveBatch(List<Product_supplierinfo> product_supplierinfos){
return false;
}
public Page<Product_supplierinfo> searchDefault(Product_supplierinfoSearchContext context){
return null;
}
}
......@@ -56,4 +56,24 @@ public interface product_supplierinfoFeignClient {
Page<Product_supplierinfo> select();
@RequestMapping(method = RequestMethod.GET, value = "/product_supplierinfos/getdraft")
Product_supplierinfo getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/product_supplierinfos/checkkey")
Boolean checkKey(@RequestBody Product_supplierinfo product_supplierinfo);
@RequestMapping(method = RequestMethod.POST, value = "/product_supplierinfos/save")
Boolean save(@RequestBody Product_supplierinfo product_supplierinfo);
@RequestMapping(method = RequestMethod.POST, value = "/product_supplierinfos/savebatch")
Boolean saveBatch(@RequestBody List<Product_supplierinfo> product_supplierinfos);
@RequestMapping(method = RequestMethod.POST, value = "/product_supplierinfos/searchdefault")
Page<Product_supplierinfo> searchDefault(@RequestBody Product_supplierinfoSearchContext context);
}
......@@ -27,6 +27,160 @@ import cn.ibizlab.businesscentral.core.odoo_product.domain.Product_supplierinfo;
@Data
public class Product_supplierinfoSearchContext extends QueryWrapperContext<Product_supplierinfo> {
private String n_currency_id_text_eq;//[币种]
public void setN_currency_id_text_eq(String n_currency_id_text_eq) {
this.n_currency_id_text_eq = n_currency_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_currency_id_text_eq)){
this.getSearchCond().eq("currency_id_text", n_currency_id_text_eq);
}
}
private String n_currency_id_text_like;//[币种]
public void setN_currency_id_text_like(String n_currency_id_text_like) {
this.n_currency_id_text_like = n_currency_id_text_like;
if(!ObjectUtils.isEmpty(this.n_currency_id_text_like)){
this.getSearchCond().like("currency_id_text", n_currency_id_text_like);
}
}
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_company_id_text_eq;//[公司]
public void setN_company_id_text_eq(String n_company_id_text_eq) {
this.n_company_id_text_eq = n_company_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_company_id_text_eq)){
this.getSearchCond().eq("company_id_text", n_company_id_text_eq);
}
}
private String n_company_id_text_like;//[公司]
public void setN_company_id_text_like(String n_company_id_text_like) {
this.n_company_id_text_like = n_company_id_text_like;
if(!ObjectUtils.isEmpty(this.n_company_id_text_like)){
this.getSearchCond().like("company_id_text", n_company_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 String n_product_id_text_eq;//[产品变体]
public void setN_product_id_text_eq(String n_product_id_text_eq) {
this.n_product_id_text_eq = n_product_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_product_id_text_eq)){
this.getSearchCond().eq("product_id_text", n_product_id_text_eq);
}
}
private String n_product_id_text_like;//[产品变体]
public void setN_product_id_text_like(String n_product_id_text_like) {
this.n_product_id_text_like = n_product_id_text_like;
if(!ObjectUtils.isEmpty(this.n_product_id_text_like)){
this.getSearchCond().like("product_id_text", n_product_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_name_text_eq;//[供应商]
public void setN_name_text_eq(String n_name_text_eq) {
this.n_name_text_eq = n_name_text_eq;
if(!ObjectUtils.isEmpty(this.n_name_text_eq)){
this.getSearchCond().eq("name_text", n_name_text_eq);
}
}
private String n_name_text_like;//[供应商]
public void setN_name_text_like(String n_name_text_like) {
this.n_name_text_like = n_name_text_like;
if(!ObjectUtils.isEmpty(this.n_name_text_like)){
this.getSearchCond().like("name_text", n_name_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_company_id_eq;//[公司]
public void setN_company_id_eq(Long n_company_id_eq) {
this.n_company_id_eq = n_company_id_eq;
if(!ObjectUtils.isEmpty(this.n_company_id_eq)){
this.getSearchCond().eq("company_id", n_company_id_eq);
}
}
private Long n_product_id_eq;//[产品变体]
public void setN_product_id_eq(Long n_product_id_eq) {
this.n_product_id_eq = n_product_id_eq;
if(!ObjectUtils.isEmpty(this.n_product_id_eq)){
this.getSearchCond().eq("product_id", n_product_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);
}
}
private Long n_currency_id_eq;//[币种]
public void setN_currency_id_eq(Long n_currency_id_eq) {
this.n_currency_id_eq = n_currency_id_eq;
if(!ObjectUtils.isEmpty(this.n_currency_id_eq)){
this.getSearchCond().eq("currency_id", n_currency_id_eq);
}
}
private Long n_name_eq;//[供应商]
public void setN_name_eq(Long 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 Long n_name_like;//[供应商]
public void setN_name_like(Long 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 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);
}
}
/**
* 启用快速搜索
......
......@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
public interface Product_supplierinfoMapper extends BaseMapper<Product_supplierinfo>{
Page<Product_supplierinfo> searchDefault(IPage page, @Param("srf") Product_supplierinfoSearchContext context, @Param("ew") Wrapper<Product_supplierinfo> wrapper) ;
@Override
Product_supplierinfo selectById(Serializable id);
@Override
......@@ -61,4 +62,18 @@ public interface Product_supplierinfoMapper extends BaseMapper<Product_supplieri
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<Product_supplierinfo> selectByProductId(@Param("id") Serializable id) ;
List<Product_supplierinfo> selectByProductTmplId(@Param("id") Serializable id) ;
List<Product_supplierinfo> selectByCompanyId(@Param("id") Serializable id) ;
List<Product_supplierinfo> selectByCurrencyId(@Param("id") Serializable id) ;
List<Product_supplierinfo> selectByName(@Param("id") Serializable id) ;
List<Product_supplierinfo> selectByCreateUid(@Param("id") Serializable id) ;
List<Product_supplierinfo> selectByWriteUid(@Param("id") Serializable id) ;
}
......@@ -33,6 +33,25 @@ public interface IProduct_supplierinfoService extends IService<Product_supplieri
boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ;
Product_supplierinfo get(Long key) ;
Product_supplierinfo getDraft(Product_supplierinfo et) ;
boolean checkKey(Product_supplierinfo et) ;
boolean save(Product_supplierinfo et) ;
void saveBatch(List<Product_supplierinfo> list) ;
Page<Product_supplierinfo> searchDefault(Product_supplierinfoSearchContext context) ;
List<Product_supplierinfo> selectByProductId(Long id) ;
void removeByProductId(Long id) ;
List<Product_supplierinfo> selectByProductTmplId(Long id) ;
void removeByProductTmplId(Long id) ;
List<Product_supplierinfo> selectByCompanyId(Long id) ;
void removeByCompanyId(Long id) ;
List<Product_supplierinfo> selectByCurrencyId(Long id) ;
void removeByCurrencyId(Long id) ;
List<Product_supplierinfo> selectByName(Long id) ;
void removeByName(Long id) ;
List<Product_supplierinfo> selectByCreateUid(Long id) ;
void removeByCreateUid(Long id) ;
List<Product_supplierinfo> selectByWriteUid(Long id) ;
void removeByWriteUid(Long id) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
......
......@@ -129,7 +129,129 @@ public class Product_supplierinfoServiceImpl extends ServiceImpl<Product_supplie
return et;
}
@Override
public Product_supplierinfo getDraft(Product_supplierinfo et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(Product_supplierinfo et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Product_supplierinfo et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Product_supplierinfo et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Product_supplierinfo> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Product_supplierinfo> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Product_supplierinfo> selectByProductId(Long id) {
return baseMapper.selectByProductId(id);
}
@Override
public void removeByProductId(Long id) {
this.remove(new QueryWrapper<Product_supplierinfo>().eq("product_id",id));
}
@Override
public List<Product_supplierinfo> selectByProductTmplId(Long id) {
return baseMapper.selectByProductTmplId(id);
}
@Override
public void removeByProductTmplId(Long id) {
this.remove(new QueryWrapper<Product_supplierinfo>().eq("product_tmpl_id",id));
}
@Override
public List<Product_supplierinfo> selectByCompanyId(Long id) {
return baseMapper.selectByCompanyId(id);
}
@Override
public void removeByCompanyId(Long id) {
this.remove(new QueryWrapper<Product_supplierinfo>().eq("company_id",id));
}
@Override
public List<Product_supplierinfo> selectByCurrencyId(Long id) {
return baseMapper.selectByCurrencyId(id);
}
@Override
public void removeByCurrencyId(Long id) {
this.remove(new QueryWrapper<Product_supplierinfo>().eq("currency_id",id));
}
@Override
public List<Product_supplierinfo> selectByName(Long id) {
return baseMapper.selectByName(id);
}
@Override
public void removeByName(Long id) {
this.remove(new QueryWrapper<Product_supplierinfo>().eq("name",id));
}
@Override
public List<Product_supplierinfo> selectByCreateUid(Long id) {
return baseMapper.selectByCreateUid(id);
}
@Override
public void removeByCreateUid(Long id) {
this.remove(new QueryWrapper<Product_supplierinfo>().eq("create_uid",id));
}
@Override
public List<Product_supplierinfo> selectByWriteUid(Long id) {
return baseMapper.selectByWriteUid(id);
}
@Override
public void removeByWriteUid(Long id) {
this.remove(new QueryWrapper<Product_supplierinfo>().eq("write_uid",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Product_supplierinfo> searchDefault(Product_supplierinfoSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Product_supplierinfo> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Product_supplierinfo>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
......
......@@ -4,6 +4,9 @@
<mapper namespace="cn.ibizlab.businesscentral.core.odoo_product.mapper.Product_supplierinfoMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Product_supplierinfoResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.COMPANY_ID, t41.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t61.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t11.NAME AS CURRENCY_ID_TEXT, t1.DATE_END, t1.DATE_START, t1.DELAY, t1.ID, t1.MIN_QTY, t1.NAME, t111.NAME AS NAME_TEXT, t1.PRICE, t1.PRODUCT_CODE, t1.PRODUCT_ID, t81.NAME AS PRODUCT_ID_TEXT, t1.PRODUCT_NAME, t1.PRODUCT_TMPL_ID, t21.NAME AS PRODUCT_TMPL_ID_TEXT, t21.UOM_PO_ID AS PRODUCT_UOM, t1.SEQUENCE, t1.WRITE_DATE, t1.WRITE_UID, t101.NAME AS WRITE_UID_TEXT FROM PRODUCT_SUPPLIERINFO t1 LEFT JOIN RES_CURRENCY t11 ON t1.CURRENCY_ID = t11.ID LEFT JOIN PRODUCT_TEMPLATE t21 ON t1.PRODUCT_TMPL_ID = t21.ID LEFT JOIN RES_COMPANY t31 ON t1.COMPANY_ID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_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 LEFT JOIN PRODUCT_PRODUCT t71 ON t1.PRODUCT_ID = t71.ID LEFT JOIN PRODUCT_TEMPLATE t81 ON t71.PRODUCT_TMPL_ID = t81.ID LEFT JOIN RES_USERS t91 ON t1.WRITE_UID = t91.ID LEFT JOIN RES_PARTNER t101 ON t91.PARTNER_ID = t101.ID LEFT JOIN RES_PARTNER t111 ON t1.NAME = t111.ID ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Product_supplierinfoResultMap" type="cn.ibizlab.businesscentral.core.odoo_product.domain.Product_supplierinfo" autoMapping="true">
......@@ -52,12 +55,73 @@
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_SUPPLIERINFO__PRODUCT_PRODUCT__PRODUCT_ID] -->
<select id="selectByProductId" resultMap="Product_supplierinfoResultMap">
select t1.* from (
<include refid="Default" />
) t1
where product_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_SUPPLIERINFO__PRODUCT_TEMPLATE__PRODUCT_TMPL_ID] -->
<select id="selectByProductTmplId" resultMap="Product_supplierinfoResultMap">
select t1.* from (
<include refid="Default" />
) t1
where product_tmpl_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_SUPPLIERINFO__RES_COMPANY__COMPANY_ID] -->
<select id="selectByCompanyId" resultMap="Product_supplierinfoResultMap">
select t1.* from (
<include refid="Default" />
) t1
where company_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_SUPPLIERINFO__RES_CURRENCY__CURRENCY_ID] -->
<select id="selectByCurrencyId" resultMap="Product_supplierinfoResultMap">
select t1.* from (
<include refid="Default" />
) t1
where currency_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_SUPPLIERINFO__RES_PARTNER__NAME] -->
<select id="selectByName" resultMap="Product_supplierinfoResultMap">
select t1.* from (
<include refid="Default" />
) t1
where name=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_SUPPLIERINFO__RES_USERS__CREATE_UID] -->
<select id="selectByCreateUid" resultMap="Product_supplierinfoResultMap">
select t1.* from (
<include refid="Default" />
) t1
where create_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCT_SUPPLIERINFO__RES_USERS__WRITE_UID] -->
<select id="selectByWriteUid" resultMap="Product_supplierinfoResultMap">
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_supplierinfoSearchContext" resultMap="Product_supplierinfoResultMap">
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.COMPANY_ID, t41.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t61.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t11.NAME AS CURRENCY_ID_TEXT, t1.DATE_END, t1.DATE_START, t1.DELAY, t1.ID, t1.MIN_QTY, t1.NAME, t111.NAME AS NAME_TEXT, t1.PRICE, t1.PRODUCT_CODE, t1.PRODUCT_ID, t81.NAME AS PRODUCT_ID_TEXT, t1.PRODUCT_NAME, t1.PRODUCT_TMPL_ID, t21.NAME AS PRODUCT_TMPL_ID_TEXT, t21.UOM_PO_ID AS PRODUCT_UOM, t1.SEQUENCE, t1.WRITE_DATE, t1.WRITE_UID, t101.NAME AS WRITE_UID_TEXT FROM PRODUCT_SUPPLIERINFO t1 LEFT JOIN RES_CURRENCY t11 ON t1.CURRENCY_ID = t11.ID LEFT JOIN PRODUCT_TEMPLATE t21 ON t1.PRODUCT_TMPL_ID = t21.ID LEFT JOIN RES_COMPANY t31 ON t1.COMPANY_ID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_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 LEFT JOIN PRODUCT_PRODUCT t71 ON t1.PRODUCT_ID = t71.ID LEFT JOIN PRODUCT_TEMPLATE t81 ON t71.PRODUCT_TMPL_ID = t81.ID LEFT JOIN RES_USERS t91 ON t1.WRITE_UID = t91.ID LEFT JOIN RES_PARTNER t101 ON t91.PARTNER_ID = t101.ID LEFT JOIN RES_PARTNER t111 ON t1.NAME = t111.ID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.COMPANY_ID, t41.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t61.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t11.NAME AS CURRENCY_ID_TEXT, t1.DATE_END, t1.DATE_START, t1.DELAY, t1.ID, t1.MIN_QTY, t1.NAME, t111.NAME AS NAME_TEXT, t1.PRICE, t1.PRODUCT_CODE, t1.PRODUCT_ID, t81.NAME AS PRODUCT_ID_TEXT, t1.PRODUCT_NAME, t1.PRODUCT_TMPL_ID, t21.NAME AS PRODUCT_TMPL_ID_TEXT, t21.UOM_PO_ID AS PRODUCT_UOM, t1.SEQUENCE, t1.WRITE_DATE, t1.WRITE_UID, t101.NAME AS WRITE_UID_TEXT FROM PRODUCT_SUPPLIERINFO t1 LEFT JOIN RES_CURRENCY t11 ON t1.CURRENCY_ID = t11.ID LEFT JOIN PRODUCT_TEMPLATE t21 ON t1.PRODUCT_TMPL_ID = t21.ID LEFT JOIN RES_COMPANY t31 ON t1.COMPANY_ID = t31.ID LEFT JOIN RES_PARTNER t41 ON t31.PARTNER_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 LEFT JOIN PRODUCT_PRODUCT t71 ON t1.PRODUCT_ID = t71.ID LEFT JOIN PRODUCT_TEMPLATE t81 ON t71.PRODUCT_TMPL_ID = t81.ID LEFT JOIN RES_USERS t91 ON t1.WRITE_UID = t91.ID LEFT JOIN RES_PARTNER t101 ON t91.PARTNER_ID = t101.ID LEFT JOIN RES_PARTNER t111 ON t1.NAME = t111.ID
]]>
</sql>
</mapper>
......@@ -109,6 +109,55 @@ public class Product_supplierinfoResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取供应商价格表草稿", tags = {"供应商价格表" }, notes = "获取供应商价格表草稿")
@RequestMapping(method = RequestMethod.GET, value = "/product_supplierinfos/getdraft")
public ResponseEntity<Product_supplierinfoDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(product_supplierinfoMapping.toDto(product_supplierinfoService.getDraft(new Product_supplierinfo())));
}
@ApiOperation(value = "检查供应商价格表", tags = {"供应商价格表" }, notes = "检查供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/product_supplierinfos/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody Product_supplierinfoDTO product_supplierinfodto) {
return ResponseEntity.status(HttpStatus.OK).body(product_supplierinfoService.checkKey(product_supplierinfoMapping.toDomain(product_supplierinfodto)));
}
@PreAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(#product_supplierinfodto),'iBizBusinessCentral-Product_supplierinfo-Save')")
@ApiOperation(value = "保存供应商价格表", tags = {"供应商价格表" }, notes = "保存供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/product_supplierinfos/save")
public ResponseEntity<Boolean> save(@RequestBody Product_supplierinfoDTO product_supplierinfodto) {
return ResponseEntity.status(HttpStatus.OK).body(product_supplierinfoService.save(product_supplierinfoMapping.toDomain(product_supplierinfodto)));
}
@PreAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(#product_supplierinfodtos),'iBizBusinessCentral-Product_supplierinfo-Save')")
@ApiOperation(value = "批量保存供应商价格表", tags = {"供应商价格表" }, notes = "批量保存供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/product_supplierinfos/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<Product_supplierinfoDTO> product_supplierinfodtos) {
product_supplierinfoService.saveBatch(product_supplierinfoMapping.toDomain(product_supplierinfodtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Product_supplierinfo-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Product_supplierinfo-Get')")
@ApiOperation(value = "获取数据集", tags = {"供应商价格表" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/product_supplierinfos/fetchdefault")
public ResponseEntity<List<Product_supplierinfoDTO>> fetchDefault(Product_supplierinfoSearchContext context) {
Page<Product_supplierinfo> domains = product_supplierinfoService.searchDefault(context) ;
List<Product_supplierinfoDTO> list = product_supplierinfoMapping.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_supplierinfo-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Product_supplierinfo-Get')")
@ApiOperation(value = "查询数据集", tags = {"供应商价格表" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/product_supplierinfos/searchdefault")
public ResponseEntity<Page<Product_supplierinfoDTO>> searchDefault(@RequestBody Product_supplierinfoSearchContext context) {
Page<Product_supplierinfo> domains = product_supplierinfoService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(product_supplierinfoMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册