Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz商业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz商业套件
iBiz商业中心
提交
41a5efaa
提交
41a5efaa
编写于
10月 27, 2020
作者:
misaka
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
fd39ecc2
变更
1
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
14 行增加
和
11 行删除
+14
-11
Purchase_requisitionExService.java
...ore/extensions/service/Purchase_requisitionExService.java
+14
-11
未找到文件。
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/extensions/service/Purchase_requisitionExService.java
浏览文件 @
41a5efaa
...
@@ -9,6 +9,7 @@ import cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order;
...
@@ -9,6 +9,7 @@ import cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order;
import
cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition_line
;
import
cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition_line
;
import
cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition_type
;
import
cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition_type
;
import
cn.ibizlab.businesscentral.core.odoo_purchase.service.impl.Purchase_requisitionServiceImpl
;
import
cn.ibizlab.businesscentral.core.odoo_purchase.service.impl.Purchase_requisitionServiceImpl
;
import
cn.ibizlab.businesscentral.util.dict.StaticDict
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition
;
import
cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition
;
...
@@ -69,7 +70,7 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
...
@@ -69,7 +70,7 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
}
}
log
.
warn
(
"purchase_order"
);
log
.
warn
(
"purchase_order"
);
et
.
setState
(
"cancel"
);
et
.
setState
(
StaticDict
.
PURCHASE_REQUISITION__STATE
.
CANCEL
.
getValue
()
);
this
.
update
(
et
);
this
.
update
(
et
);
return
super
.
action_cancel
(
et
);
return
super
.
action_cancel
(
et
);
}
}
...
@@ -85,7 +86,8 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
...
@@ -85,7 +86,8 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
public
Purchase_requisition
action_done
(
Purchase_requisition
et
)
{
public
Purchase_requisition
action_done
(
Purchase_requisition
et
)
{
List
<
Purchase_order
>
orders
=
purchaseOrderService
.
selectByRequisitionId
(
et
.
getId
());
List
<
Purchase_order
>
orders
=
purchaseOrderService
.
selectByRequisitionId
(
et
.
getId
());
for
(
Purchase_order
order:
orders
)
{
for
(
Purchase_order
order:
orders
)
{
if
(
StringUtils
.
compare
(
order
.
getState
(),
"draft"
)==
0
||
StringUtils
.
compare
(
order
.
getState
(),
"sent"
)==
0
||
StringUtils
.
compare
(
order
.
getState
(),
"to approve"
)==
0
){
if
(
StringUtils
.
compare
(
order
.
getState
(),
StaticDict
.
PURCHASE_ORDER__STATE
.
DRAFT
.
getValue
())==
0
||
StringUtils
.
compare
(
order
.
getState
(),
StaticDict
.
PURCHASE_ORDER__STATE
.
SENT
.
getValue
()
)==
0
||
StringUtils
.
compare
(
order
.
getState
(),
StaticDict
.
PURCHASE_ORDER__STATE
.
TO_APPROVE
.
getValue
())==
0
){
throw
new
RuntimeException
(
"关闭采购申请单前,你必须取消或批准每个RFQ采购订单。"
)
;
throw
new
RuntimeException
(
"关闭采购申请单前,你必须取消或批准每个RFQ采购订单。"
)
;
}
}
}
}
...
@@ -100,7 +102,7 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
...
@@ -100,7 +102,7 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
}
}
log
.
warn
(
"移除 line 关联 supplierinfo"
);
log
.
warn
(
"移除 line 关联 supplierinfo"
);
et
.
setState
(
"done"
);
et
.
setState
(
StaticDict
.
PURCHASE_REQUISITION__STATE
.
DONE
.
getValue
()
);
this
.
update
(
et
);
this
.
update
(
et
);
return
super
.
action_done
(
et
);
return
super
.
action_done
(
et
);
}
}
...
@@ -115,7 +117,7 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
...
@@ -115,7 +117,7 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
@Transactional
@Transactional
public
Purchase_requisition
action_draft
(
Purchase_requisition
et
)
{
public
Purchase_requisition
action_draft
(
Purchase_requisition
et
)
{
et
.
setName
(
"New"
);
et
.
setName
(
"New"
);
et
.
setState
(
"draft"
);
et
.
setState
(
StaticDict
.
PURCHASE_REQUISITION__STATE
.
DRAFT
.
getValue
()
);
this
.
update
(
et
);
this
.
update
(
et
);
return
super
.
action_draft
(
et
);
return
super
.
action_draft
(
et
);
}
}
...
@@ -134,7 +136,7 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
...
@@ -134,7 +136,7 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
if
(
lines
.
size
()
==
0
)
{
if
(
lines
.
size
()
==
0
)
{
throw
new
RuntimeException
(
String
.
format
(
"没有明细行,无法确认此申请单 '%s'"
,
et
.
getName
()));
throw
new
RuntimeException
(
String
.
format
(
"没有明细行,无法确认此申请单 '%s'"
,
et
.
getName
()));
}
}
if
(
StringUtils
.
compare
(
et
.
getQuantityCopy
(),
"none"
)
==
0
&&
et
.
getVendorId
()
!=
null
)
{
if
(
StringUtils
.
compare
(
et
.
getQuantityCopy
(),
StaticDict
.
PURCHASE_REQUISITION_TYPE__QUANTITY_COPY
.
NONE
.
getValue
()
)
==
0
&&
et
.
getVendorId
()
!=
null
)
{
for
(
Purchase_requisition_line
line
:
lines
)
{
for
(
Purchase_requisition_line
line
:
lines
)
{
if
(
line
.
getPriceUnit
()
<=
0
)
{
if
(
line
.
getPriceUnit
()
<=
0
)
{
throw
new
RuntimeException
(
"你无法确认没有单价的单一供应商采购申请单。"
);
throw
new
RuntimeException
(
"你无法确认没有单价的单一供应商采购申请单。"
);
...
@@ -147,7 +149,7 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
...
@@ -147,7 +149,7 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
// 向product_supplierinfo表中添加供应商价格记录,在action_done行为时将这些记录删除
// 向product_supplierinfo表中添加供应商价格记录,在action_done行为时将这些记录删除
Purchase_requisition
purchaseRequisition
=
this
.
baseMapper
.
selectById
(
line
.
getRequisitionId
());
Purchase_requisition
purchaseRequisition
=
this
.
baseMapper
.
selectById
(
line
.
getRequisitionId
());
Purchase_requisition_type
requisitionType
=
purchaseRequisitionTypeService
.
get
(
purchaseRequisition
.
getTypeId
());
Purchase_requisition_type
requisitionType
=
purchaseRequisitionTypeService
.
get
(
purchaseRequisition
.
getTypeId
());
if
(
StringUtils
.
compare
(
requisitionType
.
getQuantityCopy
(),
"none"
)
==
0
&&
purchaseRequisition
.
getVendorId
()
!=
null
){
if
(
StringUtils
.
compare
(
requisitionType
.
getQuantityCopy
(),
StaticDict
.
PURCHASE_REQUISITION_TYPE__QUANTITY_COPY
.
NONE
.
getValue
()
)
==
0
&&
purchaseRequisition
.
getVendorId
()
!=
null
){
Product_supplierinfo
supplierinfo
=
new
Product_supplierinfo
();
Product_supplierinfo
supplierinfo
=
new
Product_supplierinfo
();
supplierinfo
.
setName
(
purchaseRequisition
.
getVendorId
());
supplierinfo
.
setName
(
purchaseRequisition
.
getVendorId
());
supplierinfo
.
setProductId
(
line
.
getProductId
());
supplierinfo
.
setProductId
(
line
.
getProductId
());
...
@@ -163,13 +165,13 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
...
@@ -163,13 +165,13 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
}
}
log
.
warn
(
"关联 create_supplier_info"
);
log
.
warn
(
"关联 create_supplier_info"
);
}
}
et
.
setState
(
"ongoing"
);
et
.
setState
(
StaticDict
.
PURCHASE_REQUISITION__STATE
.
ONGOING
.
getValue
()
);
}
else
{
}
else
{
et
.
setState
(
"in_progress"
);
et
.
setState
(
StaticDict
.
PURCHASE_REQUISITION__STATE
.
IN_PROGRESS
.
getValue
()
);
}
}
if
(
StringUtils
.
compare
(
et
.
getName
(),
"New"
)
==
0
)
{
if
(
StringUtils
.
compare
(
et
.
getName
(),
"New"
)
==
0
)
{
Ir_sequence
sequence
=
new
Ir_sequence
();
Ir_sequence
sequence
=
new
Ir_sequence
();
if
(
StringUtils
.
compare
(
et
.
getQuantityCopy
(),
"none"
)
!=
0
)
{
if
(
StringUtils
.
compare
(
et
.
getQuantityCopy
(),
StaticDict
.
PURCHASE_REQUISITION_TYPE__QUANTITY_COPY
.
NONE
.
getValue
()
)
!=
0
)
{
sequence
.
setCode
(
"purchase.requisition.purchase.tender"
);
sequence
.
setCode
(
"purchase.requisition.purchase.tender"
);
}
else
{
}
else
{
sequence
.
setCode
(
"purchase.requisition.blanket.order"
);
sequence
.
setCode
(
"purchase.requisition.blanket.order"
);
...
@@ -198,7 +200,8 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
...
@@ -198,7 +200,8 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
@Override
@Override
public
boolean
remove
(
Long
key
)
{
public
boolean
remove
(
Long
key
)
{
Purchase_requisition
et
=
this
.
get
(
key
);
Purchase_requisition
et
=
this
.
get
(
key
);
if
(
StringUtils
.
compare
(
et
.
getState
(),
"draft"
)!=
0
||
StringUtils
.
compare
(
et
.
getState
(),
"cancel"
)!=
0
){
if
(
StringUtils
.
compare
(
et
.
getState
(),
StaticDict
.
PURCHASE_REQUISITION__STATE
.
DRAFT
.
getValue
())!=
0
||
StringUtils
.
compare
(
et
.
getState
(),
StaticDict
.
PURCHASE_REQUISITION__STATE
.
CANCEL
.
getValue
())!=
0
){
throw
new
RuntimeException
(
"你只能删除草稿申请单。"
);
throw
new
RuntimeException
(
"你只能删除草稿申请单。"
);
}
}
purchaseRequisitionLineService
.
removeByRequisitionId
(
key
);
purchaseRequisitionLineService
.
removeByRequisitionId
(
key
);
...
@@ -217,7 +220,7 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
...
@@ -217,7 +220,7 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
et
=
this
.
get
(
et
.
getId
());
et
=
this
.
get
(
et
.
getId
());
//采购订单
//采购订单
if
(
StringUtils
.
compare
(
et
.
getState
(),
"draft"
)
==
0
)
{
if
(
StringUtils
.
compare
(
et
.
getState
(),
StaticDict
.
PURCHASE_REQUISITION__STATE
.
DRAFT
.
getValue
()
)
==
0
)
{
et
.
setOrderCount
(
0
);
et
.
setOrderCount
(
0
);
}
else
{
}
else
{
Purchase_order
order
=
new
Purchase_order
();
Purchase_order
order
=
new
Purchase_order
();
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录