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
8198a183
Commit
8198a183
authored
Aug 12, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-06-12
parent
6b3c468b
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
184 additions
and
19 deletions
+184
-19
DocRouteEnum.java
src/main/java/com/baosight/hpjx/common/DocRouteEnum.java
+3
-1
HPConstant.java
src/main/java/com/baosight/hpjx/hp/constant/HPConstant.java
+2
-0
HPSqlConstant.java
...ain/java/com/baosight/hpjx/hp/constant/HPSqlConstant.java
+2
-0
HPSC005.java
src/main/java/com/baosight/hpjx/hp/sc/domain/HPSC005.java
+2
-2
HPSC003.xml
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC003.xml
+4
-2
HPSC005B.xml
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC005B.xml
+1
-0
HPSCTools.java
src/main/java/com/baosight/hpjx/hp/sc/tools/HPSCTools.java
+153
-13
HPXSTools.java
src/main/java/com/baosight/hpjx/hp/xs/tools/HPXSTools.java
+16
-0
SecurityUserStandardImpl.java
.../baosight/xservices/xs/impl/SecurityUserStandardImpl.java
+1
-1
HPSC102_物料清单.xls
src/main/webapp/HP/template/SC/HPSC102_物料清单.xls
+0
-0
HPSC102_物料清单_部件.xls
src/main/webapp/HP/template/SC/HPSC102_物料清单_部件.xls
+0
-0
HPSC102_物料清单_零件.xls
src/main/webapp/HP/template/SC/HPSC102_物料清单_零件.xls
+0
-0
No files found.
src/main/java/com/baosight/hpjx/common/DocRouteEnum.java
View file @
8198a183
...
...
@@ -3,6 +3,7 @@ package com.baosight.hpjx.common;
import
com.baosight.hpjx.hp.sc.domain.HPSC002
;
import
com.baosight.hpjx.hp.sc.domain.HPSC006
;
import
com.baosight.hpjx.hp.sc.domain.HPSC102
;
/**
* @author:songx
...
...
@@ -11,7 +12,8 @@ import com.baosight.hpjx.hp.sc.domain.HPSC006;
public
enum
DocRouteEnum
{
HPSC002
(
"route_001"
,
"HPSC002"
,
"importData"
,
HPSC002
.
class
),
HPSC006
(
"route_002"
,
"HPSC006"
,
"importData"
,
HPSC006
.
class
);
HPSC006
(
"route_002"
,
"HPSC006"
,
"importData"
,
HPSC006
.
class
),
HPSC102
(
"route_003"
,
"HPSC102"
,
"importData"
,
HPSC102
.
class
),;
private
String
id
;
private
String
serviceNme
;
private
String
methodName
;
...
...
src/main/java/com/baosight/hpjx/hp/constant/HPConstant.java
View file @
8198a183
...
...
@@ -72,6 +72,8 @@ public class HPConstant {
public
static
final
String
PRO_PLAN_NO
=
"PRO_PLAN_NO"
;
//采购订单单号
public
static
final
String
PRO_ORDER_NO
=
"PRO_ORDER_NO"
;
public
static
final
String
HGSC008_WORK_CODE
=
"WORK_CODE"
;
}
/**
...
...
src/main/java/com/baosight/hpjx/hp/constant/HPSqlConstant.java
View file @
8198a183
...
...
@@ -352,6 +352,8 @@ public class HPSqlConstant {
public
static
final
String
LOCK
=
"HPSC005.lock"
;
// 查询
public
static
final
String
UPDATE_ASSIGN_NUM
=
"HPSC005.updateAssignNum"
;
// 修改完成重量
public
static
final
String
UPDATE_ASSIGN_WT
=
"HPSC005.updateAssignWt"
;
public
static
final
String
DELETE_BY_MAT
=
"HPSC005.deleteByMat"
;
...
...
src/main/java/com/baosight/hpjx/hp/sc/domain/HPSC005.java
View file @
8198a183
...
...
@@ -170,8 +170,8 @@ public class HPSC005 extends DaoEPBase {
private
String
updatedBy
=
" "
;
/* 更新人*/
private
String
updatedName
=
" "
;
/* 更新人名称*/
private
String
updatedTime
=
" "
;
/* 更新时间*/
private
String
filePath1
=
" "
;
/*
文件地址1
*/
private
String
filePath2
=
" "
;
/*
文件地址2
*/
private
String
filePath1
=
" "
;
/*
物料清单ID
*/
private
String
filePath2
=
" "
;
/*
剩余重量
*/
private
String
filePath3
=
" "
;
/* 文件地址3*/
private
String
filePath4
=
" "
;
/* 文件地址4*/
private
String
filePath5
=
" "
;
/* 文件地址5*/
...
...
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC003.xml
View file @
8198a183
...
...
@@ -165,8 +165,10 @@
)
VALUES (#id#, #companyCode#, #projType#, #projCode#, #projName#, #planInfoNo#,#inventRecordId#,
#spec#, #length#, #width#, #thick#, #prdtType#, #prdtCode#, #prdtName#, #planCompletionDate#, #status#,
#createdBy#,
#createdTime#, #updatedBy#, #updatedTime#, #depCode#, #remark#,#matId#, #deliveryDate#,#factoryCode#)
#createdBy#, #createdTime#, #updatedBy#, #updatedTime#, #depCode#, #remark#,#matId#, #deliveryDate#,#factoryCode#)
<selectKey
resultClass=
"java.lang.Long"
keyProperty=
"id"
>
SELECT MAX(ID) FROM ${hpjxSchema}.T_HPSC003
</selectKey>
</insert>
<delete
id=
"delete"
>
...
...
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC005B.xml
View file @
8198a183
...
...
@@ -10,6 +10,7 @@
A.PRDT_CODE as "prdtCode",
<!-- 部件编码 -->
A.PRDT_NAME as "prdtName",
<!-- 部件名称 -->
A.PRDT_SPEC as "prdtSpec",
A.PART_TYPE as "partType",
A.PART_CODE as "partCode",
A.PART_NAME as "partName",
A.PART_SPEC as "partSpec",
...
...
src/main/java/com/baosight/hpjx/hp/sc/tools/HPSCTools.java
View file @
8198a183
package
com
.
baosight
.
hpjx
.
hp
.
sc
.
tools
;
import
com.baosight.hpjx.core.constant.CommonConstant
;
import
com.baosight.hpjx.core.dao.DaoBase
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.core.security.UserSessionUtils
;
import
com.baosight.hpjx.core.utils.QrCodeUtils
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.constant.HPSqlConstant
;
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
;
import
com.baosight.hpjx.hp.sc.domain.HPSC005B
;
import
com.baosight.hpjx.hp.sc.domain.HPSC005C
;
import
com.baosight.hpjx.hp.sc.domain.HPSC006
;
import
com.baosight.hpjx.hp.sc.domain.HPSC007
;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.DateUtils
;
import
com.baosight.hpjx.util.StringUtils
;
import
com.baosight.hpjx.hp.sc.domain.*
;
import
com.baosight.hpjx.util.*
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext
;
import
com.baosight.iplat4j.core.util.NumberUtils
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.MapUtils
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -75,6 +72,48 @@ public class HPSCTools {
}
/**
* 拆单重量校正
*
* @param prodOrderNo 生产订单号
* @param wt 分派重量
*/
public
static
void
checkAssignedWt
(
String
prodOrderNo
,
BigDecimal
wt
)
{
// 生产订单
HPSC005
dbSc005
=
HPSCTools
.
HpSc005
.
get
(
prodOrderNo
);
BigDecimal
jhWt
=
dbSc005
.
getTotalWt
();
// 子单
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"prodOrderNo"
,
prodOrderNo
);
List
<
HPSC005A
>
dbSc005as
=
DaoBase
.
getInstance
().
query
(
HPSC005A
.
QUERY
,
queryMap
,
0
,
-
999999
);
BigDecimal
totalWt
=
wt
;
// 总重量
if
(
CollectionUtils
.
isNotEmpty
(
dbSc005as
))
{
for
(
HPSC005A
dbSc005a
:
dbSc005as
)
{
totalWt
=
totalWt
.
add
(
dbSc005a
.
getTotalWt
());
}
}
// 判断重量是否超过订单重量
AssertUtils
.
isGt
(
totalWt
,
jhWt
,
"拆单的分派重量不能大于计划重量!"
);
BigDecimal
unassignedNum
=
jhWt
.
subtract
(
totalWt
).
divide
(
jhWt
,
4
,
RoundingMode
.
HALF_UP
).
multiply
(
new
BigDecimal
(
100
));
BigDecimal
assignedNum
=
new
BigDecimal
(
100
).
subtract
(
unassignedNum
);
Map
updateMap
=
new
HashMap
();
updateMap
.
put
(
"id"
,
dbSc005
.
getId
());
updateMap
.
put
(
"assignedNum"
,
unassignedNum
.
compareTo
(
new
BigDecimal
(
0
))
==
0
?
new
BigDecimal
(
100
)
:
assignedNum
);
updateMap
.
put
(
"unassignedNum"
,
unassignedNum
.
compareTo
(
new
BigDecimal
(
0
))
==
0
?
new
BigDecimal
(
0
)
:
unassignedNum
);
// 0.未派工,1.部分派工,2.全部派工
if
(
jhWt
.
subtract
(
totalWt
).
compareTo
(
BigDecimal
.
ZERO
)==
0
)
{
updateMap
.
put
(
"workDate"
,
DateUtils
.
shortDate
());
updateMap
.
put
(
"status"
,
2
);
}
else
if
(
totalWt
.
compareTo
(
BigDecimal
.
ZERO
)
==
1
)
{
updateMap
.
put
(
"workDate"
,
DateUtils
.
shortDate
());
updateMap
.
put
(
"status"
,
1
);
}
else
{
updateMap
.
put
(
"workDate"
,
""
);
updateMap
.
put
(
"status"
,
0
);
}
DaoUtils
.
update
(
HPSqlConstant
.
HPSC005
.
UPDATE_ASSIGN_NUM
,
updateMap
);
}
/**
* 拆单数量校正(部分派单)
*
* @param prodOrderNo 生产订单号
...
...
@@ -107,6 +146,39 @@ public class HPSCTools {
}
/**
* 拆单数量校正(部分派单)
*
* @param prodOrderNo 生产订单号
* @param wt 剩余重量
*/
public
static
void
checkAssignedWt2
(
String
prodOrderNo
,
BigDecimal
wt
)
{
// 生产订单
HPSC005
dbSc005
=
HPSCTools
.
HpSc005
.
get
(
prodOrderNo
);
BigDecimal
jhWt
=
dbSc005
.
getTotalWt
();
//生产订单总量
// 子单
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"prodOrderNo"
,
prodOrderNo
);
List
<
HPSC005A
>
dbSc005as
=
DaoBase
.
getInstance
().
query
(
HPSC005A
.
QUERY
,
queryMap
,
0
,
-
999999
);
BigDecimal
totalWt
=
wt
;
if
(
CollectionUtils
.
isNotEmpty
(
dbSc005as
))
{
totalWt
=
totalWt
.
add
(
dbSc005as
.
stream
().
map
(
HPSC005A:
:
getTotalWt
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
/*for (HPSC005A dbSc005a : dbSc005as) {
totalWt = totalWt.add(dbSc005a.getTotalWt());
}*/
}
// 判断重量是否超过订单重量
AssertUtils
.
isGt
(
totalWt
,
jhWt
,
"拆单的分派重量不能大于计划重量!"
);
Map
updateMap
=
new
HashMap
();
updateMap
.
put
(
"id"
,
dbSc005
.
getId
());
updateMap
.
put
(
"assignedNum"
,
100
);
updateMap
.
put
(
"unassignedNum"
,
0
);
//分派剩余数量变为0
updateMap
.
put
(
"workDate"
,
DateUtils
.
shortDate
());
// 部分派工变为全部派工
updateMap
.
put
(
"status"
,
2
);
DaoUtils
.
update
(
HPSqlConstant
.
HPSC005
.
UPDATE_ASSIGN_NUM
,
updateMap
);
}
/**
* 新增入库及删除入库单做同步计划订单
*
* @param prodOrderNo
...
...
@@ -740,6 +812,46 @@ public class HPSCTools {
return
results
.
get
(
0
);
}
/**
* 生成任务订单
*
* @param dbSc003
* @param dbSc004
*/
public
static
void
addSc005
(
HPSC003
dbSc003
,
HPSC004
dbSc004
)
{
HPSC005
newSc005
=
BeanUtils
.
copy
(
dbSc003
,
HPSC005
.
class
);
newSc005
.
setProdOrderNo
(
dbSc004
.
getProdOrderNo
());
if
(
StringUtils
.
isEmpty
(
newSc005
.
getProdOrderNo
())){
newSc005
.
setProdOrderNo
(
SequenceGenerator
.
getNextSequence
(
HPConstant
.
SequenceId
.
HPSC005_PROD_NO
));
}
newSc005
.
setPrdtLength
(
dbSc003
.
getLength
());
newSc005
.
setPrdtWidth
(
dbSc003
.
getWidth
());
newSc005
.
setPrdtThick
(
dbSc003
.
getThick
());
newSc005
.
setPrdtSpec
(
dbSc003
.
getSpec
());
newSc005
.
setInventRecordId
(
dbSc004
.
getInventRecordId
());
newSc005
.
setPartType
(
dbSc004
.
getPrdtType
());
newSc005
.
setPartCode
(
dbSc004
.
getPrdtCode
());
newSc005
.
setPartName
(
dbSc004
.
getPrdtName
());
newSc005
.
setPartLength
(
dbSc004
.
getLength
());
newSc005
.
setPartWidth
(
dbSc004
.
getWidth
());
newSc005
.
setPartThick
(
dbSc004
.
getThick
());
newSc005
.
setPartSpec
(
dbSc004
.
getSpec
());
newSc005
.
setRemark1
(
dbSc004
.
getRemark
());
//newSc005.setWorkDate(DateUtils.shortDate());
newSc005
.
setPlanCompletionDate
(
dbSc004
.
getPlanCompletionDate
());
newSc005
.
setNum
(
dbSc004
.
getNum
());
newSc005
.
setUnassignedNum
(
dbSc004
.
getNum
());
newSc005
.
setUnitWt
(
dbSc004
.
getUnitWt
());
newSc005
.
setTotalWt
(
dbSc004
.
getTotalWt
());
newSc005
.
setFilePath1
(
dbSc004
.
getFilePath1
());
newSc005
.
setMatId
(
dbSc004
.
getMatId
());
newSc005
.
setStatus
(
CommonConstant
.
YesNo
.
NO_0
);
newSc005
.
setDeliveryDate
(
dbSc003
.
getDeliveryDate
());
newSc005
.
setDepCode
(
dbSc004
.
getDepCode
());
newSc005
.
setFactoryCode
(
dbSc003
.
getFactoryCode
());
DaoUtils
.
insert
(
HPSC005
.
INSERT
,
newSc005
);
}
}
/**
...
...
@@ -838,6 +950,19 @@ public class HPSCTools {
return
results
.
stream
().
collect
(
Collectors
.
toMap
(
HPSC005A:
:
getProdTaskNo
,
item
->
item
));
}
/**
* 查询信息
*
* @param prodOrderNo 生产订单号
* @return
*/
public
static
List
<
HPSC005A
>
getByProdOrderNo
(
String
prodOrderNo
)
{
AssertUtils
.
isEmpty
(
prodOrderNo
,
"生产订单号不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"prodOrderNo"
,
prodOrderNo
);
return
DaoBase
.
getInstance
().
query
(
HPSC005A
.
QUERY
,
queryMap
);
}
}
/**
...
...
@@ -1037,4 +1162,19 @@ public class HPSCTools {
return
results
;
}
}
public
static
class
Hpsc106
{
public
static
HPSC106
getById
(
Long
id
){
AssertUtils
.
isTrue
(
Objects
.
isNull
(
id
)||
id
<=
0
,
"报工单ID不能为空!"
);
HPSC106
results
=
(
HPSC106
)
DaoBase
.
getInstance
().
get
(
HPSC106
.
QUERY
,
HPSC106
.
FIELD_ID
,
id
);
return
results
;
}
public
static
List
<
HPSC106
>
getByProdTaskNo
(
String
prodTaskNo
){
AssertUtils
.
isTrue
(
StringUtils
.
isEmpty
(
prodTaskNo
),
"生产编号不能为空!"
);
List
<
HPSC106
>
results
=
DaoBase
.
getInstance
().
query
(
HPSC106
.
QUERY
,
new
HashMap
<
String
,
Object
>(){{
put
(
HPSC106
.
FIELD_prod_task_no
,
prodTaskNo
);}});
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
}
}
}
src/main/java/com/baosight/hpjx/hp/xs/tools/HPXSTools.java
View file @
8198a183
...
...
@@ -185,6 +185,22 @@ public class HPXSTools {
}
/**
* 查询用户组织机构
*
* @return
*/
public
static
List
<
String
>
getOrgId
(
String
orgType
)
{
Map
paramMap
=
new
HashMap
();
paramMap
.
put
(
"userId"
,
UserSession
.
getLoginName
());
paramMap
.
put
(
"orgType"
,
orgType
);
List
<
Map
>
results
=
DaoBase
.
getInstance
().
query
(
HPSqlConstant
.
HpXsOrg
.
QUERY_ORG_ID
,
paramMap
);
if
(
CollectionUtils
.
isEmpty
(
results
))
{
return
null
;
}
return
results
.
stream
().
map
(
item
->
item
.
get
(
"orgId"
).
toString
()).
collect
(
Collectors
.
toList
());
}
/**
* 查询
*
* @param orgId
...
...
src/main/java/com/baosight/xservices/xs/impl/SecurityUserStandardImpl.java
View file @
8198a183
...
...
@@ -128,7 +128,7 @@ public class SecurityUserStandardImpl extends ServiceEPBase implements ISecurity
}
else
if
(!
"-1"
.
equals
(
userMap
.
get
(
"isLocked"
))
&&
!
"-1"
.
equals
(
userMap
.
get
(
"status"
)))
{
// 登录校验增加企业是否启用 modify by songx at 2024-01-16
String
dbCompanyCode
=
(
String
)
userMap
.
get
(
"companyCode"
);
if
(
StringUtils
.
isBlank
(
dbCompanyCode
)
||
HPPZTools
.
HpPz009
.
isValid
(
dbCompanyCode
))
{
if
(
StringUtils
.
isBlank
(
dbCompanyCode
)
||
HPPZTools
.
HpPz009
.
isValid
(
dbCompanyCode
)
||
dbCompanyCode
.
equals
(
"admin"
)
)
{
String
pwdExpireDateString
=
(
String
)
userMap
.
get
(
"pwdExpireDate"
);
String
accountExpireDateString
=
(
String
)
userMap
.
get
(
"accountExpireDate"
);
String
nowDateString
=
DateUtils
.
curDateStr8
();
...
...
src/main/webapp/HP/template/SC/HPSC102_物料清单.xls
0 → 100644
View file @
8198a183
File added
src/main/webapp/HP/template/SC/HPSC102_物料清单_部件.xls
0 → 100644
View file @
8198a183
File added
src/main/webapp/HP/template/SC/HPSC102_物料清单_零件.xls
0 → 100644
View file @
8198a183
File added
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