Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz商业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz商业套件
iBiz商业中心
提交
810a00ea
提交
810a00ea
编写于
10月 23, 2020
作者:
yujiaming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
自定义Purchase_order的button_cancel,button_done, button_unlock行为
上级
cd7c83e8
变更
1
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
114 行增加
和
0 行删除
+114
-0
Purchase_orderExService.java
...tral/core/extensions/service/Purchase_orderExService.java
+114
-0
未找到文件。
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/extensions/service/Purchase_orderExService.java
浏览文件 @
810a00ea
package
cn
.
ibizlab
.
businesscentral
.
core
.
extensions
.
service
;
package
cn
.
ibizlab
.
businesscentral
.
core
.
extensions
.
service
;
import
cn.ibizlab.businesscentral.core.odoo_account.domain.Account_move
;
import
cn.ibizlab.businesscentral.core.odoo_account.service.impl.Account_moveServiceImpl
;
import
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_currency
;
import
cn.ibizlab.businesscentral.core.odoo_base.domain.Res_partner
;
import
cn.ibizlab.businesscentral.core.odoo_base.service.impl.Res_partnerServiceImpl
;
import
cn.ibizlab.businesscentral.core.odoo_product.domain.Product_product
;
import
cn.ibizlab.businesscentral.core.odoo_product.domain.Product_supplierinfo
;
import
cn.ibizlab.businesscentral.core.odoo_product.domain.Product_template
;
import
cn.ibizlab.businesscentral.core.odoo_product.service.impl.Product_productServiceImpl
;
import
cn.ibizlab.businesscentral.core.odoo_product.service.impl.Product_templateServiceImpl
;
import
cn.ibizlab.businesscentral.core.odoo_purchase.domain.Account_move_purchase_order_rel
;
import
cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order_line
;
import
cn.ibizlab.businesscentral.core.odoo_purchase.service.impl.Purchase_orderServiceImpl
;
import
cn.ibizlab.businesscentral.core.odoo_purchase.service.impl.Purchase_orderServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order
;
import
cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.context.annotation.Primary
;
...
@@ -16,6 +30,20 @@ import java.util.*;
...
@@ -16,6 +30,20 @@ import java.util.*;
@Service
(
"Purchase_orderExService"
)
@Service
(
"Purchase_orderExService"
)
public
class
Purchase_orderExService
extends
Purchase_orderServiceImpl
{
public
class
Purchase_orderExService
extends
Purchase_orderServiceImpl
{
@Autowired
Account_moveServiceImpl
accountMoveService
;
@Autowired
Product_productServiceImpl
productService
;
@Autowired
Product_templateServiceImpl
productTemplateService
;
@Autowired
Res_partnerServiceImpl
partnerService
;
@Override
@Override
protected
Class
currentModelClass
()
{
protected
Class
currentModelClass
()
{
return
com
.
baomidou
.
mybatisplus
.
core
.
toolkit
.
ReflectionKit
.
getSuperClassGenericType
(
this
.
getClass
().
getSuperclass
(),
1
);
return
com
.
baomidou
.
mybatisplus
.
core
.
toolkit
.
ReflectionKit
.
getSuperClassGenericType
(
this
.
getClass
().
getSuperclass
(),
1
);
...
@@ -29,6 +57,21 @@ public class Purchase_orderExService extends Purchase_orderServiceImpl {
...
@@ -29,6 +57,21 @@ public class Purchase_orderExService extends Purchase_orderServiceImpl {
@Override
@Override
@Transactional
@Transactional
public
Purchase_order
button_cancel
(
Purchase_order
et
)
{
public
Purchase_order
button_cancel
(
Purchase_order
et
)
{
// 获取凭证录入的ID组
List
<
Account_move_purchase_order_rel
>
accountMovePurchaseOrderRels
=
accountMovePurchaseOrderRelService
.
selectByPurchaseOrderId
(
et
.
getId
());
List
<
String
>
accountMoveIds
=
new
ArrayList
();
for
(
Account_move_purchase_order_rel
accountMovePurchaseOrderRel
:
accountMovePurchaseOrderRels
){
accountMoveIds
.
add
(
accountMovePurchaseOrderRel
.
getAccountMoveId
().
toString
());
}
// 通过凭证录入的ID获取对应的凭证记录
List
<
Account_move
>
accountMoves
=
accountMoveService
.
getAccountMoveByIds
(
accountMoveIds
);
for
(
Account_move
accountMove
:
accountMoves
){
if
(
StringUtils
.
compare
(
accountMove
.
getState
(),
"cancel"
)==
0
||
StringUtils
.
compare
(
accountMove
.
getState
(),
"draft"
)==
0
){
throw
new
RuntimeException
(
"无法取消此采购订单。 您必须先取消相关的供应商账单。"
)
;
}
}
et
.
setState
(
"cancel"
);
this
.
update
(
et
);
return
super
.
button_cancel
(
et
);
return
super
.
button_cancel
(
et
);
}
}
/**
/**
...
@@ -39,6 +82,63 @@ public class Purchase_orderExService extends Purchase_orderServiceImpl {
...
@@ -39,6 +82,63 @@ public class Purchase_orderExService extends Purchase_orderServiceImpl {
@Override
@Override
@Transactional
@Transactional
public
Purchase_order
button_confirm
(
Purchase_order
et
)
{
public
Purchase_order
button_confirm
(
Purchase_order
et
)
{
// if(StringUtils.compare(et.getState(), "draft") == 0 || StringUtils.compare(et.getState(), "sent") == 0){
// // 链接_add_supplier_to_product()
// List<Purchase_order_line> lines = purchaseOrderLineService.selectByOrderId(et.getId());
// for(Purchase_order_line line : lines){
// // 联系人partner
// Res_partner partner = partnerService.get(et.getPartnerId());
//
// // 获取Product_product的供应商
// Product_product product = productService.getById(et.getProductId());
// if(line.getProductId() != null && ("") &&product.getSellerIds().length() <= 10){
// // 币种currency
// Res_currency toCurrency = new Res_currency();
// if(partner.getPropertyPurchaseCurrencyId() !=null && et.getCurrencyId() != null){
// toCurrency = resCurrencyService.getById(partner.getPropertyPurchaseCurrencyId());
// }else if(partner.getPropertyPurchaseCurrencyId() !=null && et.getCurrencyId() == null){
// toCurrency = resCurrencyService.getById(partner.getPropertyPurchaseCurrencyId());
// }else if(partner.getPropertyPurchaseCurrencyId() ==null && et.getCurrencyId() != null){
// toCurrency = resCurrencyService.getById(partner.getPropertyPurchaseCurrencyId());
// }
// // 价格price, 将价格转换成当前所用币种
// Double price = 0.0;
// if(et.getCurrencyId() == toCurrency.getId()){
// price = line.getPriceUnit();
// }else{
//// price = line.getPriceUnit() *
// }
//
// //
// Product_template productTemplate = productTemplateService.get(product.getProductTmplId());
// if(productTemplate.getUomPoId() != line.getProductUom()){
// Long default_uom = productTemplate.getUomPoId();
// // 计算price
// }
//
// // 创建供应商价格表记录
// Product_supplierinfo supplierinfo = new Product_supplierinfo();
// supplierinfo.setName(partner.getId());
// supplierinfo.setSequence();
// supplierinfo.setMinQty(0.0);
// supplierinfo.setPrice(price);
// supplierinfo.setCurrencyId(toCurrency.getId());
// supplierinfo.setDelay(0);
//
// // 按条件查找供应商
//
//
// }
// }
// log.warn("_add_supplier_to_product()");
//// if(StringUtils.compare(, "one_step") == 0 || ){
//// // button_approve()
//// log.warn("button_approve()");
//// }else{
//// et.setState("to approve");
//// }
// }
// this.update(et);
return
super
.
button_confirm
(
et
);
return
super
.
button_confirm
(
et
);
}
}
/**
/**
...
@@ -49,6 +149,9 @@ public class Purchase_orderExService extends Purchase_orderServiceImpl {
...
@@ -49,6 +149,9 @@ public class Purchase_orderExService extends Purchase_orderServiceImpl {
@Override
@Override
@Transactional
@Transactional
public
Purchase_order
button_done
(
Purchase_order
et
)
{
public
Purchase_order
button_done
(
Purchase_order
et
)
{
// 改变采购订单的状态为锁定
et
.
setState
(
"done"
);
this
.
update
(
et
);
return
super
.
button_done
(
et
);
return
super
.
button_done
(
et
);
}
}
/**
/**
...
@@ -59,6 +162,9 @@ public class Purchase_orderExService extends Purchase_orderServiceImpl {
...
@@ -59,6 +162,9 @@ public class Purchase_orderExService extends Purchase_orderServiceImpl {
@Override
@Override
@Transactional
@Transactional
public
Purchase_order
button_unlock
(
Purchase_order
et
)
{
public
Purchase_order
button_unlock
(
Purchase_order
et
)
{
// 改变采购订单的状态为解锁
et
.
setState
(
"purchase"
);
this
.
update
(
et
);
return
super
.
button_unlock
(
et
);
return
super
.
button_unlock
(
et
);
}
}
/**
/**
...
@@ -69,6 +175,14 @@ public class Purchase_orderExService extends Purchase_orderServiceImpl {
...
@@ -69,6 +175,14 @@ public class Purchase_orderExService extends Purchase_orderServiceImpl {
@Override
@Override
@Transactional
@Transactional
public
Purchase_order
get_name
(
Purchase_order
et
)
{
public
Purchase_order
get_name
(
Purchase_order
et
)
{
//
// String name = et.getName();
// if(et.getPartnerRef() != null){
// name += " (" + et.getPartnerRef() + ")";
// }
// if( && et.getAmountTotal() != null){
// name += ": " +
// }
return
super
.
get_name
(
et
);
return
super
.
get_name
(
et
);
}
}
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录