Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
EIP-Integration
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
李炎
EIP-Integration
Commits
b1c551f5
提交
b1c551f5
authored
10月 18, 2021
作者:
许俊
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改排产计划,从生产汇报单据获得数据改成从生产订单获取数据
上级
f108ca55
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
42 行增加
和
38 行删除
+42
-38
ProductionSchedulingServiceImpl.java
...ost/API/service/impl/ProductionSchedulingServiceImpl.java
+7
-5
ProductionSchedulingWebapi.java
...g/modules/iost/API/webapi/ProductionSchedulingWebapi.java
+35
-33
没有找到文件。
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/service/impl/ProductionSchedulingServiceImpl.java
浏览文件 @
b1c551f5
package
org
.
jeecg
.
modules
.
iost
.
API
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
net.sf.json.JSONObject
;
...
...
@@ -171,11 +172,12 @@ public class ProductionSchedulingServiceImpl extends ServiceImpl<ProductionSched
/*明细实体类信息保存*/
public
void
pojosave
(
Map
<
String
,
String
>
stringStringMap
,
ArrayList
<
Productionscheduling
>
productionschedulings
)
{
Productionscheduling
p
=
new
Productionscheduling
();
p
.
setPurchaserhqcode
(
stringStringMap
.
get
(
"purchaserhqcode"
));
/* Productionscheduling p = new Productionscheduling();*/
Productionscheduling
productionscheduling
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
stringStringMap
),
Productionscheduling
.
class
);
//map转为实体类对象
/* p.setPurchaserhqcode(stringStringMap.get("purchaserhqcode"));
p.setSuppliercode(stringStringMap.get("suppliercode"));
p.setSuppliername(stringStringMap.get("suppliername"));
/* p.setPoitemid(Integer.valueOf(stringStringMap.get("poitemid")));*/
p.setPoitemid(Integer.valueOf(stringStringMap.get("poItemId")));
p.setSchedulecode(stringStringMap.get("schedulecode"));
p.setProvcocode(stringStringMap.get("provcocode"));
p.setProvconame(stringStringMap.get("provconame"));
...
...
@@ -194,7 +196,7 @@ public class ProductionSchedulingServiceImpl extends ServiceImpl<ProductionSched
p.setDatasourcecreatetime(stringStringMap.get("datasourcecreatetime"));
p.setOwnerid(stringStringMap.get("ownerid"));
p.setOpenid(stringStringMap.get("openid"));
p
.
setFid
(
stringStringMap
.
get
(
"fid"
));
productionschedulings
.
add
(
p
);
p.setFid(stringStringMap.get("fid"));
*/
productionschedulings
.
add
(
p
roductionscheduling
);
}
}
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/webapi/ProductionSchedulingWebapi.java
浏览文件 @
b1c551f5
...
...
@@ -7,10 +7,12 @@ import org.jeecg.modules.iost.API.Dao.CategoryDao;
import
org.jeecg.modules.iost.API.ExternalInterface.PurchaseorderApi
;
import
org.jeecg.modules.iost.API.Util.JsonUtil
;
import
org.jeecg.modules.iost.API.entity.Purchaseorder
;
import
org.jeecg.modules.iost.API.entity.pojo.Salesorder
;
import
org.jeecg.modules.iost.API.service.IPurchaseorderService
;
import
org.jeecg.modules.iost.API.webapi.Interface.web_api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
java.io.IOException
;
import
java.util.*
;
...
...
@@ -29,13 +31,20 @@ public class ProductionSchedulingWebapi implements web_api {
@Autowired
private
IPurchaseorderService
purchaseorderService
;
/**操作的单据体名称*/
private
String
sFormId
=
"PRD_MO
RPT
"
;
private
String
sFormId
=
"PRD_MO"
;
private
Map
<
String
,
String
>
key
=
new
LinkedHashMap
<>();
public
ProductionSchedulingWebapi
()
{
key
.
put
(
"FCreateDate"
,
"FCreateDate"
);
// 创建日期 index 0
key
.
put
(
"FID"
,
"FID"
);
//主键 index 1
key
.
put
(
"FMoId "
,
"FMoId "
);
//生产订单内码 index 2
key
.
put
(
"FSaleOrderId"
,
"FSaleOrderId"
);
//销售订单id index 2
key
.
put
(
"FBILLNO"
,
"FBILLNO"
);
//单据编码 index 3
key
.
put
(
"FMemoItem"
,
"FMemoItem"
);
//备注 index 4
key
.
put
(
"FPlanStartDate"
,
"FPlanStartDate"
);
// 计划开工时间 index 5
key
.
put
(
"FPlanFinishDate"
,
"FPlanFinishDate"
);
// 计划完工时间 index 6
key
.
put
(
"FStartDate"
,
"FStartDate"
);
// 开工日期 index 7
key
.
put
(
"FFinishDate"
,
"FFinishDate"
);
// 完工日期 index 8
}
...
...
@@ -80,44 +89,37 @@ public class ProductionSchedulingWebapi implements web_api {
*/
public
List
<
Map
<
String
,
String
>>
ProductionScheduling
(
List
<
List
<
Object
>>
list
){
List
<
Map
<
String
,
String
>>
ProductionSchedulinglist
=
new
ArrayList
<>();
if
(!
list
.
isEmpty
())
{
Map
<
String
,
String
>
fid
=
new
IdentityHashMap
<
String
,
String
>();
for
(
List
<
Object
>
list1
:
list
)
{
//获取生产订单id 拼接查询条件
fid
.
put
(
new
String
(
"fid = "
),
list1
.
get
(
2
).
toString
());
}
List
<
List
<
Object
>>
FSaleOrderIds
=
productionOrderWebapi
.
selectOr
(
fid
);
//查询关联生产订单
List
<
List
<
Object
>>
f
=
new
ArrayList
<>();
List
<
List
<
Object
>>
l
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
String
s
=
list
.
get
(
i
).
get
(
2
).
toString
();
label:
for
(
int
j
=
0
;
j
<
FSaleOrderIds
.
size
();
j
++)
{
if
(
s
.
equals
(
FSaleOrderIds
.
get
(
j
).
get
(
1
).
toString
()))
{
f
.
add
(
list
.
get
(
i
));
l
.
add
(
FSaleOrderIds
.
get
(
j
));
FSaleOrderIds
.
remove
(
j
);
break
label
;
}
if
(!
ObjectUtils
.
isEmpty
(
list
))
{
List
<
List
<
Object
>>
needSynLists
=
new
ArrayList
<>();
//需要转换同步的数据
for
(
List
<
Object
>
objects
:
list
)
{
Object
o
=
objects
.
get
(
2
);
//返回的list里面的销售订单id
//查看生产订单返回的销售订单Fid(销售订单Fid=采购订单Fid)是否在采购订单存在,存在说明此生产订单是由采购订单推下来的
QueryWrapper
<
Purchaseorder
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"F_Id"
,
String
.
valueOf
(
o
));
Integer
integer
=
purchaseorderService
.
getBaseMapper
().
selectCount
(
qw
);
if
(!
integer
.
equals
(
0
))
{
needSynLists
.
add
(
objects
);
}
}
int
i
=
0
;
for
(
List
<
Object
>
list1
:
f
)
{
for
(
List
<
Object
>
list1
:
needSynLists
)
{
Map
<
String
,
String
>
ProductionSchedulingmap
=
new
HashMap
<>();
QueryWrapper
<
Purchaseorder
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
select
(
"F_Id"
);
Object
SaleOrderId
=
l
.
get
(
i
++).
get
(
0
);
//销售订单id,可匹配过滤是否平台生成订单获取采购订单行项目号
queryWrapper
.
eq
(
"F_Id"
,
SaleOrderId
.
toString
());
//查询是否为集成平台生成的订单,并过滤
Purchaseorder
purchaseorders1
=
purchaseorderService
.
getBaseMapper
().
selectOne
(
queryWrapper
);
if
(
purchaseorders1
==
null
)
continue
;
ProductionSchedulingmap
.
put
(
"poItemId"
,
purchaseorders1
.
getPoItemId
());
//采购订单行项目id
Object
need
=
list1
.
get
(
2
);
//返回的list里面的销售订单id
QueryWrapper
<
Purchaseorder
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"F_Id"
,
String
.
valueOf
(
need
));
qw
.
select
(
"po_Item_Id"
);
Purchaseorder
purchaseorder
=
purchaseorderService
.
getBaseMapper
().
selectOne
(
qw
);
ProductionSchedulingmap
.
put
(
"poitemid"
,
purchaseorder
.
getPoItemId
());
//采购订单行项目id
ProductionSchedulingmap
.
put
(
"datasource"
,
"0"
);
//数据来源(固定写成0)
ProductionSchedulingmap
.
put
(
"purchaserhqcode"
,
"SGCC"
);
//采购方总部编码 SGCC
ProductionSchedulingmap
.
put
(
"datasourcecreatetime"
,
SubStringT
(
list1
.
get
(
0
).
toString
()));
//来源数据创建时间
ProductionSchedulingmap
.
put
(
"fid"
,
list1
.
get
(
1
).
toString
());
//实体主键 ,设置了后不能重复插入
ProductionSchedulingmap
.
put
(
"schedulecode"
,
list1
.
get
(
3
).
toString
());
//排产计划编码
ProductionSchedulingmap
.
put
(
"remark"
,
list1
.
get
(
4
).
toString
());
//备注
ProductionSchedulingmap
.
put
(
"planstartdate"
,
list1
.
get
(
5
).
toString
());
//计划开始日期
ProductionSchedulingmap
.
put
(
"planfinishdate"
,
list1
.
get
(
6
).
toString
());
//计划完成日期
ProductionSchedulingmap
.
put
(
"actualstartdate"
,
list1
.
get
(
7
).
toString
());
//实际开始日期
ProductionSchedulingmap
.
put
(
"actualfinishdate"
,
list1
.
get
(
8
).
toString
());
//实际完成日期
ProductionSchedulinglist
.
add
(
ProductionSchedulingmap
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论