Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-smart
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
platform
hp-smart
Commits
28666e0d
Commit
28666e0d
authored
Feb 06, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.fixBug:生产任务明细不重复新增
parent
b10c0f73
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
43 deletions
+78
-43
HPConstant.java
src/main/java/com/baosight/hpjx/hp/constant/HPConstant.java
+0
-2
HPSC003.java
src/main/java/com/baosight/hpjx/hp/sc/domain/HPSC003.java
+5
-5
ServiceHPSC002.java
.../java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002.java
+47
-35
ServiceHPSC003.java
.../java/com/baosight/hpjx/hp/sc/service/ServiceHPSC003.java
+1
-1
HPSCTools.java
src/main/java/com/baosight/hpjx/hp/sc/tools/HPSCTools.java
+25
-0
No files found.
src/main/java/com/baosight/hpjx/hp/constant/HPConstant.java
View file @
28666e0d
...
...
@@ -48,10 +48,8 @@ public class HPConstant {
public
static
final
String
OTHER_ENTER_NO
=
"OTHER_ENTER_NO"
;
// 其他出库单号
public
static
final
String
OTHER_OUTER_NO
=
"OTHER_OUTER_NO"
;
//生产计划单
public
static
final
String
HPSC003_PROD_NO
=
"HPSC003_PROD_NO"
;
//生产订单
public
static
final
String
HPSC005_PROD_NO
=
"HPSC005_PROD_NO"
;
//生产任务订单
...
...
src/main/java/com/baosight/hpjx/hp/sc/domain/HPSC003.java
View file @
28666e0d
...
...
@@ -64,11 +64,11 @@ public class HPSC003 extends DaoEPBase {
public
static
final
String
COL_REMARK
=
"REMARK"
;
/* 备注*/
public
static
final
String
COL_INVENT_RECORD_ID
=
"INVENT_RECORD_ID"
;
public
static
final
String
QUERY
=
"
t_hpsc
003.query"
;
public
static
final
String
COUNT
=
"
t_hpsc
003.count"
;
public
static
final
String
INSERT
=
"
t_hpsc
003.insert"
;
public
static
final
String
UPDATE
=
"
t_hpsc
003.update"
;
public
static
final
String
DELETE
=
"
t_hpsc
003.delete"
;
public
static
final
String
QUERY
=
"
HPSC
003.query"
;
public
static
final
String
COUNT
=
"
HPSC
003.count"
;
public
static
final
String
INSERT
=
"
HPSC
003.insert"
;
public
static
final
String
UPDATE
=
"
HPSC
003.update"
;
public
static
final
String
DELETE
=
"
HPSC
003.delete"
;
private
Long
id
=
new
Long
(
0
);
private
String
companyCode
=
" "
;
/* 企业编码 预留*/
...
...
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002.java
View file @
28666e0d
...
...
@@ -10,6 +10,7 @@ import com.baosight.hpjx.hp.sc.domain.HPSC003;
import
com.baosight.hpjx.hp.sc.domain.HPSC004
;
import
com.baosight.hpjx.hp.sc.domain.HPSC001
;
import
com.baosight.hpjx.hp.sc.domain.HPSC002
;
import
com.baosight.hpjx.hp.sc.tools.HPSCTools
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
...
...
@@ -20,6 +21,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import
com.baosight.iplat4j.core.util.NumberUtils
;
import
com.baosight.iplat4j.core.web.threadlocal.UserSession
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
java.math.BigDecimal
;
...
...
@@ -357,56 +359,66 @@ public class ServiceHPSC002 extends ServiceBase {
*/
public
void
autoPlanInfo
(
String
id
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
HPSC002
THPSC
002
=
(
HPSC002
)
dao
.
get
(
"HPSC002.queryEntityByParentPrtdCode"
,
"id"
,
id
);
HPSC002
dbSc
002
=
(
HPSC002
)
dao
.
get
(
"HPSC002.queryEntityByParentPrtdCode"
,
"id"
,
id
);
String
SCJHD
=
SequenceGenerator
.
getNextSequence
(
HPConstant
.
SequenceId
.
HPSC003_PROD_NO
);
//生成生产计划t_hpsc003
// 生成生产计划t_hpsc003,如果已存在就不新增
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"matId"
,
dbSc002
.
getId
());
List
<
HPSC003
>
dbSc003s
=
dao
.
query
(
HPSC003
.
QUERY
,
queryMap
);
if
(
CollectionUtils
.
isNotEmpty
(
dbSc003s
))
{
HPSC003
HPSC003
=
new
HPSC003
();
HPSC003
.
setCompanyCode
(
""
);
HPSC003
.
setProjType
(
null
);
HPSC003
.
setProjCode
(
THPSC
002
.
getProjCode
());
HPSC003
.
setProjName
(
THPSC
002
.
getProjName
());
HPSC003
.
setProjCode
(
dbSc
002
.
getProjCode
());
HPSC003
.
setProjName
(
dbSc
002
.
getProjName
());
HPSC003
.
setPlanInfoNo
(
SCJHD
);
HPSC003
.
setInventRecordId
(
THPSC
002
.
getInventRecordId
());
HPSC003
.
setPrdtType
(
THPSC
002
.
getPrdtType
());
HPSC003
.
setPrdtCode
(
THPSC
002
.
getPrdtCode
());
HPSC003
.
setPrdtName
(
THPSC
002
.
getPrdtName
());
HPSC003
.
setSpec
(
THPSC
002
.
getSpec
());
HPSC003
.
setLength
(
THPSC
002
.
getLength
());
HPSC003
.
setWidth
(
THPSC
002
.
getWidth
());
HPSC003
.
setThick
(
THPSC
002
.
getThick
());
HPSC003
.
setRemark
(
THPSC
002
.
getRemark
());
HPSC003
.
setInventRecordId
(
dbSc
002
.
getInventRecordId
());
HPSC003
.
setPrdtType
(
dbSc
002
.
getPrdtType
());
HPSC003
.
setPrdtCode
(
dbSc
002
.
getPrdtCode
());
HPSC003
.
setPrdtName
(
dbSc
002
.
getPrdtName
());
HPSC003
.
setSpec
(
dbSc
002
.
getSpec
());
HPSC003
.
setLength
(
dbSc
002
.
getLength
());
HPSC003
.
setWidth
(
dbSc
002
.
getWidth
());
HPSC003
.
setThick
(
dbSc
002
.
getThick
());
HPSC003
.
setRemark
(
dbSc
002
.
getRemark
());
HPSC003
.
setPlanCompletionDate
(
""
);
HPSC003
.
setStatus
(
0
);
HPSC003
.
setMatId
(
THPSC
002
.
getId
());
HPSC003
.
setMatId
(
dbSc
002
.
getId
());
DaoUtils
.
insert
(
"HPSC003.insert"
,
HPSC003
.
toMap
());
//生产计划详情
Map
queryMap
=
new
HashMap
();
}
//
生产计划详情
queryMap
=
new
HashMap
();
queryMap
.
put
(
"parentId"
,
id
);
List
<
HPSC002
>
rows
=
this
.
dao
.
query
(
"HPSC002.queryEntityByParentPrtdCode"
,
queryMap
);
for
(
int
i
=
0
;
i
<
rows
.
size
();
i
++)
{
HPSC002
HPSC002
=
rows
.
get
(
i
);
HPSC002
dbSc002Child
=
rows
.
get
(
i
);
// 明细已存在就不在新增
queryMap
=
new
HashMap
();
queryMap
.
put
(
"filePath1"
,
dbSc002Child
.
getId
());
List
<
HPSC004
>
dbSc004s
=
dao
.
query
(
HPSC004
.
QUERY
,
queryMap
);
if
(
CollectionUtils
.
isNotEmpty
(
dbSc004s
))
{
continue
;
}
HPSC004
HPSC004
=
new
HPSC004
();
HPSC004
.
setCompanyCode
(
""
);
HPSC004
.
setDeptCode
(
""
);
HPSC004
.
setProjCode
(
HPSC002
.
getProjCode
());
HPSC004
.
setProjName
(
HPSC002
.
getProjName
());
HPSC004
.
setProjCode
(
dbSc002Child
.
getProjCode
());
HPSC004
.
setProjName
(
dbSc002Child
.
getProjName
());
HPSC004
.
setParentId
(
SCJHD
);
HPSC004
.
setParentPrdtName
(
HPSC002
.
getParentPrdtName
());
HPSC004
.
setInventRecordId
(
HPSC002
.
getInventRecordId
());
HPSC004
.
setPrdtType
(
HPSC002
.
getPrdtType
());
HPSC004
.
setPrdtCode
(
HPSC002
.
getPrdtCode
());
HPSC004
.
setPrdtName
(
HPSC002
.
getPrdtName
());
HPSC004
.
setSpec
(
HPSC002
.
getSpec
());
HPSC004
.
setLength
(
HPSC002
.
getLength
());
HPSC004
.
setWidth
(
HPSC002
.
getWidth
());
HPSC004
.
setThick
(
HPSC002
.
getThick
());
HPSC004
.
setRemark
(
HPSC002
.
getRemark
());
HPSC004
.
setNum
(
HPSC002
.
getNum
());
HPSC004
.
setUnitWt
(
HPSC002
.
getUnitWt
());
HPSC004
.
setTotalWt
(
HPSC002
.
getTotalWt
());
HPSC004
.
setFilePath1
(
HPSC002
.
getId
().
toString
());
HPSC004
.
setParentPrdtName
(
dbSc002Child
.
getParentPrdtName
());
HPSC004
.
setInventRecordId
(
dbSc002Child
.
getInventRecordId
());
HPSC004
.
setPrdtType
(
dbSc002Child
.
getPrdtType
());
HPSC004
.
setPrdtCode
(
dbSc002Child
.
getPrdtCode
());
HPSC004
.
setPrdtName
(
dbSc002Child
.
getPrdtName
());
HPSC004
.
setSpec
(
dbSc002Child
.
getSpec
());
HPSC004
.
setLength
(
dbSc002Child
.
getLength
());
HPSC004
.
setWidth
(
dbSc002Child
.
getWidth
());
HPSC004
.
setThick
(
dbSc002Child
.
getThick
());
HPSC004
.
setRemark
(
dbSc002Child
.
getRemark
());
HPSC004
.
setNum
(
dbSc002Child
.
getNum
());
HPSC004
.
setUnitWt
(
dbSc002Child
.
getUnitWt
());
HPSC004
.
setTotalWt
(
dbSc002Child
.
getTotalWt
());
HPSC004
.
setFilePath1
(
dbSc002Child
.
getId
().
toString
());
HPSC004
.
setPlanCommentDate
(
""
);
HPSC004
.
setPlanCompletionDate
(
""
);
HPSC004
.
setActualCompletionNum
(
NumberUtils
.
toBigDecimal
(
0.00
));
...
...
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC003.java
View file @
28666e0d
...
...
@@ -227,7 +227,7 @@ public class ServiceHPSC003 extends ServiceBase {
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
HPSC004
HPSC004
=
(
HPSC004
)
list
.
get
(
i
);
HPSC005
HPSC005
=
new
HPSC005
();
String
SCDD
=
SequenceGenerator
.
getNextSequence
(
HPConstant
.
SequenceId
.
HPSC00
3
_PROD_NO
);
String
SCDD
=
SequenceGenerator
.
getNextSequence
(
HPConstant
.
SequenceId
.
HPSC00
5
_PROD_NO
);
HPSC005
.
setProjCode
(
HPSC003
.
getProjCode
());
HPSC005
.
setProjName
(
HPSC003
.
getProjName
());
HPSC005
.
setProductionOrderNo
(
SCDD
);
...
...
src/main/java/com/baosight/hpjx/hp/sc/tools/HPSCTools.java
View file @
28666e0d
...
...
@@ -10,6 +10,7 @@ import com.baosight.hpjx.hp.kc.domain.HPKC010;
import
com.baosight.hpjx.hp.pz.domain.HPPZ004
;
import
com.baosight.hpjx.hp.sc.domain.HPSC001
;
import
com.baosight.hpjx.hp.sc.domain.HPSC002
;
import
com.baosight.hpjx.hp.sc.domain.HPSC003
;
import
com.baosight.hpjx.hp.sc.domain.HPSC004
;
import
com.baosight.hpjx.hp.sc.domain.HPSC005
;
import
com.baosight.hpjx.hp.sc.domain.HPSC005A
;
...
...
@@ -146,6 +147,30 @@ public class HPSCTools {
}
/**
* HPSC003公共DAO定义
*
* @author:songx
* @date:2024/2/4,10:17
*/
public
static
class
HpSc003
{
/**
* 查询
*
* @param id
* @return
*/
public
static
HPSC003
get
(
Long
id
)
{
AssertUtils
.
isNull
(
id
,
"部件编码不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"id"
,
id
);
List
<
HPSC003
>
results
=
DaoBase
.
getInstance
().
query
(
HPSC003
.
QUERY
,
queryMap
);
AssertUtils
.
isNull
(
results
,
String
.
format
(
"物料ID[%s]信息不存在"
,
id
));
return
results
.
get
(
0
);
}
}
/**
* HPSC005公共DAO定义
*
* @author:songx
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment