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

xignzi006 发布系统代码

上级 42dbb45d
......@@ -58,4 +58,27 @@ public class purchase_bill_unionFallback implements purchase_bill_unionFeignClie
return null;
}
public Purchase_bill_union getDraft(){
return null;
}
public Boolean checkKey(Purchase_bill_union purchase_bill_union){
return false;
}
public Boolean save(Purchase_bill_union purchase_bill_union){
return false;
}
public Boolean saveBatch(List<Purchase_bill_union> purchase_bill_unions){
return false;
}
public Page<Purchase_bill_union> searchDefault(Purchase_bill_unionSearchContext context){
return null;
}
}
......@@ -56,4 +56,24 @@ public interface purchase_bill_unionFeignClient {
Page<Purchase_bill_union> select();
@RequestMapping(method = RequestMethod.GET, value = "/purchase_bill_unions/getdraft")
Purchase_bill_union getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/purchase_bill_unions/checkkey")
Boolean checkKey(@RequestBody Purchase_bill_union purchase_bill_union);
@RequestMapping(method = RequestMethod.POST, value = "/purchase_bill_unions/save")
Boolean save(@RequestBody Purchase_bill_union purchase_bill_union);
@RequestMapping(method = RequestMethod.POST, value = "/purchase_bill_unions/savebatch")
Boolean saveBatch(@RequestBody List<Purchase_bill_union> purchase_bill_unions);
@RequestMapping(method = RequestMethod.POST, value = "/purchase_bill_unions/searchdefault")
Page<Purchase_bill_union> searchDefault(@RequestBody Purchase_bill_unionSearchContext context);
}
......@@ -58,4 +58,27 @@ public class purchase_order_lineFallback implements purchase_order_lineFeignClie
return null;
}
public Purchase_order_line getDraft(){
return null;
}
public Boolean checkKey(Purchase_order_line purchase_order_line){
return false;
}
public Boolean save(Purchase_order_line purchase_order_line){
return false;
}
public Boolean saveBatch(List<Purchase_order_line> purchase_order_lines){
return false;
}
public Page<Purchase_order_line> searchDefault(Purchase_order_lineSearchContext context){
return null;
}
}
......@@ -56,4 +56,24 @@ public interface purchase_order_lineFeignClient {
Page<Purchase_order_line> select();
@RequestMapping(method = RequestMethod.GET, value = "/purchase_order_lines/getdraft")
Purchase_order_line getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/purchase_order_lines/checkkey")
Boolean checkKey(@RequestBody Purchase_order_line purchase_order_line);
@RequestMapping(method = RequestMethod.POST, value = "/purchase_order_lines/save")
Boolean save(@RequestBody Purchase_order_line purchase_order_line);
@RequestMapping(method = RequestMethod.POST, value = "/purchase_order_lines/savebatch")
Boolean saveBatch(@RequestBody List<Purchase_order_line> purchase_order_lines);
@RequestMapping(method = RequestMethod.POST, value = "/purchase_order_lines/searchdefault")
Page<Purchase_order_line> searchDefault(@RequestBody Purchase_order_lineSearchContext context);
}
......@@ -58,4 +58,27 @@ public class purchase_reportFallback implements purchase_reportFeignClient{
return null;
}
public Purchase_report getDraft(){
return null;
}
public Boolean checkKey(Purchase_report purchase_report){
return false;
}
public Boolean save(Purchase_report purchase_report){
return false;
}
public Boolean saveBatch(List<Purchase_report> purchase_reports){
return false;
}
public Page<Purchase_report> searchDefault(Purchase_reportSearchContext context){
return null;
}
}
......@@ -56,4 +56,24 @@ public interface purchase_reportFeignClient {
Page<Purchase_report> select();
@RequestMapping(method = RequestMethod.GET, value = "/purchase_reports/getdraft")
Purchase_report getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/purchase_reports/checkkey")
Boolean checkKey(@RequestBody Purchase_report purchase_report);
@RequestMapping(method = RequestMethod.POST, value = "/purchase_reports/save")
Boolean save(@RequestBody Purchase_report purchase_report);
@RequestMapping(method = RequestMethod.POST, value = "/purchase_reports/savebatch")
Boolean saveBatch(@RequestBody List<Purchase_report> purchase_reports);
@RequestMapping(method = RequestMethod.POST, value = "/purchase_reports/searchdefault")
Page<Purchase_report> searchDefault(@RequestBody Purchase_reportSearchContext context);
}
......@@ -27,6 +27,118 @@ import cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_bill_union;
@Data
public class Purchase_bill_unionSearchContext extends QueryWrapperContext<Purchase_bill_union> {
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_purchase_order_id_text_eq;//[采购订单]
public void setN_purchase_order_id_text_eq(String n_purchase_order_id_text_eq) {
this.n_purchase_order_id_text_eq = n_purchase_order_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_purchase_order_id_text_eq)){
this.getSearchCond().eq("purchase_order_id_text", n_purchase_order_id_text_eq);
}
}
private String n_purchase_order_id_text_like;//[采购订单]
public void setN_purchase_order_id_text_like(String n_purchase_order_id_text_like) {
this.n_purchase_order_id_text_like = n_purchase_order_id_text_like;
if(!ObjectUtils.isEmpty(this.n_purchase_order_id_text_like)){
this.getSearchCond().like("purchase_order_id_text", n_purchase_order_id_text_like);
}
}
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_partner_id_text_eq;//[供应商]
public void setN_partner_id_text_eq(String n_partner_id_text_eq) {
this.n_partner_id_text_eq = n_partner_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_partner_id_text_eq)){
this.getSearchCond().eq("partner_id_text", n_partner_id_text_eq);
}
}
private String n_partner_id_text_like;//[供应商]
public void setN_partner_id_text_like(String n_partner_id_text_like) {
this.n_partner_id_text_like = n_partner_id_text_like;
if(!ObjectUtils.isEmpty(this.n_partner_id_text_like)){
this.getSearchCond().like("partner_id_text", n_partner_id_text_like);
}
}
private String n_vendor_bill_id_text_eq;//[供应商账单]
public void setN_vendor_bill_id_text_eq(String n_vendor_bill_id_text_eq) {
this.n_vendor_bill_id_text_eq = n_vendor_bill_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_vendor_bill_id_text_eq)){
this.getSearchCond().eq("vendor_bill_id_text", n_vendor_bill_id_text_eq);
}
}
private String n_vendor_bill_id_text_like;//[供应商账单]
public void setN_vendor_bill_id_text_like(String n_vendor_bill_id_text_like) {
this.n_vendor_bill_id_text_like = n_vendor_bill_id_text_like;
if(!ObjectUtils.isEmpty(this.n_vendor_bill_id_text_like)){
this.getSearchCond().like("vendor_bill_id_text", n_vendor_bill_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 Long n_vendor_bill_id_eq;//[供应商账单]
public void setN_vendor_bill_id_eq(Long n_vendor_bill_id_eq) {
this.n_vendor_bill_id_eq = n_vendor_bill_id_eq;
if(!ObjectUtils.isEmpty(this.n_vendor_bill_id_eq)){
this.getSearchCond().eq("vendor_bill_id", n_vendor_bill_id_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_purchase_order_id_eq;//[采购订单]
public void setN_purchase_order_id_eq(Long n_purchase_order_id_eq) {
this.n_purchase_order_id_eq = n_purchase_order_id_eq;
if(!ObjectUtils.isEmpty(this.n_purchase_order_id_eq)){
this.getSearchCond().eq("purchase_order_id", n_purchase_order_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_partner_id_eq;//[供应商]
public void setN_partner_id_eq(Long n_partner_id_eq) {
this.n_partner_id_eq = n_partner_id_eq;
if(!ObjectUtils.isEmpty(this.n_partner_id_eq)){
this.getSearchCond().eq("partner_id", n_partner_id_eq);
}
}
/**
* 启用快速搜索
......
......@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
public interface Purchase_bill_unionMapper extends BaseMapper<Purchase_bill_union>{
Page<Purchase_bill_union> searchDefault(IPage page, @Param("srf") Purchase_bill_unionSearchContext context, @Param("ew") Wrapper<Purchase_bill_union> wrapper) ;
@Override
Purchase_bill_union selectById(Serializable id);
@Override
......@@ -61,4 +62,14 @@ public interface Purchase_bill_unionMapper extends BaseMapper<Purchase_bill_unio
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<Purchase_bill_union> selectByVendorBillId(@Param("id") Serializable id) ;
List<Purchase_bill_union> selectByPurchaseOrderId(@Param("id") Serializable id) ;
List<Purchase_bill_union> selectByCompanyId(@Param("id") Serializable id) ;
List<Purchase_bill_union> selectByCurrencyId(@Param("id") Serializable id) ;
List<Purchase_bill_union> selectByPartnerId(@Param("id") Serializable id) ;
}
......@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
public interface Purchase_order_lineMapper extends BaseMapper<Purchase_order_line>{
Page<Purchase_order_line> searchDefault(IPage page, @Param("srf") Purchase_order_lineSearchContext context, @Param("ew") Wrapper<Purchase_order_line> wrapper) ;
@Override
Purchase_order_line selectById(Serializable id);
@Override
......@@ -61,4 +62,28 @@ public interface Purchase_order_lineMapper extends BaseMapper<Purchase_order_lin
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<Purchase_order_line> selectByAccountAnalyticId(@Param("id") Serializable id) ;
List<Purchase_order_line> selectByProductId(@Param("id") Serializable id) ;
List<Purchase_order_line> selectByOrderId(@Param("id") Serializable id) ;
List<Purchase_order_line> selectByCompanyId(@Param("id") Serializable id) ;
List<Purchase_order_line> selectByCurrencyId(@Param("id") Serializable id) ;
List<Purchase_order_line> selectByPartnerId(@Param("id") Serializable id) ;
List<Purchase_order_line> selectByCreateUid(@Param("id") Serializable id) ;
List<Purchase_order_line> selectByWriteUid(@Param("id") Serializable id) ;
List<Purchase_order_line> selectBySaleLineId(@Param("id") Serializable id) ;
List<Purchase_order_line> selectBySaleOrderId(@Param("id") Serializable id) ;
List<Purchase_order_line> selectByOrderpointId(@Param("id") Serializable id) ;
List<Purchase_order_line> selectByProductUom(@Param("id") Serializable id) ;
}
......@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
public interface Purchase_reportMapper extends BaseMapper<Purchase_report>{
Page<Purchase_report> searchDefault(IPage page, @Param("srf") Purchase_reportSearchContext context, @Param("ew") Wrapper<Purchase_report> wrapper) ;
@Override
Purchase_report selectById(Serializable id);
@Override
......@@ -61,4 +62,30 @@ public interface Purchase_reportMapper extends BaseMapper<Purchase_report>{
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<Purchase_report> selectByAccountAnalyticId(@Param("id") Serializable id) ;
List<Purchase_report> selectByFiscalPositionId(@Param("id") Serializable id) ;
List<Purchase_report> selectByCategoryId(@Param("id") Serializable id) ;
List<Purchase_report> selectByProductId(@Param("id") Serializable id) ;
List<Purchase_report> selectByProductTmplId(@Param("id") Serializable id) ;
List<Purchase_report> selectByCompanyId(@Param("id") Serializable id) ;
List<Purchase_report> selectByCountryId(@Param("id") Serializable id) ;
List<Purchase_report> selectByCurrencyId(@Param("id") Serializable id) ;
List<Purchase_report> selectByCommercialPartnerId(@Param("id") Serializable id) ;
List<Purchase_report> selectByPartnerId(@Param("id") Serializable id) ;
List<Purchase_report> selectByUserId(@Param("id") Serializable id) ;
List<Purchase_report> selectByPickingTypeId(@Param("id") Serializable id) ;
List<Purchase_report> selectByProductUom(@Param("id") Serializable id) ;
}
......@@ -33,6 +33,21 @@ public interface IPurchase_bill_unionService extends IService<Purchase_bill_unio
boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ;
Purchase_bill_union get(Long key) ;
Purchase_bill_union getDraft(Purchase_bill_union et) ;
boolean checkKey(Purchase_bill_union et) ;
boolean save(Purchase_bill_union et) ;
void saveBatch(List<Purchase_bill_union> list) ;
Page<Purchase_bill_union> searchDefault(Purchase_bill_unionSearchContext context) ;
List<Purchase_bill_union> selectByVendorBillId(Long id) ;
void removeByVendorBillId(Long id) ;
List<Purchase_bill_union> selectByPurchaseOrderId(Long id) ;
void removeByPurchaseOrderId(Long id) ;
List<Purchase_bill_union> selectByCompanyId(Long id) ;
void removeByCompanyId(Long id) ;
List<Purchase_bill_union> selectByCurrencyId(Long id) ;
void removeByCurrencyId(Long id) ;
List<Purchase_bill_union> selectByPartnerId(Long id) ;
void removeByPartnerId(Long id) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
......
......@@ -33,6 +33,35 @@ public interface IPurchase_order_lineService extends IService<Purchase_order_lin
boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ;
Purchase_order_line get(Long key) ;
Purchase_order_line getDraft(Purchase_order_line et) ;
boolean checkKey(Purchase_order_line et) ;
boolean save(Purchase_order_line et) ;
void saveBatch(List<Purchase_order_line> list) ;
Page<Purchase_order_line> searchDefault(Purchase_order_lineSearchContext context) ;
List<Purchase_order_line> selectByAccountAnalyticId(Long id) ;
void removeByAccountAnalyticId(Long id) ;
List<Purchase_order_line> selectByProductId(Long id) ;
void removeByProductId(Long id) ;
List<Purchase_order_line> selectByOrderId(Long id) ;
void removeByOrderId(Long id) ;
List<Purchase_order_line> selectByCompanyId(Long id) ;
void removeByCompanyId(Long id) ;
List<Purchase_order_line> selectByCurrencyId(Long id) ;
void removeByCurrencyId(Long id) ;
List<Purchase_order_line> selectByPartnerId(Long id) ;
void removeByPartnerId(Long id) ;
List<Purchase_order_line> selectByCreateUid(Long id) ;
void removeByCreateUid(Long id) ;
List<Purchase_order_line> selectByWriteUid(Long id) ;
void removeByWriteUid(Long id) ;
List<Purchase_order_line> selectBySaleLineId(Long id) ;
void removeBySaleLineId(Long id) ;
List<Purchase_order_line> selectBySaleOrderId(Long id) ;
void removeBySaleOrderId(Long id) ;
List<Purchase_order_line> selectByOrderpointId(Long id) ;
void removeByOrderpointId(Long id) ;
List<Purchase_order_line> selectByProductUom(Long id) ;
void removeByProductUom(Long id) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
......
......@@ -33,6 +33,37 @@ public interface IPurchase_reportService extends IService<Purchase_report>{
boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ;
Purchase_report get(Long key) ;
Purchase_report getDraft(Purchase_report et) ;
boolean checkKey(Purchase_report et) ;
boolean save(Purchase_report et) ;
void saveBatch(List<Purchase_report> list) ;
Page<Purchase_report> searchDefault(Purchase_reportSearchContext context) ;
List<Purchase_report> selectByAccountAnalyticId(Long id) ;
void removeByAccountAnalyticId(Long id) ;
List<Purchase_report> selectByFiscalPositionId(Long id) ;
void removeByFiscalPositionId(Long id) ;
List<Purchase_report> selectByCategoryId(Long id) ;
void removeByCategoryId(Long id) ;
List<Purchase_report> selectByProductId(Long id) ;
void removeByProductId(Long id) ;
List<Purchase_report> selectByProductTmplId(Long id) ;
void removeByProductTmplId(Long id) ;
List<Purchase_report> selectByCompanyId(Long id) ;
void removeByCompanyId(Long id) ;
List<Purchase_report> selectByCountryId(Long id) ;
void removeByCountryId(Long id) ;
List<Purchase_report> selectByCurrencyId(Long id) ;
void removeByCurrencyId(Long id) ;
List<Purchase_report> selectByCommercialPartnerId(Long id) ;
void removeByCommercialPartnerId(Long id) ;
List<Purchase_report> selectByPartnerId(Long id) ;
void removeByPartnerId(Long id) ;
List<Purchase_report> selectByUserId(Long id) ;
void removeByUserId(Long id) ;
List<Purchase_report> selectByPickingTypeId(Long id) ;
void removeByPickingTypeId(Long id) ;
List<Purchase_report> selectByProductUom(Long id) ;
void removeByProductUom(Long id) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
......
......@@ -126,7 +126,109 @@ public class Purchase_bill_unionServiceImpl extends ServiceImpl<Purchase_bill_un
return et;
}
@Override
public Purchase_bill_union getDraft(Purchase_bill_union et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(Purchase_bill_union et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Purchase_bill_union et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Purchase_bill_union et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Purchase_bill_union> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Purchase_bill_union> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Purchase_bill_union> selectByVendorBillId(Long id) {
return baseMapper.selectByVendorBillId(id);
}
@Override
public void removeByVendorBillId(Long id) {
this.remove(new QueryWrapper<Purchase_bill_union>().eq("vendor_bill_id",id));
}
@Override
public List<Purchase_bill_union> selectByPurchaseOrderId(Long id) {
return baseMapper.selectByPurchaseOrderId(id);
}
@Override
public void removeByPurchaseOrderId(Long id) {
this.remove(new QueryWrapper<Purchase_bill_union>().eq("purchase_order_id",id));
}
@Override
public List<Purchase_bill_union> selectByCompanyId(Long id) {
return baseMapper.selectByCompanyId(id);
}
@Override
public void removeByCompanyId(Long id) {
this.remove(new QueryWrapper<Purchase_bill_union>().eq("company_id",id));
}
@Override
public List<Purchase_bill_union> selectByCurrencyId(Long id) {
return baseMapper.selectByCurrencyId(id);
}
@Override
public void removeByCurrencyId(Long id) {
this.remove(new QueryWrapper<Purchase_bill_union>().eq("currency_id",id));
}
@Override
public List<Purchase_bill_union> selectByPartnerId(Long id) {
return baseMapper.selectByPartnerId(id);
}
@Override
public void removeByPartnerId(Long id) {
this.remove(new QueryWrapper<Purchase_bill_union>().eq("partner_id",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Purchase_bill_union> searchDefault(Purchase_bill_unionSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Purchase_bill_union> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Purchase_bill_union>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
......
......@@ -150,7 +150,179 @@ public class Purchase_order_lineServiceImpl extends ServiceImpl<Purchase_order_l
return et;
}
@Override
public Purchase_order_line getDraft(Purchase_order_line et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(Purchase_order_line et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Purchase_order_line et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Purchase_order_line et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Purchase_order_line> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Purchase_order_line> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Purchase_order_line> selectByAccountAnalyticId(Long id) {
return baseMapper.selectByAccountAnalyticId(id);
}
@Override
public void removeByAccountAnalyticId(Long id) {
this.remove(new QueryWrapper<Purchase_order_line>().eq("account_analytic_id",id));
}
@Override
public List<Purchase_order_line> selectByProductId(Long id) {
return baseMapper.selectByProductId(id);
}
@Override
public void removeByProductId(Long id) {
this.remove(new QueryWrapper<Purchase_order_line>().eq("product_id",id));
}
@Override
public List<Purchase_order_line> selectByOrderId(Long id) {
return baseMapper.selectByOrderId(id);
}
@Override
public void removeByOrderId(Long id) {
this.remove(new QueryWrapper<Purchase_order_line>().eq("order_id",id));
}
@Override
public List<Purchase_order_line> selectByCompanyId(Long id) {
return baseMapper.selectByCompanyId(id);
}
@Override
public void removeByCompanyId(Long id) {
this.remove(new QueryWrapper<Purchase_order_line>().eq("company_id",id));
}
@Override
public List<Purchase_order_line> selectByCurrencyId(Long id) {
return baseMapper.selectByCurrencyId(id);
}
@Override
public void removeByCurrencyId(Long id) {
this.remove(new QueryWrapper<Purchase_order_line>().eq("currency_id",id));
}
@Override
public List<Purchase_order_line> selectByPartnerId(Long id) {
return baseMapper.selectByPartnerId(id);
}
@Override
public void removeByPartnerId(Long id) {
this.remove(new QueryWrapper<Purchase_order_line>().eq("partner_id",id));
}
@Override
public List<Purchase_order_line> selectByCreateUid(Long id) {
return baseMapper.selectByCreateUid(id);
}
@Override
public void removeByCreateUid(Long id) {
this.remove(new QueryWrapper<Purchase_order_line>().eq("create_uid",id));
}
@Override
public List<Purchase_order_line> selectByWriteUid(Long id) {
return baseMapper.selectByWriteUid(id);
}
@Override
public void removeByWriteUid(Long id) {
this.remove(new QueryWrapper<Purchase_order_line>().eq("write_uid",id));
}
@Override
public List<Purchase_order_line> selectBySaleLineId(Long id) {
return baseMapper.selectBySaleLineId(id);
}
@Override
public void removeBySaleLineId(Long id) {
this.remove(new QueryWrapper<Purchase_order_line>().eq("sale_line_id",id));
}
@Override
public List<Purchase_order_line> selectBySaleOrderId(Long id) {
return baseMapper.selectBySaleOrderId(id);
}
@Override
public void removeBySaleOrderId(Long id) {
this.remove(new QueryWrapper<Purchase_order_line>().eq("sale_order_id",id));
}
@Override
public List<Purchase_order_line> selectByOrderpointId(Long id) {
return baseMapper.selectByOrderpointId(id);
}
@Override
public void removeByOrderpointId(Long id) {
this.remove(new QueryWrapper<Purchase_order_line>().eq("orderpoint_id",id));
}
@Override
public List<Purchase_order_line> selectByProductUom(Long id) {
return baseMapper.selectByProductUom(id);
}
@Override
public void removeByProductUom(Long id) {
this.remove(new QueryWrapper<Purchase_order_line>().eq("product_uom",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Purchase_order_line> searchDefault(Purchase_order_lineSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Purchase_order_line> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Purchase_order_line>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
......
......@@ -147,7 +147,189 @@ public class Purchase_reportServiceImpl extends ServiceImpl<Purchase_reportMappe
return et;
}
@Override
public Purchase_report getDraft(Purchase_report et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(Purchase_report et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Purchase_report et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Purchase_report et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Purchase_report> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Purchase_report> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Purchase_report> selectByAccountAnalyticId(Long id) {
return baseMapper.selectByAccountAnalyticId(id);
}
@Override
public void removeByAccountAnalyticId(Long id) {
this.remove(new QueryWrapper<Purchase_report>().eq("account_analytic_id",id));
}
@Override
public List<Purchase_report> selectByFiscalPositionId(Long id) {
return baseMapper.selectByFiscalPositionId(id);
}
@Override
public void removeByFiscalPositionId(Long id) {
this.remove(new QueryWrapper<Purchase_report>().eq("fiscal_position_id",id));
}
@Override
public List<Purchase_report> selectByCategoryId(Long id) {
return baseMapper.selectByCategoryId(id);
}
@Override
public void removeByCategoryId(Long id) {
this.remove(new QueryWrapper<Purchase_report>().eq("category_id",id));
}
@Override
public List<Purchase_report> selectByProductId(Long id) {
return baseMapper.selectByProductId(id);
}
@Override
public void removeByProductId(Long id) {
this.remove(new QueryWrapper<Purchase_report>().eq("product_id",id));
}
@Override
public List<Purchase_report> selectByProductTmplId(Long id) {
return baseMapper.selectByProductTmplId(id);
}
@Override
public void removeByProductTmplId(Long id) {
this.remove(new QueryWrapper<Purchase_report>().eq("product_tmpl_id",id));
}
@Override
public List<Purchase_report> selectByCompanyId(Long id) {
return baseMapper.selectByCompanyId(id);
}
@Override
public void removeByCompanyId(Long id) {
this.remove(new QueryWrapper<Purchase_report>().eq("company_id",id));
}
@Override
public List<Purchase_report> selectByCountryId(Long id) {
return baseMapper.selectByCountryId(id);
}
@Override
public void removeByCountryId(Long id) {
this.remove(new QueryWrapper<Purchase_report>().eq("country_id",id));
}
@Override
public List<Purchase_report> selectByCurrencyId(Long id) {
return baseMapper.selectByCurrencyId(id);
}
@Override
public void removeByCurrencyId(Long id) {
this.remove(new QueryWrapper<Purchase_report>().eq("currency_id",id));
}
@Override
public List<Purchase_report> selectByCommercialPartnerId(Long id) {
return baseMapper.selectByCommercialPartnerId(id);
}
@Override
public void removeByCommercialPartnerId(Long id) {
this.remove(new QueryWrapper<Purchase_report>().eq("commercial_partner_id",id));
}
@Override
public List<Purchase_report> selectByPartnerId(Long id) {
return baseMapper.selectByPartnerId(id);
}
@Override
public void removeByPartnerId(Long id) {
this.remove(new QueryWrapper<Purchase_report>().eq("partner_id",id));
}
@Override
public List<Purchase_report> selectByUserId(Long id) {
return baseMapper.selectByUserId(id);
}
@Override
public void removeByUserId(Long id) {
this.remove(new QueryWrapper<Purchase_report>().eq("user_id",id));
}
@Override
public List<Purchase_report> selectByPickingTypeId(Long id) {
return baseMapper.selectByPickingTypeId(id);
}
@Override
public void removeByPickingTypeId(Long id) {
this.remove(new QueryWrapper<Purchase_report>().eq("picking_type_id",id));
}
@Override
public List<Purchase_report> selectByProductUom(Long id) {
return baseMapper.selectByProductUom(id);
}
@Override
public void removeByProductUom(Long id) {
this.remove(new QueryWrapper<Purchase_report>().eq("product_uom",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Purchase_report> searchDefault(Purchase_reportSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Purchase_report> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Purchase_report>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
......
......@@ -4,6 +4,9 @@
<mapper namespace="cn.ibizlab.businesscentral.core.odoo_purchase.mapper.Purchase_bill_unionMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Purchase_bill_unionResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.AMOUNT, t1.COMPANY_ID, t61.NAME AS COMPANY_ID_TEXT, t1.CURRENCY_ID, t21.NAME AS CURRENCY_ID_TEXT, t1.DATE, t1.ID, t1.NAME, t1.PARTNER_ID, t31.NAME AS PARTNER_ID_TEXT, t1.PURCHASE_ORDER_ID, t11.NAME AS PURCHASE_ORDER_ID_TEXT, t1.REFERENCE, t1.VENDOR_BILL_ID, t41.NAME AS VENDOR_BILL_ID_TEXT FROM PURCHASE_BILL_UNION t1 LEFT JOIN PURCHASE_ORDER t11 ON t1.PURCHASE_ORDER_ID = t11.ID LEFT JOIN RES_CURRENCY t21 ON t1.CURRENCY_ID = t21.ID LEFT JOIN RES_PARTNER t31 ON t1.PARTNER_ID = t31.ID LEFT JOIN ACCOUNT_INVOICE t41 ON t1.VENDOR_BILL_ID = t41.ID LEFT JOIN RES_COMPANY t51 ON t1.COMPANY_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Purchase_bill_unionResultMap" type="cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_bill_union" autoMapping="true">
......@@ -35,10 +38,59 @@
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_BILL_UNION__ACCOUNT_INVOICE__VENDOR_BILL_ID] -->
<select id="selectByVendorBillId" resultMap="Purchase_bill_unionResultMap">
select t1.* from (
<include refid="Default" />
) t1
where vendor_bill_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_BILL_UNION__PURCHASE_ORDER__PURCHASE_ORDER_ID] -->
<select id="selectByPurchaseOrderId" resultMap="Purchase_bill_unionResultMap">
select t1.* from (
<include refid="Default" />
) t1
where purchase_order_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_BILL_UNION__RES_COMPANY__COMPANY_ID] -->
<select id="selectByCompanyId" resultMap="Purchase_bill_unionResultMap">
select t1.* from (
<include refid="Default" />
) t1
where company_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_BILL_UNION__RES_CURRENCY__CURRENCY_ID] -->
<select id="selectByCurrencyId" resultMap="Purchase_bill_unionResultMap">
select t1.* from (
<include refid="Default" />
) t1
where currency_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_BILL_UNION__RES_PARTNER__PARTNER_ID] -->
<select id="selectByPartnerId" resultMap="Purchase_bill_unionResultMap">
select t1.* from (
<include refid="Default" />
) t1
where partner_id=#{id}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_bill_unionSearchContext" resultMap="Purchase_bill_unionResultMap">
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.AMOUNT, t1.COMPANY_ID, t61.NAME AS COMPANY_ID_TEXT, t1.CURRENCY_ID, t21.NAME AS CURRENCY_ID_TEXT, t1.DATE, t1.ID, t1.NAME, t1.PARTNER_ID, t31.NAME AS PARTNER_ID_TEXT, t1.PURCHASE_ORDER_ID, t11.NAME AS PURCHASE_ORDER_ID_TEXT, t1.REFERENCE, t1.VENDOR_BILL_ID, t41.NAME AS VENDOR_BILL_ID_TEXT FROM PURCHASE_BILL_UNION t1 LEFT JOIN PURCHASE_ORDER t11 ON t1.PURCHASE_ORDER_ID = t11.ID LEFT JOIN RES_CURRENCY t21 ON t1.CURRENCY_ID = t21.ID LEFT JOIN RES_PARTNER t31 ON t1.PARTNER_ID = t31.ID LEFT JOIN ACCOUNT_INVOICE t41 ON t1.VENDOR_BILL_ID = t41.ID LEFT JOIN RES_COMPANY t51 ON t1.COMPANY_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.AMOUNT, t1.COMPANY_ID, t61.NAME AS COMPANY_ID_TEXT, t1.CURRENCY_ID, t21.NAME AS CURRENCY_ID_TEXT, t1.DATE, t1.ID, t1.NAME, t1.PARTNER_ID, t31.NAME AS PARTNER_ID_TEXT, t1.PURCHASE_ORDER_ID, t11.NAME AS PURCHASE_ORDER_ID_TEXT, t1.REFERENCE, t1.VENDOR_BILL_ID, t41.NAME AS VENDOR_BILL_ID_TEXT FROM PURCHASE_BILL_UNION t1 LEFT JOIN PURCHASE_ORDER t11 ON t1.PURCHASE_ORDER_ID = t11.ID LEFT JOIN RES_CURRENCY t21 ON t1.CURRENCY_ID = t21.ID LEFT JOIN RES_PARTNER t31 ON t1.PARTNER_ID = t31.ID LEFT JOIN ACCOUNT_INVOICE t41 ON t1.VENDOR_BILL_ID = t41.ID LEFT JOIN RES_COMPANY t51 ON t1.COMPANY_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID
]]>
</sql>
</mapper>
......@@ -108,6 +108,55 @@ public class Purchase_bill_unionResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取采购 & 账单草稿", tags = {"采购 & 账单" }, notes = "获取采购 & 账单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/purchase_bill_unions/getdraft")
public ResponseEntity<Purchase_bill_unionDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(purchase_bill_unionMapping.toDto(purchase_bill_unionService.getDraft(new Purchase_bill_union())));
}
@ApiOperation(value = "检查采购 & 账单", tags = {"采购 & 账单" }, notes = "检查采购 & 账单")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_bill_unions/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody Purchase_bill_unionDTO purchase_bill_uniondto) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_bill_unionService.checkKey(purchase_bill_unionMapping.toDomain(purchase_bill_uniondto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_bill_union-Save-all')")
@ApiOperation(value = "保存采购 & 账单", tags = {"采购 & 账单" }, notes = "保存采购 & 账单")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_bill_unions/save")
public ResponseEntity<Boolean> save(@RequestBody Purchase_bill_unionDTO purchase_bill_uniondto) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_bill_unionService.save(purchase_bill_unionMapping.toDomain(purchase_bill_uniondto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_bill_union-Save-all')")
@ApiOperation(value = "批量保存采购 & 账单", tags = {"采购 & 账单" }, notes = "批量保存采购 & 账单")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_bill_unions/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<Purchase_bill_unionDTO> purchase_bill_uniondtos) {
purchase_bill_unionService.saveBatch(purchase_bill_unionMapping.toDomain(purchase_bill_uniondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_bill_union-searchDefault-all')")
@ApiOperation(value = "获取数据集", tags = {"采购 & 账单" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/purchase_bill_unions/fetchdefault")
public ResponseEntity<List<Purchase_bill_unionDTO>> fetchDefault(Purchase_bill_unionSearchContext context) {
Page<Purchase_bill_union> domains = purchase_bill_unionService.searchDefault(context) ;
List<Purchase_bill_unionDTO> list = purchase_bill_unionMapping.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-Purchase_bill_union-searchDefault-all')")
@ApiOperation(value = "查询数据集", tags = {"采购 & 账单" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/purchase_bill_unions/searchdefault")
public ResponseEntity<Page<Purchase_bill_unionDTO>> searchDefault(@RequestBody Purchase_bill_unionSearchContext context) {
Page<Purchase_bill_union> domains = purchase_bill_unionService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_bill_unionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -109,6 +109,55 @@ public class Purchase_order_lineResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取采购订单行草稿", tags = {"采购订单行" }, notes = "获取采购订单行草稿")
@RequestMapping(method = RequestMethod.GET, value = "/purchase_order_lines/getdraft")
public ResponseEntity<Purchase_order_lineDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(purchase_order_lineMapping.toDto(purchase_order_lineService.getDraft(new Purchase_order_line())));
}
@ApiOperation(value = "检查采购订单行", tags = {"采购订单行" }, notes = "检查采购订单行")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_order_lines/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody Purchase_order_lineDTO purchase_order_linedto) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_order_lineService.checkKey(purchase_order_lineMapping.toDomain(purchase_order_linedto)));
}
@PreAuthorize("hasPermission(this.purchase_order_lineMapping.toDomain(#purchase_order_linedto),'iBizBusinessCentral-Purchase_order_line-Save')")
@ApiOperation(value = "保存采购订单行", tags = {"采购订单行" }, notes = "保存采购订单行")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_order_lines/save")
public ResponseEntity<Boolean> save(@RequestBody Purchase_order_lineDTO purchase_order_linedto) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_order_lineService.save(purchase_order_lineMapping.toDomain(purchase_order_linedto)));
}
@PreAuthorize("hasPermission(this.purchase_order_lineMapping.toDomain(#purchase_order_linedtos),'iBizBusinessCentral-Purchase_order_line-Save')")
@ApiOperation(value = "批量保存采购订单行", tags = {"采购订单行" }, notes = "批量保存采购订单行")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_order_lines/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<Purchase_order_lineDTO> purchase_order_linedtos) {
purchase_order_lineService.saveBatch(purchase_order_lineMapping.toDomain(purchase_order_linedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order_line-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order_line-Get')")
@ApiOperation(value = "获取数据集", tags = {"采购订单行" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/purchase_order_lines/fetchdefault")
public ResponseEntity<List<Purchase_order_lineDTO>> fetchDefault(Purchase_order_lineSearchContext context) {
Page<Purchase_order_line> domains = purchase_order_lineService.searchDefault(context) ;
List<Purchase_order_lineDTO> list = purchase_order_lineMapping.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-Purchase_order_line-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order_line-Get')")
@ApiOperation(value = "查询数据集", tags = {"采购订单行" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/purchase_order_lines/searchdefault")
public ResponseEntity<Page<Purchase_order_lineDTO>> searchDefault(@RequestBody Purchase_order_lineSearchContext context) {
Page<Purchase_order_line> domains = purchase_order_lineService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_order_lineMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -108,6 +108,55 @@ public class Purchase_reportResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取采购报表草稿", tags = {"采购报表" }, notes = "获取采购报表草稿")
@RequestMapping(method = RequestMethod.GET, value = "/purchase_reports/getdraft")
public ResponseEntity<Purchase_reportDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(purchase_reportMapping.toDto(purchase_reportService.getDraft(new Purchase_report())));
}
@ApiOperation(value = "检查采购报表", tags = {"采购报表" }, notes = "检查采购报表")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_reports/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody Purchase_reportDTO purchase_reportdto) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_reportService.checkKey(purchase_reportMapping.toDomain(purchase_reportdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_report-Save-all')")
@ApiOperation(value = "保存采购报表", tags = {"采购报表" }, notes = "保存采购报表")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_reports/save")
public ResponseEntity<Boolean> save(@RequestBody Purchase_reportDTO purchase_reportdto) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_reportService.save(purchase_reportMapping.toDomain(purchase_reportdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_report-Save-all')")
@ApiOperation(value = "批量保存采购报表", tags = {"采购报表" }, notes = "批量保存采购报表")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_reports/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<Purchase_reportDTO> purchase_reportdtos) {
purchase_reportService.saveBatch(purchase_reportMapping.toDomain(purchase_reportdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_report-searchDefault-all')")
@ApiOperation(value = "获取数据集", tags = {"采购报表" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/purchase_reports/fetchdefault")
public ResponseEntity<List<Purchase_reportDTO>> fetchDefault(Purchase_reportSearchContext context) {
Page<Purchase_report> domains = purchase_reportService.searchDefault(context) ;
List<Purchase_reportDTO> list = purchase_reportMapping.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-Purchase_report-searchDefault-all')")
@ApiOperation(value = "查询数据集", tags = {"采购报表" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/purchase_reports/searchdefault")
public ResponseEntity<Page<Purchase_reportDTO>> searchDefault(@RequestBody Purchase_reportSearchContext context) {
Page<Purchase_report> domains = purchase_reportService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_reportMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册