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
133f9bd8
Commit
133f9bd8
authored
Jan 25, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.生产领料逻辑
parent
04c2a659
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
600 additions
and
246 deletions
+600
-246
HPSqlConstant.java
...ain/java/com/baosight/hpjx/hp/constant/HPSqlConstant.java
+2
-0
HPKC002.java
src/main/java/com/baosight/hpjx/hp/kc/domain/HPKC002.java
+84
-36
HPKC004.java
src/main/java/com/baosight/hpjx/hp/kc/domain/HPKC004.java
+25
-0
ServiceHPKC002.java
.../java/com/baosight/hpjx/hp/kc/service/ServiceHPKC002.java
+61
-116
ServiceHPKC002A.java
...java/com/baosight/hpjx/hp/kc/service/ServiceHPKC002A.java
+137
-0
HPKC002.xml
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC002.xml
+38
-37
HPKC004.xml
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC004.xml
+6
-1
HPKCTools.java
src/main/java/com/baosight/hpjx/hp/kc/tools/HPKCTools.java
+76
-32
HPKC002.js
src/main/webapp/HP/KC/HPKC002.js
+0
-0
HPKC002.jsp
src/main/webapp/HP/KC/HPKC002.jsp
+34
-23
HPKC002A.js
src/main/webapp/HP/KC/HPKC002A.js
+78
-0
HPKC002A.jsp
src/main/webapp/HP/KC/HPKC002A.jsp
+58
-0
HPKC004A.jsp
src/main/webapp/HP/KC/HPKC004A.jsp
+1
-1
No files found.
src/main/java/com/baosight/hpjx/hp/constant/HPSqlConstant.java
View file @
133f9bd8
...
@@ -30,6 +30,8 @@ public class HPSqlConstant {
...
@@ -30,6 +30,8 @@ public class HPSqlConstant {
// 统计
// 统计
public
static
final
String
STAT_DATE
=
"HPKC002.statDate"
;
public
static
final
String
STAT_DATE
=
"HPKC002.statDate"
;
// 锁
public
static
final
String
LOCK
=
"HPKC002.lock"
;
}
}
/**
/**
...
...
src/main/java/com/baosight/hpjx/hp/kc/domain/HPKC002.java
View file @
133f9bd8
...
@@ -2,8 +2,6 @@ package com.baosight.hpjx.hp.kc.domain;
...
@@ -2,8 +2,6 @@ package com.baosight.hpjx.hp.kc.domain;
import
com.baosight.iplat4j.core.util.NumberUtils
;
import
com.baosight.iplat4j.core.util.NumberUtils
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
com.baosight.iplat4j.core.util.DateUtils
;
import
java.sql.Timestamp
;
import
com.baosight.iplat4j.core.ei.EiColumn
;
import
com.baosight.iplat4j.core.ei.EiColumn
;
import
com.baosight.iplat4j.core.data.DaoEPBase
;
import
com.baosight.iplat4j.core.data.DaoEPBase
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -18,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
...
@@ -18,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
*
* @version 1.0
* @version 1.0
* @history 2024-01-25
13:33:31
create
* @history 2024-01-25
23:15:22
create
*/
*/
public
class
HPKC002
extends
DaoEPBase
{
public
class
HPKC002
extends
DaoEPBase
{
...
@@ -43,7 +41,9 @@ public class HPKC002 extends DaoEPBase {
...
@@ -43,7 +41,9 @@ public class HPKC002 extends DaoEPBase {
public
static
final
String
FIELD_INVENT_RECORD_ID
=
"inventRecordId"
;
/* 存货档案ID*/
public
static
final
String
FIELD_INVENT_RECORD_ID
=
"inventRecordId"
;
/* 存货档案ID*/
public
static
final
String
FIELD_AMOUNT
=
"amount"
;
/* 数量*/
public
static
final
String
FIELD_AMOUNT
=
"amount"
;
/* 数量*/
public
static
final
String
FIELD_WEIGHT
=
"weight"
;
/* 重量*/
public
static
final
String
FIELD_WEIGHT
=
"weight"
;
/* 重量*/
public
static
final
String
FIELD_REMARKS
=
"remarks"
;
/* 备注*/
public
static
final
String
FIELD_REMARK
=
"remark"
;
/* 备注*/
public
static
final
String
FIELD_KC_ID
=
"kcId"
;
/* 库存ID*/
public
static
final
String
FIELD_OLD_REQ_NO
=
"oldReqNo"
;
/* 原领料单号*/
public
static
final
String
FIELD_DELETE_FLAG
=
"deleteFlag"
;
/* 是否删除0.否1.是*/
public
static
final
String
FIELD_DELETE_FLAG
=
"deleteFlag"
;
/* 是否删除0.否1.是*/
public
static
final
String
COL_ID
=
"ID"
;
/* 主键id*/
public
static
final
String
COL_ID
=
"ID"
;
/* 主键id*/
...
@@ -65,36 +65,40 @@ public class HPKC002 extends DaoEPBase {
...
@@ -65,36 +65,40 @@ public class HPKC002 extends DaoEPBase {
public
static
final
String
COL_INVENT_RECORD_ID
=
"INVENT_RECORD_ID"
;
/* 存货档案ID*/
public
static
final
String
COL_INVENT_RECORD_ID
=
"INVENT_RECORD_ID"
;
/* 存货档案ID*/
public
static
final
String
COL_AMOUNT
=
"AMOUNT"
;
/* 数量*/
public
static
final
String
COL_AMOUNT
=
"AMOUNT"
;
/* 数量*/
public
static
final
String
COL_WEIGHT
=
"WEIGHT"
;
/* 重量*/
public
static
final
String
COL_WEIGHT
=
"WEIGHT"
;
/* 重量*/
public
static
final
String
COL_REMARKS
=
"REMARKS"
;
/* 备注*/
public
static
final
String
COL_REMARK
=
"REMARK"
;
/* 备注*/
public
static
final
String
COL_KC_ID
=
"KC_ID"
;
/* 库存ID*/
public
static
final
String
COL_OLD_REQ_NO
=
"OLD_REQ_NO"
;
/* 原领料单号*/
public
static
final
String
COL_DELETE_FLAG
=
"DELETE_FLAG"
;
/* 是否删除0.否1.是*/
public
static
final
String
COL_DELETE_FLAG
=
"DELETE_FLAG"
;
/* 是否删除0.否1.是*/
public
static
final
String
QUERY
=
"
t_hpkc
002.query"
;
public
static
final
String
QUERY
=
"
HPKC
002.query"
;
public
static
final
String
COUNT
=
"
t_hpkc
002.count"
;
public
static
final
String
COUNT
=
"
HPKC
002.count"
;
public
static
final
String
INSERT
=
"
t_hpkc
002.insert"
;
public
static
final
String
INSERT
=
"
HPKC
002.insert"
;
public
static
final
String
UPDATE
=
"
t_hpkc
002.update"
;
public
static
final
String
UPDATE
=
"
HPKC
002.update"
;
public
static
final
String
DELETE
=
"
t_hpkc
002.delete"
;
public
static
final
String
DELETE
=
"
HPKC
002.delete"
;
private
Long
id
=
null
;
/* 主键id*/
private
Long
id
=
null
;
/* 主键id*/
private
String
companyCode
=
" "
;
/* 企业编码 预留*/
private
String
companyCode
=
" "
;
/* 企业编码 预留*/
private
String
depCode
=
" "
;
/* 部门编码*/
private
String
depCode
=
" "
;
/* 部门编码*/
private
String
createdBy
=
" "
;
/* 创建人*/
private
String
createdBy
=
" "
;
/* 创建人*/
private
String
createdName
=
" "
;
/* 创建人名称*/
private
String
createdName
=
" "
;
/* 创建人名称*/
private
String
createdTime
;
/* 创建时间*/
private
String
createdTime
=
" "
;
/* 创建时间*/
private
String
updatedBy
=
" "
;
/* 更新人*/
private
String
updatedBy
=
" "
;
/* 更新人*/
private
String
updatedName
=
" "
;
/* 更新人名称*/
private
String
updatedName
=
" "
;
/* 更新人名称*/
private
String
updatedTime
;
/* 更新时间*/
private
String
updatedTime
=
" "
;
/* 更新时间*/
private
String
reqNo
=
" "
;
/* 领料单号*/
private
String
reqNo
=
" "
;
/* 领料单号*/
private
String
receiptDate
;
/* 单据日期*/
private
String
receiptDate
=
" "
;
/* 单据日期*/
private
String
whCode
=
" "
;
/* 仓库编码*/
private
String
whCode
=
" "
;
/* 仓库编码*/
private
String
whName
=
" "
;
/* 仓库名称*/
private
String
whName
=
" "
;
/* 仓库名称*/
private
String
inventType
=
" "
;
/* 存货类型*/
private
String
inventType
=
" "
;
/* 存货类型*/
private
String
inventCode
=
" "
;
/* 存货编码*/
private
String
inventCode
=
" "
;
/* 存货编码*/
private
String
inventName
=
" "
;
/* 存货名称*/
private
String
inventName
=
" "
;
/* 存货名称*/
private
Long
inventRecordId
=
new
Long
(
0
);
/* 存货档案ID*/
private
Long
inventRecordId
=
null
;
/* 存货档案ID*/
private
BigDecimal
amount
=
new
BigDecimal
(
"0"
);
/* 数量*/
private
BigDecimal
amount
=
new
BigDecimal
(
0.00
);
/* 数量*/
private
BigDecimal
weight
=
new
BigDecimal
(
"0"
);
/* 重量*/
private
BigDecimal
weight
=
new
BigDecimal
(
0.00
);
/* 重量*/
private
String
remarks
=
" "
;
/* 备注*/
private
String
remark
=
" "
;
/* 备注*/
private
Boolean
deleteFlag
;
/* 是否删除0.否1.是*/
private
Long
kcId
=
new
Long
(
0
);
/* 库存ID*/
private
String
oldReqNo
=
" "
;
/* 原领料单号*/
private
Integer
deleteFlag
;
/* 是否删除0.否1.是*/
/**
/**
* initialize the metadata.
* initialize the metadata.
...
@@ -173,22 +177,30 @@ public class HPKC002 extends DaoEPBase {
...
@@ -173,22 +177,30 @@ public class HPKC002 extends DaoEPBase {
eiColumn
=
new
EiColumn
(
FIELD_AMOUNT
);
eiColumn
=
new
EiColumn
(
FIELD_AMOUNT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
0
);
eiColumn
.
setScaleLength
(
2
);
eiColumn
.
setFieldLength
(
1
2
);
eiColumn
.
setFieldLength
(
1
0
);
eiColumn
.
setDescName
(
"数量"
);
eiColumn
.
setDescName
(
"数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_WEIGHT
);
eiColumn
=
new
EiColumn
(
FIELD_WEIGHT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
0
);
eiColumn
.
setScaleLength
(
2
);
eiColumn
.
setFieldLength
(
1
2
);
eiColumn
.
setFieldLength
(
1
0
);
eiColumn
.
setDescName
(
"重量"
);
eiColumn
.
setDescName
(
"重量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_REMARK
S
);
eiColumn
=
new
EiColumn
(
FIELD_REMARK
);
eiColumn
.
setDescName
(
"备注"
);
eiColumn
.
setDescName
(
"备注"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_KC_ID
);
eiColumn
.
setDescName
(
"库存ID"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_OLD_REQ_NO
);
eiColumn
.
setDescName
(
"原领料单号"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_DELETE_FLAG
);
eiColumn
=
new
EiColumn
(
FIELD_DELETE_FLAG
);
eiColumn
.
setDescName
(
"是否删除0.否1.是"
);
eiColumn
.
setDescName
(
"是否删除0.否1.是"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiMetadata
.
addMeta
(
eiColumn
);
...
@@ -508,26 +520,58 @@ public class HPKC002 extends DaoEPBase {
...
@@ -508,26 +520,58 @@ public class HPKC002 extends DaoEPBase {
this
.
weight
=
weight
;
this
.
weight
=
weight
;
}
}
/**
/**
* get the remarks - 备注.
* get the remark - 备注.
* @return the remarks
* @return the remark
*/
public
String
getRemark
()
{
return
this
.
remark
;
}
/**
* set the remark - 备注.
*
* @param remark - 备注
*/
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
/**
* get the kcId - 库存ID.
* @return the kcId
*/
public
Long
getKcId
()
{
return
this
.
kcId
;
}
/**
* set the kcId - 库存ID.
*
* @param kcId - 库存ID
*/
public
void
setKcId
(
Long
kcId
)
{
this
.
kcId
=
kcId
;
}
/**
* get the oldReqNo - 原领料单号.
* @return the oldReqNo
*/
*/
public
String
get
Remarks
()
{
public
String
get
OldReqNo
()
{
return
this
.
remarks
;
return
this
.
oldReqNo
;
}
}
/**
/**
* set the
remarks - 备注
.
* set the
oldReqNo - 原领料单号
.
*
*
* @param
remarks - 备注
* @param
oldReqNo - 原领料单号
*/
*/
public
void
set
Remarks
(
String
remarks
)
{
public
void
set
OldReqNo
(
String
oldReqNo
)
{
this
.
remarks
=
remarks
;
this
.
oldReqNo
=
oldReqNo
;
}
}
/**
/**
* get the deleteFlag - 是否删除0.否1.是.
* get the deleteFlag - 是否删除0.否1.是.
* @return the deleteFlag
* @return the deleteFlag
*/
*/
public
Boolean
getDeleteFlag
()
{
public
Integer
getDeleteFlag
()
{
return
this
.
deleteFlag
;
return
this
.
deleteFlag
;
}
}
...
@@ -536,7 +580,7 @@ public class HPKC002 extends DaoEPBase {
...
@@ -536,7 +580,7 @@ public class HPKC002 extends DaoEPBase {
*
*
* @param deleteFlag - 是否删除0.否1.是
* @param deleteFlag - 是否删除0.否1.是
*/
*/
public
void
setDeleteFlag
(
Boolean
deleteFlag
)
{
public
void
setDeleteFlag
(
Integer
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
this
.
deleteFlag
=
deleteFlag
;
}
}
/**
/**
...
@@ -566,8 +610,10 @@ public class HPKC002 extends DaoEPBase {
...
@@ -566,8 +610,10 @@ public class HPKC002 extends DaoEPBase {
setInventRecordId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_INVENT_RECORD_ID
)),
inventRecordId
));
setInventRecordId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_INVENT_RECORD_ID
)),
inventRecordId
));
setAmount
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_AMOUNT
)),
amount
));
setAmount
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_AMOUNT
)),
amount
));
setWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_WEIGHT
)),
weight
));
setWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_WEIGHT
)),
weight
));
setRemarks
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_REMARKS
)),
remarks
));
setRemark
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_REMARK
)),
remark
));
setDeleteFlag
(
NumberUtils
.
toBoolean
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DELETE_FLAG
)),
deleteFlag
));
setKcId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_KC_ID
)),
kcId
));
setOldReqNo
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_OLD_REQ_NO
)),
oldReqNo
));
setDeleteFlag
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DELETE_FLAG
)),
deleteFlag
));
}
}
/**
/**
...
@@ -596,7 +642,9 @@ public class HPKC002 extends DaoEPBase {
...
@@ -596,7 +642,9 @@ public class HPKC002 extends DaoEPBase {
map
.
put
(
FIELD_INVENT_RECORD_ID
,
StringUtils
.
toString
(
inventRecordId
,
eiMetadata
.
getMeta
(
FIELD_INVENT_RECORD_ID
)));
map
.
put
(
FIELD_INVENT_RECORD_ID
,
StringUtils
.
toString
(
inventRecordId
,
eiMetadata
.
getMeta
(
FIELD_INVENT_RECORD_ID
)));
map
.
put
(
FIELD_AMOUNT
,
StringUtils
.
toString
(
amount
,
eiMetadata
.
getMeta
(
FIELD_AMOUNT
)));
map
.
put
(
FIELD_AMOUNT
,
StringUtils
.
toString
(
amount
,
eiMetadata
.
getMeta
(
FIELD_AMOUNT
)));
map
.
put
(
FIELD_WEIGHT
,
StringUtils
.
toString
(
weight
,
eiMetadata
.
getMeta
(
FIELD_WEIGHT
)));
map
.
put
(
FIELD_WEIGHT
,
StringUtils
.
toString
(
weight
,
eiMetadata
.
getMeta
(
FIELD_WEIGHT
)));
map
.
put
(
FIELD_REMARKS
,
StringUtils
.
toString
(
remarks
,
eiMetadata
.
getMeta
(
FIELD_REMARKS
)));
map
.
put
(
FIELD_REMARK
,
StringUtils
.
toString
(
remark
,
eiMetadata
.
getMeta
(
FIELD_REMARK
)));
map
.
put
(
FIELD_KC_ID
,
StringUtils
.
toString
(
kcId
,
eiMetadata
.
getMeta
(
FIELD_KC_ID
)));
map
.
put
(
FIELD_OLD_REQ_NO
,
StringUtils
.
toString
(
oldReqNo
,
eiMetadata
.
getMeta
(
FIELD_OLD_REQ_NO
)));
map
.
put
(
FIELD_DELETE_FLAG
,
StringUtils
.
toString
(
deleteFlag
,
eiMetadata
.
getMeta
(
FIELD_DELETE_FLAG
)));
map
.
put
(
FIELD_DELETE_FLAG
,
StringUtils
.
toString
(
deleteFlag
,
eiMetadata
.
getMeta
(
FIELD_DELETE_FLAG
)));
return
map
;
return
map
;
...
...
src/main/java/com/baosight/hpjx/hp/kc/domain/HPKC004.java
View file @
133f9bd8
...
@@ -37,6 +37,7 @@ public class HPKC004 extends DaoEPBase {
...
@@ -37,6 +37,7 @@ public class HPKC004 extends DaoEPBase {
public
static
final
String
FIELD_WEIGHT
=
"weight"
;
/* 重量*/
public
static
final
String
FIELD_WEIGHT
=
"weight"
;
/* 重量*/
public
static
final
String
FIELD_STATUS
=
"status"
;
/* 状态*/
public
static
final
String
FIELD_STATUS
=
"status"
;
/* 状态*/
public
static
final
String
FIELD_REMARK
=
"remark"
;
/* 备注*/
public
static
final
String
FIELD_REMARK
=
"remark"
;
/* 备注*/
public
static
final
String
FIELD_KC_ID
=
"kcId"
;
/* 库存ID*/
public
static
final
String
FIELD_OLD_SALE_NO
=
"oldSaleNo"
;
/* 原销售单号*/
public
static
final
String
FIELD_OLD_SALE_NO
=
"oldSaleNo"
;
/* 原销售单号*/
public
static
final
String
FIELD_CREATED_BY
=
"createdBy"
;
/* 创建人*/
public
static
final
String
FIELD_CREATED_BY
=
"createdBy"
;
/* 创建人*/
public
static
final
String
FIELD_CREATED_NAME
=
"createdName"
;
/* 创建人名称*/
public
static
final
String
FIELD_CREATED_NAME
=
"createdName"
;
/* 创建人名称*/
...
@@ -61,6 +62,7 @@ public class HPKC004 extends DaoEPBase {
...
@@ -61,6 +62,7 @@ public class HPKC004 extends DaoEPBase {
public
static
final
String
COL_WEIGHT
=
"WEIGHT"
;
/* 重量*/
public
static
final
String
COL_WEIGHT
=
"WEIGHT"
;
/* 重量*/
public
static
final
String
COL_STATUS
=
"STATUS"
;
/* 状态*/
public
static
final
String
COL_STATUS
=
"STATUS"
;
/* 状态*/
public
static
final
String
COL_REMARK
=
"REMARK"
;
/* 备注*/
public
static
final
String
COL_REMARK
=
"REMARK"
;
/* 备注*/
public
static
final
String
COL_KC_ID
=
"KC_ID"
;
/* 库存ID*/
public
static
final
String
COL_OLD_SALE_NO
=
"OLD_SALE_NO"
;
/* 原销售单号*/
public
static
final
String
COL_OLD_SALE_NO
=
"OLD_SALE_NO"
;
/* 原销售单号*/
public
static
final
String
COL_CREATED_BY
=
"CREATED_BY"
;
/* 创建人*/
public
static
final
String
COL_CREATED_BY
=
"CREATED_BY"
;
/* 创建人*/
public
static
final
String
COL_CREATED_NAME
=
"CREATED_NAME"
;
/* 创建人名称*/
public
static
final
String
COL_CREATED_NAME
=
"CREATED_NAME"
;
/* 创建人名称*/
...
@@ -91,6 +93,7 @@ public class HPKC004 extends DaoEPBase {
...
@@ -91,6 +93,7 @@ public class HPKC004 extends DaoEPBase {
private
BigDecimal
weight
=
new
BigDecimal
(
0
);
/* 重量*/
private
BigDecimal
weight
=
new
BigDecimal
(
0
);
/* 重量*/
private
Integer
status
;
/* 状态*/
private
Integer
status
;
/* 状态*/
private
String
remark
=
" "
;
/* 备注*/
private
String
remark
=
" "
;
/* 备注*/
private
Long
kcId
=
new
Long
(
0
);
/* 库存ID*/
private
String
oldSaleNo
=
" "
;
/* 原销售单号*/
private
String
oldSaleNo
=
" "
;
/* 原销售单号*/
private
String
createdBy
=
" "
;
/* 创建人*/
private
String
createdBy
=
" "
;
/* 创建人*/
private
String
createdName
=
" "
;
/* 创建人名称*/
private
String
createdName
=
" "
;
/* 创建人名称*/
...
@@ -173,6 +176,10 @@ public class HPKC004 extends DaoEPBase {
...
@@ -173,6 +176,10 @@ public class HPKC004 extends DaoEPBase {
eiColumn
.
setDescName
(
"备注"
);
eiColumn
.
setDescName
(
"备注"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_KC_ID
);
eiColumn
.
setDescName
(
"库存ID"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_OLD_SALE_NO
);
eiColumn
=
new
EiColumn
(
FIELD_OLD_SALE_NO
);
eiColumn
.
setDescName
(
"原销售单号"
);
eiColumn
.
setDescName
(
"原销售单号"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiMetadata
.
addMeta
(
eiColumn
);
...
@@ -457,6 +464,22 @@ public class HPKC004 extends DaoEPBase {
...
@@ -457,6 +464,22 @@ public class HPKC004 extends DaoEPBase {
this
.
remark
=
remark
;
this
.
remark
=
remark
;
}
}
/**
/**
* get the kcId - 库存ID.
* @return the kcId
*/
public
Long
getKcId
()
{
return
this
.
kcId
;
}
/**
* set the kcId - 库存ID.
*
* @param kcId - 库存ID
*/
public
void
setKcId
(
Long
kcId
)
{
this
.
kcId
=
kcId
;
}
/**
* get the oldSaleNo - 原销售单号.
* get the oldSaleNo - 原销售单号.
* @return the oldSaleNo
* @return the oldSaleNo
*/
*/
...
@@ -607,6 +630,7 @@ public class HPKC004 extends DaoEPBase {
...
@@ -607,6 +630,7 @@ public class HPKC004 extends DaoEPBase {
setWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_WEIGHT
)),
weight
));
setWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_WEIGHT
)),
weight
));
setStatus
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_STATUS
)),
status
));
setStatus
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_STATUS
)),
status
));
setRemark
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_REMARK
)),
remark
));
setRemark
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_REMARK
)),
remark
));
setKcId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_KC_ID
)),
kcId
));
setOldSaleNo
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_OLD_SALE_NO
)),
oldSaleNo
));
setOldSaleNo
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_OLD_SALE_NO
)),
oldSaleNo
));
setCreatedBy
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_CREATED_BY
)),
createdBy
));
setCreatedBy
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_CREATED_BY
)),
createdBy
));
setCreatedName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_CREATED_NAME
)),
createdName
));
setCreatedName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_CREATED_NAME
)),
createdName
));
...
@@ -639,6 +663,7 @@ public class HPKC004 extends DaoEPBase {
...
@@ -639,6 +663,7 @@ public class HPKC004 extends DaoEPBase {
map
.
put
(
FIELD_WEIGHT
,
StringUtils
.
toString
(
weight
,
eiMetadata
.
getMeta
(
FIELD_WEIGHT
)));
map
.
put
(
FIELD_WEIGHT
,
StringUtils
.
toString
(
weight
,
eiMetadata
.
getMeta
(
FIELD_WEIGHT
)));
map
.
put
(
FIELD_STATUS
,
StringUtils
.
toString
(
status
,
eiMetadata
.
getMeta
(
FIELD_STATUS
)));
map
.
put
(
FIELD_STATUS
,
StringUtils
.
toString
(
status
,
eiMetadata
.
getMeta
(
FIELD_STATUS
)));
map
.
put
(
FIELD_REMARK
,
StringUtils
.
toString
(
remark
,
eiMetadata
.
getMeta
(
FIELD_REMARK
)));
map
.
put
(
FIELD_REMARK
,
StringUtils
.
toString
(
remark
,
eiMetadata
.
getMeta
(
FIELD_REMARK
)));
map
.
put
(
FIELD_KC_ID
,
StringUtils
.
toString
(
kcId
,
eiMetadata
.
getMeta
(
FIELD_KC_ID
)));
map
.
put
(
FIELD_OLD_SALE_NO
,
StringUtils
.
toString
(
oldSaleNo
,
eiMetadata
.
getMeta
(
FIELD_OLD_SALE_NO
)));
map
.
put
(
FIELD_OLD_SALE_NO
,
StringUtils
.
toString
(
oldSaleNo
,
eiMetadata
.
getMeta
(
FIELD_OLD_SALE_NO
)));
map
.
put
(
FIELD_CREATED_BY
,
StringUtils
.
toString
(
createdBy
,
eiMetadata
.
getMeta
(
FIELD_CREATED_BY
)));
map
.
put
(
FIELD_CREATED_BY
,
StringUtils
.
toString
(
createdBy
,
eiMetadata
.
getMeta
(
FIELD_CREATED_BY
)));
map
.
put
(
FIELD_CREATED_NAME
,
StringUtils
.
toString
(
createdName
,
eiMetadata
.
getMeta
(
FIELD_CREATED_NAME
)));
map
.
put
(
FIELD_CREATED_NAME
,
StringUtils
.
toString
(
createdName
,
eiMetadata
.
getMeta
(
FIELD_CREATED_NAME
)));
...
...
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC002.java
View file @
133f9bd8
...
@@ -2,12 +2,19 @@ package com.baosight.hpjx.hp.kc.service;
...
@@ -2,12 +2,19 @@ package com.baosight.hpjx.hp.kc.service;
import
com.baosight.hpjx.common.DdynamicEnum
;
import
com.baosight.hpjx.common.DdynamicEnum
;
import
com.baosight.hpjx.common.InventTypeEnun
;
import
com.baosight.hpjx.common.InventTypeEnun
;
import
com.baosight.hpjx.core.constant.CommonConstant
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.kc.domain.HPKC002
;
import
com.baosight.hpjx.hp.kc.domain.HPKC002
;
import
com.baosight.hpjx.hp.kc.domain.HPKC004
;
import
com.baosight.hpjx.hp.kc.tools.HPKCTools
;
import
com.baosight.hpjx.hp.pz.domain.HPPZ007
;
import
com.baosight.hpjx.hp.pz.domain.HPPZ007
;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.BeanUtils
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.EiInfoUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.ObjectUtils
;
import
com.baosight.hpjx.util.StringUtil
;
import
com.baosight.hpjx.util.StringUtil
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
...
@@ -15,26 +22,33 @@ import com.baosight.iplat4j.core.ei.EiInfo;
...
@@ -15,26 +22,33 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.*
;
import
java.util.*
;
/**
/**
* @author
YK
* @author
:songx
* @date
2024年01月09日 10:18
* @date
:2024/1/25,23:19
*/
*/
public
class
ServiceHPKC002
extends
ServiceBase
{
public
class
ServiceHPKC002
extends
ServiceBase
{
// 指定存货类型
private
static
final
Integer
[]
DEFAULT_INVENT_CODE
=
{
InventTypeEnun
.
MATERIAL
.
getCode
(),
InventTypeEnun
.
CONSUMABLE
.
getCode
()};
/**
/**
* 画面初始化.
* 画面初始化.
*/
*/
@Override
@Override
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
try
{
try
{
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
WH_RECORD_BLOCK_ID
),
null
);
Map
queryMap
=
new
HashMap
();
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
WH_RECORD_BLOCK_ID
),
null
);
queryMap
.
put
(
"inventTypes"
,
DEFAULT_INVENT_CODE
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_NAME_BLOCK_ID
),
null
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
WH_RECORD_BLOCK_ID
),
queryMap
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_SPEC_BLOCK_ID
),
null
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_NAME_BLOCK_ID
),
queryMap
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_SPEC_BLOCK_ID
),
queryMap
,
false
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
SPEC_NAME_BLOCK_ID
),
queryMap
,
false
);
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HPKC002
().
eiMetadata
);
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HPKC002
().
eiMetadata
);
inInfo
.
setBlock
(
InventTypeEnun
.
generatorEiBlock
());
inInfo
.
setBlock
(
InventTypeEnun
.
generatorEiBlock
());
}
catch
(
PlatException
e
)
{
}
catch
(
PlatException
e
)
{
...
@@ -44,135 +58,66 @@ public class ServiceHPKC002 extends ServiceBase {
...
@@ -44,135 +58,66 @@ public class ServiceHPKC002 extends ServiceBase {
}
}
/**
/**
* 查询操作.
* 查询操作
*
* @param inInfo
* @return
*/
*/
@Override
@Override
public
EiInfo
query
(
EiInfo
inInfo
)
{
public
EiInfo
query
(
EiInfo
inInfo
)
{
String
documentTime
=
inInfo
.
getCellStr
(
EiConstant
.
queryBlock
,
0
,
"documentTime"
);
if
(
StringUtils
.
isNotBlank
(
documentTime
)){
inInfo
.
setCell
(
EiConstant
.
queryBlock
,
0
,
"documentTime"
,
StringUtil
.
removeHorizontalLine
(
documentTime
));
}
/* 调用EI查询方法.*/
return
super
.
query
(
inInfo
,
"HPKC002.query"
,
new
HPKC002
());
}
/**
* 新增操作.
*/
@Override
public
EiInfo
insert
(
EiInfo
inInfo
)
{
try
{
try
{
CommonMethod
.
creatorInfo
(
inInfo
,
EiConstant
.
resultBlock
);
Map
queryRow
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
String
receiptDate
=
MapUtils
.
getString
(
queryRow
,
"receiptDate"
);
this
.
checkSaveData
(
resultRows
);
queryRow
.
put
(
"receiptDate"
,
StringUtil
.
removeSpecifiedCharacter
(
receiptDate
,
// 写入数据
StringUtil
.
DEFAULT_CHARACTER_TO_BE_REMOVED
));
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
queryRow
.
put
(
"inventTypes"
,
DEFAULT_INVENT_CODE
);
HPKC002
insertEntity
=
new
HPKC002
();
inInfo
=
super
.
query
(
inInfo
,
HPKC002
.
QUERY
,
new
HPKC002
());
insertEntity
.
fromMap
(
resultRows
.
get
(
i
));
}
catch
(
Exception
e
)
{
// 仓库名称
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
Map
params
=
new
HashMap
<>();
params
.
put
(
"whCode"
,
insertEntity
.
getWhCode
());
List
query
=
dao
.
query
(
"HPPZ007.queryByWhCode"
,
params
);
insertEntity
.
setWhName
(((
HPPZ007
)
query
.
get
(
0
)).
getWhName
());
//存货类型
insertEntity
.
setInventType
(
InventTypeEnun
.
getNameByCode
(
insertEntity
.
getInventType
()));
// 生成单据号
insertEntity
.
setReqNo
(
SequenceGenerator
.
getNextSequence
(
HPConstant
.
SequenceId
.
HPKC002_NUMBER
));
dao
.
insert
(
"HPKC002.insert"
,
insertEntity
);
}
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据保存成功!"
);
}
catch
(
PlatException
e
)
{
inInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
inInfo
.
setMsg
(
"操作失败!原因参见详细错误描述!"
);
inInfo
.
setDetailMsg
(
e
.
getMessage
());
logError
(
"新增失败"
,
e
.
getMessage
());
return
inInfo
;
return
inInfo
;
}
}
return
inInfo
;
}
/**
/**
* 校验保存的数据
* 删除操作
*
*
* @param resultRows
* @param inInfo
*/
* @return
private
void
checkSaveData
(
List
<
Map
>
resultRows
)
{
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
HPKC002
entity
=
new
HPKC002
();
entity
.
fromMap
(
resultRows
.
get
(
i
));
AssertUtils
.
isEmpty
(
entity
.
getInventType
(),
"存货类型不能为空"
);
AssertUtils
.
isEmpty
(
entity
.
getInventCode
(),
"物料不能为空"
);
AssertUtils
.
isEmpty
(
entity
.
getWhCode
(),
"仓库不能为空"
);
}
}
/**
* 修改操作.
*/
*/
@Override
public
EiInfo
delete
(
EiInfo
inInfo
)
{
public
EiInfo
update
(
EiInfo
inInfo
)
{
try
{
try
{
CommonMethod
.
udpateInfo
(
inInfo
,
EiConstant
.
resultBlock
);
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
this
.
checkSaveData
(
resultRows
);
// 销售单号
// 写入数据
List
<
String
>
reqNos
=
ObjectUtils
.
listKey
(
resultRows
,
"reqNo"
);
// 锁记录
HPKCTools
.
lockKc002
(
reqNos
);
// 查询数据库记录
Map
<
String
,
HPKC002
>
dbMapKc002
=
HPKCTools
.
mapKc002
(
reqNos
);
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
HPKC002
updateEntity
=
new
HPKC002
();
HPKC002
fKc002
=
new
HPKC002
();
updateEntity
.
fromMap
(
resultRows
.
get
(
i
));
fKc002
.
fromMap
(
resultRows
.
get
(
i
));
// 仓库名称
DaoUtils
.
update
(
HPKC002
.
DELETE
,
fKc002
);
Map
params
=
new
HashMap
<>();
// 生成红冲记录
params
.
put
(
"whCode"
,
updateEntity
.
getWhCode
());
HPKC002
dbKc002
=
dbMapKc002
.
get
(
fKc002
.
getReqNo
());
List
query
=
dao
.
query
(
"HPPZ007.queryByWhCode"
,
params
);
HPKC002
newKc002
=
BeanUtils
.
copy
(
dbKc002
,
HPKC002
.
class
);
updateEntity
.
setWhName
(((
HPPZ007
)
query
.
get
(
0
)).
getWhName
());
newKc002
.
setReqNo
(
SequenceGenerator
.
getNextSequence
(
HPConstant
.
SequenceId
.
HPKC002_NUMBER
));
//存货类型
newKc002
.
setAmount
(
dbKc002
.
getAmount
().
negate
());
updateEntity
.
setInventType
(
InventTypeEnun
.
getNameByCode
(
updateEntity
.
getInventType
()));
newKc002
.
setWeight
(
dbKc002
.
getWeight
().
negate
());
dao
.
insert
(
"HPKC002.update"
,
updateEntity
);
newKc002
.
setOldReqNo
(
dbKc002
.
getReqNo
());
newKc002
.
setDeleteFlag
(
CommonConstant
.
YesNo
.
YES_1
);
DaoUtils
.
insert
(
HPKC002
.
INSERT
,
newKc002
);
// 修改库存
HPKCTools
.
updateStock
(
dbKc002
.
getWhCode
(),
dbKc002
.
getInventRecordId
(),
dbKc002
.
getAmount
().
negate
(),
dbKc002
.
getWeight
().
negate
());
}
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据保存成功!"
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
}
catch
(
Exception
e
)
{
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"删除失败"
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
inInfo
.
setMsg
(
"操作失败!原因参见详细错误描述!"
);
inInfo
.
setDetailMsg
(
e
.
getMessage
());
logError
(
"修改失败"
,
e
.
getMessage
());
return
inInfo
;
}
}
return
inInfo
;
return
inInfo
;
}
}
/**
* 删除操作.
*/
@Override
public
EiInfo
delete
(
EiInfo
eiInfo
)
{
HPKC002
HPKC002
=
new
HPKC002
();
EiBlock
eiBlock
=
eiInfo
.
getBlock
(
EiConstant
.
resultBlock
);
try
{
for
(
int
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
HPKC002
.
fromMap
(
map
);
this
.
dao
.
delete
(
"HPKC002.delete"
,
HPKC002
.
toMap
());
}
}
catch
(
PlatException
e
)
{
eiInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
eiInfo
.
setMsg
(
"删除失败,原因参见详细错误描述!"
);
eiInfo
.
setDetailMsg
(
e
.
getMessage
());
logError
(
"删除失败!"
,
e
.
getMessage
());
return
eiInfo
;
}
eiInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
eiInfo
.
setMsg
(
"删除成功!"
);
return
eiInfo
;
}
}
}
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC002A.java
0 → 100644
View file @
133f9bd8
package
com
.
baosight
.
hpjx
.
hp
.
kc
.
service
;
import
com.baosight.hpjx.common.DdynamicEnum
;
import
com.baosight.hpjx.common.InventTypeEnun
;
import
com.baosight.hpjx.core.constant.CommonConstant
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.kc.domain.HPKC002
;
import
com.baosight.hpjx.hp.kc.domain.HPKC004
;
import
com.baosight.hpjx.hp.kc.domain.HPKC010
;
import
com.baosight.hpjx.hp.kc.tools.HPKCTools
;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.BeanUtils
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.DateUtils
;
import
com.baosight.hpjx.util.EiInfoUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.MapUtils
;
import
com.baosight.hpjx.util.ObjectUtils
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
java.math.BigDecimal
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 生产领料挑选库存
*
* @author:songx
* @date:2022/7/11,11:08
*/
public
class
ServiceHPKC002A
extends
ServiceEPBase
{
// 指定存货类型
private
static
final
Integer
[]
DEFAULT_INVENT_CODE
=
{
InventTypeEnun
.
MATERIAL
.
getCode
(),
InventTypeEnun
.
CONSUMABLE
.
getCode
()};
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
try
{
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"inventTypes"
,
DEFAULT_INVENT_CODE
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
WH_RECORD_BLOCK_ID
),
queryMap
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_NAME_BLOCK_ID
),
queryMap
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_SPEC_BLOCK_ID
),
queryMap
,
false
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
SPEC_NAME_BLOCK_ID
),
queryMap
,
false
);
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HPKC010
().
eiMetadata
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败"
);
}
return
inInfo
;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
Map
queryRow
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
queryRow
.
put
(
"inventTypes"
,
DEFAULT_INVENT_CODE
);
inInfo
=
super
.
query
(
inInfo
,
HPKC010
.
QUERY
,
new
HPKC010
());
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
return
inInfo
;
}
/**
* 生成出库单
*
* @param inInfo
* @return
*/
public
EiInfo
select
(
EiInfo
inInfo
)
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
// 库存ID
List
<
Long
>
ids
=
ObjectUtils
.
listKey
(
resultRows
,
"id"
);
// 行锁
HPKCTools
.
lockKc010
(
ids
);
// 获取库存信息
Map
<
Long
,
HPKC010
>
dbKc010Map
=
HPKCTools
.
mapKc010
(
ids
);
// 状态校验
for
(
Map
row
:
resultRows
)
{
Long
id
=
MapUtils
.
getLong
(
row
,
"id"
);
HPKC010
dbKc010
=
dbKc010Map
.
get
(
id
);
AssertUtils
.
isNull
(
dbKc010
,
"库存号["
+
id
+
"]不存在!"
);
// 校验数量
BigDecimal
applyAmount
=
MapUtils
.
getBigDecimal
(
row
,
"applyAmount"
);
AssertUtils
.
isGt
(
applyAmount
,
dbKc010
.
getAmount
(),
"库存号["
+
id
+
"]可用数量不足!"
);
BigDecimal
applyWeight
=
MapUtils
.
getBigDecimal
(
row
,
"applyWeight"
);
AssertUtils
.
isGt
(
applyWeight
,
dbKc010
.
getWeight
(),
"库存号["
+
id
+
"]可用重量不足!"
);
}
// 生成销售库单
for
(
Map
row
:
resultRows
)
{
BigDecimal
applyAmount
=
MapUtils
.
getBigDecimal
(
row
,
"applyAmount"
);
BigDecimal
applyWeight
=
MapUtils
.
getBigDecimal
(
row
,
"applyWeight"
);
String
applyRemark
=
MapUtils
.
getString
(
row
,
"applyRemark"
);
Long
kcId
=
MapUtils
.
getLong
(
row
,
"id"
);
HPKC010
dbKc010
=
dbKc010Map
.
get
(
kcId
);
HPKC002
newKc002
=
BeanUtils
.
copy
(
dbKc010
,
HPKC002
.
class
);
newKc002
.
setReqNo
(
SequenceGenerator
.
getNextSequence
(
HPConstant
.
SequenceId
.
HPKC002_NUMBER
));
newKc002
.
setReceiptDate
(
DateUtils
.
shortDate
());
newKc002
.
setAmount
(
applyAmount
);
newKc002
.
setWeight
(
applyWeight
);
newKc002
.
setRemark
(
applyRemark
);
newKc002
.
setKcId
(
kcId
);
newKc002
.
setDeleteFlag
(
CommonConstant
.
YesNo
.
NO_0
);
DaoUtils
.
insert
(
HPKC002
.
INSERT
,
newKc002
);
// 修改库存数量
HPKCTools
.
updateStock
(
newKc002
.
getWhCode
(),
newKc002
.
getInventRecordId
(),
newKc002
.
getAmount
().
negate
(),
newKc002
.
getWeight
().
negate
());
}
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"生成领料单失败"
);
}
return
inInfo
;
}
}
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC002.xml
View file @
133f9bd8
...
@@ -22,7 +22,9 @@
...
@@ -22,7 +22,9 @@
INVENT_RECORD_ID as "inventRecordId",
<!-- 存货档案ID -->
INVENT_RECORD_ID as "inventRecordId",
<!-- 存货档案ID -->
AMOUNT as "amount",
<!-- 数量 -->
AMOUNT as "amount",
<!-- 数量 -->
WEIGHT as "weight",
<!-- 重量 -->
WEIGHT as "weight",
<!-- 重量 -->
REMARKS as "remarks",
<!-- 备注 -->
REMARK as "remark",
<!-- 备注 -->
KC_ID as "kcId",
<!-- 库存ID -->
OLD_REQ_NO as "oldReqNo",
<!-- 原领料单号 -->
DELETE_FLAG as "deleteFlag"
<!-- 是否删除0.否1.是 -->
DELETE_FLAG as "deleteFlag"
<!-- 是否删除0.否1.是 -->
</sql>
</sql>
...
@@ -55,7 +57,7 @@
...
@@ -55,7 +57,7 @@
UPDATED_TIME = #updatedTime#
UPDATED_TIME = #updatedTime#
</isNotEmpty>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"reqNo"
>
<isNotEmpty
prepend=
" AND "
property=
"reqNo"
>
REQ_NO= #reqNo#
REQ_NO
= #reqNo#
</isNotEmpty>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"receiptDate"
>
<isNotEmpty
prepend=
" AND "
property=
"receiptDate"
>
RECEIPT_DATE = #receiptDate#
RECEIPT_DATE = #receiptDate#
...
@@ -78,14 +80,11 @@
...
@@ -78,14 +80,11 @@
<isNotEmpty
prepend=
" AND "
property=
"inventRecordId"
>
<isNotEmpty
prepend=
" AND "
property=
"inventRecordId"
>
INVENT_RECORD_ID = #inventRecordId#
INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"
amount
"
>
<isNotEmpty
prepend=
" AND "
property=
"
kcId
"
>
AMOUNT = #amount
#
KC_ID = #kcId
#
</isNotEmpty>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"weight"
>
<isNotEmpty
prepend=
" AND "
property=
"oldReqNo"
>
WEIGHT = #weight#
OLD_REQ_NO = #oldReqNo#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"remarks"
>
REMARKS = #remarks#
</isNotEmpty>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"deleteFlag"
>
<isNotEmpty
prepend=
" AND "
property=
"deleteFlag"
>
DELETE_FLAG = #deleteFlag#
DELETE_FLAG = #deleteFlag#
...
@@ -93,6 +92,9 @@
...
@@ -93,6 +92,9 @@
</sql>
</sql>
<sql
id=
"customCondition"
>
<sql
id=
"customCondition"
>
<isNotEmpty
prepend=
" AND "
property=
"reqNos"
>
REQ_NO IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"reqNos"
>
#reqNos[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"spec"
>
<isNotEmpty
prepend=
" AND "
property=
"spec"
>
<isEqual
property=
"spec"
compareValue=
"无规格"
>
<isEqual
property=
"spec"
compareValue=
"无规格"
>
INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = '')
INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = '')
...
@@ -109,20 +111,23 @@
...
@@ -109,20 +111,23 @@
</isNotEmpty>
</isNotEmpty>
</sql>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
<sql
id=
"order"
>
resultClass=
"com.baosight.hpjx.hp.kc.domain.HPKC002"
>
SELECT
<include
refid=
"column"
/>
FROM hpjx.t_hpkc002 WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
<dynamic
prepend=
"ORDER BY"
>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy
"
>
<isNotEmpty
property=
"order
"
>
$orderBy$
$orderBy$
</isNotEmpty>
</isNotEmpty>
<isEmpty
property=
"orderBy
"
>
<isEmpty
property=
"order
"
>
ID asc
ID asc
</isEmpty>
</isEmpty>
</dynamic>
</dynamic>
</sql>
<select
id=
"query"
resultClass=
"com.baosight.hpjx.hp.kc.domain.HPKC002"
>
SELECT
<include
refid=
"column"
/>
FROM hpjx.t_hpkc002 WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
<include
refid=
"order"
/>
</select>
</select>
<select
id=
"count"
resultClass=
"int"
>
<select
id=
"count"
resultClass=
"int"
>
...
@@ -148,12 +153,15 @@
...
@@ -148,12 +153,15 @@
INVENT_RECORD_ID,
<!-- 存货档案ID -->
INVENT_RECORD_ID,
<!-- 存货档案ID -->
AMOUNT,
<!-- 数量 -->
AMOUNT,
<!-- 数量 -->
WEIGHT,
<!-- 重量 -->
WEIGHT,
<!-- 重量 -->
REMARKS,
<!-- 备注 -->
REMARK,
<!-- 备注 -->
KC_ID,
<!-- 库存ID -->
OLD_REQ_NO,
<!-- 原领料单号 -->
DELETE_FLAG
<!-- 是否删除0.否1.是 -->
DELETE_FLAG
<!-- 是否删除0.否1.是 -->
) VALUES (
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#reqCode#, #receiptDate#, #whCode#, #whName#, #inventType#, #inventCode#,
#reqNo#, #receiptDate#, #whCode#, #whName#, #inventType#, #inventCode#,
#inventName#, #inventRecordId#, #amount#, #weight#, #remarks#, #deleteFlag#
#inventName#, #inventRecordId#, #amount#, #weight#, #remark#, #kcId#,
#oldReqNo#, #deleteFlag#
)
)
</insert>
</insert>
...
@@ -162,24 +170,17 @@
...
@@ -162,24 +170,17 @@
UPDATE hpjx.t_hpkc002 SET DELETE_FLAG = 1 WHERE ID = #id#
UPDATE hpjx.t_hpkc002 SET DELETE_FLAG = 1 WHERE ID = #id#
</delete>
</delete>
<update
id=
"update"
>
<!-- 行锁 -->
<update
id=
"lock"
>
UPDATE ${hpjxSchema}.T_HPKC002
UPDATE ${hpjxSchema}.T_HPKC002
SET
SET CREATED_TIME = CREATED_TIME
UPDATED_BY = #updatedBy#,
<!-- 更新人 -->
WHERE 1=1
UPDATED_NAME = #updatedName#,
<!-- 更新人名称 -->
<isNotEmpty
prepend=
" AND "
property=
"reqNo"
>
UPDATED_TIME = #updatedTime#,
<!-- 更新时间 -->
REQ_NO = #reqNo#
REQ_NO = #reqNo#,
<!-- 领料单号 -->
</isNotEmpty>
RECEIPT_DATE = #receiptDate#,
<!-- 单据日期 -->
<isNotEmpty
prepend=
" AND "
property=
"reqNos"
>
WH_CODE = #whCode#,
<!-- 仓库编码 -->
REQ_NO IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"reqNos"
>
#reqNos[]#
</iterate>
WH_NAME = #whName#,
<!-- 仓库名称 -->
</isNotEmpty>
INVENT_TYPE = #inventType#,
<!-- 存货类型 -->
INVENT_CODE = #inventCode#,
<!-- 存货编码 -->
INVENT_NAME = #inventName#,
<!-- 存货名称 -->
INVENT_RECORD_ID = #inventRecordId#,
<!-- 存货档案ID -->
AMOUNT = #amount#,
<!-- 数量 -->
WEIGHT = #weight#,
<!-- 重量 -->
REMARKS = #remarks#
<!-- 备注 -->
WHERE ID = #id#
</update>
</update>
<!-- 统计库存 -->
<!-- 统计库存 -->
...
...
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC004.xml
View file @
133f9bd8
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
WEIGHT as "weight",
<!-- 重量 -->
WEIGHT as "weight",
<!-- 重量 -->
STATUS as "status",
<!-- 状态 -->
STATUS as "status",
<!-- 状态 -->
REMARK as "remark",
<!-- 备注 -->
REMARK as "remark",
<!-- 备注 -->
KC_ID as "kcId",
<!-- 库存ID -->
OLD_SALE_NO as "oldSaleNo",
<!-- 原销售单号 -->
OLD_SALE_NO as "oldSaleNo",
<!-- 原销售单号 -->
CREATED_BY as "createdBy",
<!-- 创建人 -->
CREATED_BY as "createdBy",
<!-- 创建人 -->
CREATED_NAME as "createdName",
<!-- 创建人名称 -->
CREATED_NAME as "createdName",
<!-- 创建人名称 -->
...
@@ -62,6 +63,9 @@
...
@@ -62,6 +63,9 @@
<isNotEmpty
prepend=
" AND "
property=
"inventRecordId"
>
<isNotEmpty
prepend=
" AND "
property=
"inventRecordId"
>
INVENT_RECORD_ID = #inventRecordId#
INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"kcId"
>
KC_ID = #kcId#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"deleteFlag"
>
<isNotEmpty
prepend=
" AND "
property=
"deleteFlag"
>
DELETE_FLAG = #deleteFlag#
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
</isNotEmpty>
...
@@ -129,6 +133,7 @@
...
@@ -129,6 +133,7 @@
WEIGHT,
<!-- 重量 -->
WEIGHT,
<!-- 重量 -->
STATUS,
<!-- 状态 -->
STATUS,
<!-- 状态 -->
REMARK,
<!-- 备注 -->
REMARK,
<!-- 备注 -->
KC_ID,
<!-- 库存ID -->
OLD_SALE_NO,
<!-- 原销售单号 -->
OLD_SALE_NO,
<!-- 原销售单号 -->
CREATED_BY,
<!-- 创建人 -->
CREATED_BY,
<!-- 创建人 -->
CREATED_NAME,
<!-- 创建人名称 -->
CREATED_NAME,
<!-- 创建人名称 -->
...
@@ -137,7 +142,7 @@
...
@@ -137,7 +142,7 @@
) VALUES (
) VALUES (
#companyCode#, #depCode#, #receiptDate#, #saleNo#, #whCode#, #whName#,
#companyCode#, #depCode#, #receiptDate#, #saleNo#, #whCode#, #whName#,
#inventType#, #inventCode#, #inventName#, #inventRecordId#, #amount#, #weight#, #status#,
#inventType#, #inventCode#, #inventName#, #inventRecordId#, #amount#, #weight#, #status#,
#remark#, #oldSaleNo#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#
#remark#, #
kcId#, #
oldSaleNo#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#
)
)
</insert>
</insert>
...
...
src/main/java/com/baosight/hpjx/hp/kc/tools/HPKCTools.java
View file @
133f9bd8
...
@@ -24,89 +24,89 @@ public class HPKCTools {
...
@@ -24,89 +24,89 @@ public class HPKCTools {
/**
/**
* 锁
* 锁
*
*
* @param
check
Nos
* @param
otherEnter
Nos
* @return
* @return
*/
*/
public
static
void
lockKc00
5
(
List
<
String
>
check
Nos
)
{
public
static
void
lockKc00
1
(
List
<
String
>
otherEnter
Nos
)
{
if
(
CollectionUtils
.
isEmpty
(
check
Nos
))
{
if
(
CollectionUtils
.
isEmpty
(
otherEnter
Nos
))
{
return
;
return
;
}
}
Map
queryMap
=
new
HashMap
();
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"
checkNos"
,
check
Nos
);
queryMap
.
put
(
"
otherEnterNos"
,
otherEnter
Nos
);
DaoBase
.
getInstance
().
update
(
HPSqlConstant
.
HPKC00
5
.
LOCK
,
queryMap
);
DaoBase
.
getInstance
().
update
(
HPSqlConstant
.
HPKC00
1
.
LOCK
,
queryMap
);
}
}
/**
/**
* 查询
盘点单
信息
* 查询
其他入库
信息
*
*
* @param
check
Nos
* @param
otherEnter
Nos
* @return
* @return
*/
*/
public
static
List
<
HPKC00
5
>
listKc005
(
List
<
String
>
check
Nos
)
{
public
static
List
<
HPKC00
1
>
listKc001
(
List
<
String
>
otherEnter
Nos
)
{
if
(
CollectionUtils
.
isEmpty
(
check
Nos
))
{
if
(
CollectionUtils
.
isEmpty
(
otherEnter
Nos
))
{
return
null
;
return
null
;
}
}
Map
queryMap
=
new
HashMap
();
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"
checkNos"
,
check
Nos
);
queryMap
.
put
(
"
otherEnterNos"
,
otherEnter
Nos
);
return
DaoBase
.
getInstance
().
query
(
HPKC00
5
.
QUERY
,
queryMap
);
return
DaoBase
.
getInstance
().
query
(
HPKC00
1
.
QUERY
,
queryMap
);
}
}
/**
/**
* 查询
盘点单
信息
* 查询
其他入库
信息
*
*
* @param
check
Nos
* @param
otherEnter
Nos
* @return
* @return
*/
*/
public
static
Map
<
String
,
HPKC00
5
>
mapKc005
(
List
<
String
>
check
Nos
)
{
public
static
Map
<
String
,
HPKC00
1
>
mapKc001
(
List
<
String
>
otherEnter
Nos
)
{
List
<
HPKC00
5
>
results
=
listKc005
(
check
Nos
);
List
<
HPKC00
1
>
results
=
listKc001
(
otherEnter
Nos
);
if
(
CollectionUtils
.
isEmpty
(
results
))
{
if
(
CollectionUtils
.
isEmpty
(
results
))
{
return
null
;
return
null
;
}
}
return
results
.
stream
().
collect
(
Collectors
.
toMap
(
HPKC00
5:
:
getCheck
No
,
item
->
item
));
return
results
.
stream
().
collect
(
Collectors
.
toMap
(
HPKC00
1:
:
getPurchase
No
,
item
->
item
));
}
}
/**
/**
* 锁
* 锁
*
*
* @param
otherEnter
Nos
* @param
req
Nos
* @return
* @return
*/
*/
public
static
void
lockKc00
1
(
List
<
String
>
otherEnter
Nos
)
{
public
static
void
lockKc00
2
(
List
<
String
>
req
Nos
)
{
if
(
CollectionUtils
.
isEmpty
(
otherEnter
Nos
))
{
if
(
CollectionUtils
.
isEmpty
(
req
Nos
))
{
return
;
return
;
}
}
Map
queryMap
=
new
HashMap
();
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"
otherEnterNos"
,
otherEnter
Nos
);
queryMap
.
put
(
"
reqNos"
,
req
Nos
);
DaoBase
.
getInstance
().
update
(
HPSqlConstant
.
HPKC00
1
.
LOCK
,
queryMap
);
DaoBase
.
getInstance
().
update
(
HPSqlConstant
.
HPKC00
2
.
LOCK
,
queryMap
);
}
}
/**
/**
* 查询
其他入库
信息
* 查询
生产领料
信息
*
*
* @param
otherEnter
Nos
* @param
req
Nos
* @return
* @return
*/
*/
public
static
List
<
HPKC00
1
>
listKc001
(
List
<
String
>
otherEnter
Nos
)
{
public
static
List
<
HPKC00
2
>
listKc002
(
List
<
String
>
req
Nos
)
{
if
(
CollectionUtils
.
isEmpty
(
otherEnter
Nos
))
{
if
(
CollectionUtils
.
isEmpty
(
req
Nos
))
{
return
null
;
return
null
;
}
}
Map
queryMap
=
new
HashMap
();
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"
otherEnterNos"
,
otherEnter
Nos
);
queryMap
.
put
(
"
reqNos"
,
req
Nos
);
return
DaoBase
.
getInstance
().
query
(
HPKC00
1
.
QUERY
,
queryMap
);
return
DaoBase
.
getInstance
().
query
(
HPKC00
2
.
QUERY
,
queryMap
);
}
}
/**
/**
* 查询
其他入库
信息
* 查询
生产领料
信息
*
*
* @param
otherEnter
Nos
* @param
req
Nos
* @return
* @return
*/
*/
public
static
Map
<
String
,
HPKC00
1
>
mapKc001
(
List
<
String
>
otherEnter
Nos
)
{
public
static
Map
<
String
,
HPKC00
2
>
mapKc002
(
List
<
String
>
req
Nos
)
{
List
<
HPKC00
1
>
results
=
listKc001
(
otherEnter
Nos
);
List
<
HPKC00
2
>
results
=
listKc002
(
req
Nos
);
if
(
CollectionUtils
.
isEmpty
(
results
))
{
if
(
CollectionUtils
.
isEmpty
(
results
))
{
return
null
;
return
null
;
}
}
return
results
.
stream
().
collect
(
Collectors
.
toMap
(
HPKC00
1:
:
getPurchase
No
,
item
->
item
));
return
results
.
stream
().
collect
(
Collectors
.
toMap
(
HPKC00
2:
:
getReq
No
,
item
->
item
));
}
}
/**
/**
...
@@ -156,6 +156,50 @@ public class HPKCTools {
...
@@ -156,6 +156,50 @@ public class HPKCTools {
/**
/**
* 锁
* 锁
*
*
* @param checkNos
* @return
*/
public
static
void
lockKc005
(
List
<
String
>
checkNos
)
{
if
(
CollectionUtils
.
isEmpty
(
checkNos
))
{
return
;
}
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"checkNos"
,
checkNos
);
DaoBase
.
getInstance
().
update
(
HPSqlConstant
.
HPKC005
.
LOCK
,
queryMap
);
}
/**
* 查询盘点单信息
*
* @param checkNos
* @return
*/
public
static
List
<
HPKC005
>
listKc005
(
List
<
String
>
checkNos
)
{
if
(
CollectionUtils
.
isEmpty
(
checkNos
))
{
return
null
;
}
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"checkNos"
,
checkNos
);
return
DaoBase
.
getInstance
().
query
(
HPKC005
.
QUERY
,
queryMap
);
}
/**
* 查询盘点单信息
*
* @param checkNos
* @return
*/
public
static
Map
<
String
,
HPKC005
>
mapKc005
(
List
<
String
>
checkNos
)
{
List
<
HPKC005
>
results
=
listKc005
(
checkNos
);
if
(
CollectionUtils
.
isEmpty
(
results
))
{
return
null
;
}
return
results
.
stream
().
collect
(
Collectors
.
toMap
(
HPKC005:
:
getCheckNo
,
item
->
item
));
}
/**
* 锁
*
* @param otherEnterNos
* @param otherEnterNos
* @return
* @return
*/
*/
...
...
src/main/webapp/HP/KC/HPKC002.js
View file @
133f9bd8
This diff is collapsed.
Click to expand it.
src/main/webapp/HP/KC/HPKC002.jsp
View file @
133f9bd8
...
@@ -9,24 +9,24 @@
...
@@ -9,24 +9,24 @@
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<div
class=
"row"
>
<div
class=
"row"
>
<EF:EFDatePicker
ename=
"inqu_status-0-documentTime"
cname=
"单据日期
"
colWidth=
"3"
format=
"yyyy-MM-dd"
<EF:EFDatePicker
cname=
"单据日期"
ename=
"inqu_status-0-receiptDate
"
colWidth=
"3"
format=
"yyyy-MM-dd"
re
quired
=
"true"
/>
re
adonly
=
"true"
/>
<EF:EFInput
ename=
"inqu_status-0-documentCode"
cname=
"生产领料单号"
colWidth=
"3"
readonly=
"false
"
/>
<EF:EFInput
cname=
"领料单号"
ename=
"inqu_status-0-reqNo"
colWidth=
"3
"
/>
<EF:EFSelect
cname=
"存货类型"
ename=
"inqu_status-0-inventType"
colWidth=
"3"
filter=
"contains"
>
<EF:EFSelect
cname=
"存货类型"
ename=
"inqu_status-0-inventType"
colWidth=
"3"
filter=
"contains"
>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFCodeOption
codeName=
"hpjx.hpkc.inventType"
/>
<EF:EFCodeOption
codeName=
"hpjx.hpkc.inventType"
condition=
"ITEM_CODE IN ('1', '2')"
/>
</EF:EFSelect>
</EF:EFSelect>
<EF:EFSelect
cname=
"仓库名称"
ename=
"inqu_status-0-whCode"
colWidth=
"3"
filter=
"contains"
defultValue=
"
"
>
<EF:EFSelect
cname=
"仓库名称"
ename=
"inqu_status-0-whCode"
colWidth=
"3"
filter=
"contains
"
>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFOptions
blockId=
"wh_record_block_id"
textField=
"textField"
valueField=
"valueField"
/>
<EF:EFOptions
blockId=
"wh_record_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFSelect>
</EF:EFSelect>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<EF:EFSelect
cname=
"存货名称"
ename=
"inqu_status-0-inventCode"
colWidth=
"3"
filter=
"contains"
defultValue=
""
>
<EF:EFSelect
cname=
"存货名称"
ename=
"inqu_status-0-inventCode"
colWidth=
"3"
filter=
"contains"
>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFOptions
blockId=
"invent_name_block_id"
textField=
"textField"
valueField=
"valueField"
/>
<EF:EFOptions
blockId=
"invent_name_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFSelect>
</EF:EFSelect>
<EF:EFSelect
cname=
"规格"
ename=
"inqu_status-0-spec"
colWidth=
"3"
filter=
"contains"
defultValue=
""
>
<EF:EFSelect
cname=
"规格"
ename=
"inqu_status-0-spec"
colWidth=
"3"
filter=
"contains"
>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFOptions
blockId=
"spec_name_block_id"
textField=
"textField"
valueField=
"valueField"
/>
<EF:EFOptions
blockId=
"spec_name_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFSelect>
</EF:EFSelect>
...
@@ -44,24 +44,35 @@
...
@@ -44,24 +44,35 @@
</EF:EFRegion>
</EF:EFRegion>
<EF:EFRegion
id=
"result"
title=
"明细信息"
>
<EF:EFRegion
id=
"result"
title=
"明细信息"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"false"
isFloat=
"true"
autoFit=
"true
"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
isFloat=
"true"
checkMode=
"row
"
>
<EF:EFColumn
ename=
"id"
cname=
"主键id"
hidden=
"true"
/>
<EF:EFColumn
ename=
"id"
cname=
"主键id"
hidden=
"true"
/>
<EF:EFColumn
ename=
"documentTime"
cname=
"单据日期"
editType=
"date"
dateFormat=
"yyyy-MM-dd"
parseFormats=
"['yyyy-MM-dd']"
width=
"100"
required=
"true"
/>
<EF:EFColumn
ename=
"reqNo"
cname=
"领料单号"
enable=
"false"
width=
"140"
align=
"center"
/>
<EF:EFColumn
ename=
"reqNo"
cname=
"生产领料单号"
width=
"100"
readonly=
"false"
align=
"center"
required=
"false"
enable=
"false"
/>
<EF:EFColumn
ename=
"receiptDate"
cname=
"单据日期"
enable=
"false"
width=
"90"
align=
"center"
<EF:EFComboColumn
ename=
"materialType"
cname=
"存货类型"
width=
"90"
align=
"center"
>
editType=
"date"
dateFormat=
"yyyy-MM-dd"
parseFormats=
"['yyyyMMdd']"
/>
<EF:EFCodeOption
codeName=
"hpjx.hpkc.inventType"
/>
<EF:EFComboColumn
ename=
"inventType"
cname=
"存货类型"
enable=
"false"
width=
"100"
align=
"center"
>
<EF:EFCodeOption
codeName=
"hpjx.hpkc.inventType"
/>
</EF:EFComboColumn>
<EF:EFComboColumn
ename=
"whCode"
cname=
"仓库编码"
enable=
"false"
width=
"120"
align=
"center"
blockName=
"wh_record_block_id"
textField=
"textField"
valueField=
"valueField"
columnTemplate=
"#=textField#"
itemTemplate=
"#=textField#"
>
</EF:EFComboColumn>
<EF:EFComboColumn
ename=
"inventCode"
cname=
"存货名称"
enable=
"false"
width=
"120"
align=
"center"
blockName=
"invent_name_block_id"
textField=
"textField"
valueField=
"valueField"
columnTemplate=
"#=textField#"
itemTemplate=
"#=textField#"
>
</EF:EFComboColumn>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"whCode"
cname=
"仓库名称"
width=
"100"
readonly=
"false"
required=
"true"
/>
<EF:EFComboColumn
ename=
"inventRecordId"
cname=
"规格"
enable=
"false"
width=
"120"
align=
"center"
<EF:EFColumn
ename=
"whName"
cname=
"仓库名称"
width=
"100"
readonly=
"false"
hidden=
"true"
/>
blockName=
"invent_spec_block_id"
textField=
"textField"
valueField=
"valueField"
<EF:EFColumn
ename=
"materialCode"
cname=
"存货名称"
width=
"100"
readonly=
"false"
required=
"true"
/>
columnTemplate=
"#=textField#"
itemTemplate=
"#=textField#"
>
<EF:EFColumn
ename=
"materialName"
cname=
"存货名称"
width=
"100"
readonly=
"false"
hidden=
"true"
/>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"spec"
cname=
"规格"
width=
"120"
readonly=
"false"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"amount"
cname=
"数量"
enable=
"false"
format=
"{0:N3}"
maxLength=
"20"
width=
"100"
<EF:EFColumn
ename=
"unit"
cname=
"单位"
width=
"80"
readonly=
"false"
align=
"center"
enable=
"false"
required=
"true"
/>
align=
"center"
/>
<EF:EFColumn
ename=
"quantity"
cname=
"数量"
width=
"80"
defaultValue=
"0"
data-regex=
"/^[0-9]\\\d*$/"
data-errorprompt=
"请输入正整数"
readonly=
"false"
align=
"right"
required=
"true"
/>
<EF:EFColumn
ename=
"weight"
cname=
"重量"
enable=
"false"
format=
"{0:N3}"
maxLength=
"20"
width=
"100"
<EF:EFColumn
ename=
"weight"
cname=
"重量"
defaultValue=
"0"
data-rules=
"number"
maxLength=
"20"
width=
"100"
align=
"right"
readonly=
"false"
/>
align=
"center"
/>
<EF:EFColumn
ename=
"remarks"
cname=
"备注"
width=
"100"
readonly=
"false"
/>
<EF:EFColumn
ename=
"remark"
cname=
"备注"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"oldReqNo"
cname=
"原领料单号"
enable=
"false"
width=
"140"
align=
"center"
/>
<EF:EFColumn
ename=
"createdName"
cname=
"创建人"
enable=
"false"
width=
"120"
align=
"center"
/>
<EF:EFColumn
ename=
"createdTime"
cname=
"创建时间"
enable=
"false"
width=
"140"
align=
"center"
editType=
"datetime"
parseFormats=
"['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"
/>
</EF:EFGrid>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFRegion>
</EF:EFPage>
</EF:EFPage>
src/main/webapp/HP/KC/HPKC002A.js
0 → 100644
View file @
133f9bd8
$
(
function
()
{
IPLATUI
.
EFGrid
=
{
"result"
:
{
columns
:
[],
dataBound
:
function
()
{
}
}
};
$
(
"#ef_form_head"
).
hide
();
// 查询
$
(
"#QUERY"
).
on
(
"click"
,
query
);
// 选择
$
(
"#BTN_SELECT"
).
on
(
"click"
,
select
);
});
/**
* 页面加载时执行
*/
$
(
window
).
load
(
function
()
{
// 初始化查询
query
();
});
/**
* 查询
*/
var
query
=
function
(
e
)
{
resultGrid
.
dataSource
.
page
(
1
);
};
/**
* 选择库存
*/
let
select
=
function
()
{
let
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
<
1
)
{
message
(
"请选择数据"
)
return
;
}
for
(
let
i
=
0
;
i
<
rows
.
length
;
i
++
)
{
let
applyAmount
=
rows
[
i
][
'applyAmount'
];
let
applyWeight
=
rows
[
i
][
'applyWeight'
];
let
amount
=
rows
[
i
][
'amount'
];
let
weight
=
rows
[
i
][
'weight'
];
if
(
isBlank
(
applyAmount
)
||
!
isNumber
(
applyAmount
)
||
!
(
applyAmount
>
0
))
{
message
(
"第"
+
(
i
+
1
)
+
"行申请数量必须大于0"
);
return
;
}
if
(
parseFloat
(
applyAmount
)
>
parseFloat
(
amount
))
{
message
(
"第"
+
(
i
+
1
)
+
"行申请数量不能大于库存数量"
);
return
;
}
if
(
isBlank
(
applyWeight
)
||
!
isNumber
(
applyWeight
)
||
!
(
applyWeight
>
0
))
{
message
(
"第"
+
(
i
+
1
)
+
"行申请重量必须大于0"
);
return
;
}
if
(
parseFloat
(
applyWeight
)
>
parseFloat
(
weight
))
{
message
(
"第"
+
(
i
+
1
)
+
"行申请重量不能大于库存重量"
);
return
;
}
}
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据生成出库单吗? "
,
{
ok
:
function
()
{
JSUtils
.
submitGridsData
(
"result"
,
"HPKC002A"
,
"select"
,
true
,
function
(
e
)
{
var
status
=
e
.
getStatus
();
if
(
status
!==
-
1
)
{
parent
.
JSColorbox
.
setValueCallback
();
}
}
);
}
});
}
src/main/webapp/HP/KC/HPKC002A.jsp
0 → 100644
View file @
133f9bd8
<!DOCTYPE html>
<
%@
page
contentType=
"text/html; charset=UTF-8"
%
>
<
%@
taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%
>
<
%@
taglib
prefix=
"EF"
tagdir=
"/WEB-INF/tags/EF"
%
>
<c:set
var=
"ctx"
value=
"${pageContext.request.contextPath}"
/>
<EF:EFPage
title=
"库存查询"
>
<EF:EFRegion
id=
"inqu"
title=
"查询区域"
type=
"query"
>
<div
class=
"row"
>
<EF:EFSelect
cname=
"存货类型"
ename=
"inqu_status-0-inventType"
colWidth=
"3"
filter=
"contains"
>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFCodeOption
codeName=
"hpjx.hpkc.inventType"
condition=
"ITEM_CODE IN ('1', '2')"
/>
</EF:EFSelect>
<EF:EFSelect
cname=
"仓库名称"
ename=
"inqu_status-0-whCode"
colWidth=
"3"
filter=
"contains"
>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFOptions
blockId=
"wh_record_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFSelect>
<EF:EFSelect
cname=
"存货名称"
ename=
"inqu_status-0-inventCode"
colWidth=
"3"
filter=
"contains"
>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFOptions
blockId=
"invent_name_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFSelect>
<EF:EFSelect
ename=
"inqu_status-0-spec"
cname=
"规格"
colWidth=
"3"
filter=
"contains"
>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFOptions
blockId=
"spec_name_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion
id=
"result"
title=
"记录集"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
checkMode=
"row"
>
<EF:EFColumn
ename=
"id"
cname=
"库存ID"
enable=
"false"
width=
"60"
align=
"center"
/>
<EF:EFComboColumn
ename=
"inventType"
cname=
"存货类型"
enable=
"false"
width=
"100"
align=
"center"
>
<EF:EFCodeOption
codeName=
"hpjx.hpkc.inventType"
/>
</EF:EFComboColumn>
<EF:EFComboColumn
ename=
"whCode"
cname=
"仓库名称"
enable=
"false"
width=
"120"
align=
"center"
blockName=
"wh_record_block_id"
textField=
"textField"
valueField=
"valueField"
columnTemplate=
"#=textField#"
itemTemplate=
"#=textField#"
>
</EF:EFComboColumn>
<EF:EFComboColumn
ename=
"inventCode"
cname=
"存货名称"
enable=
"false"
width=
"120"
align=
"center"
blockName=
"invent_name_block_id"
textField=
"textField"
valueField=
"valueField"
columnTemplate=
"#=textField#"
itemTemplate=
"#=textField#"
>
</EF:EFComboColumn>
<EF:EFComboColumn
ename=
"inventRecordId"
cname=
"规格"
enable=
"false"
width=
"120"
align=
"center"
blockName=
"invent_spec_block_id"
textField=
"textField"
valueField=
"valueField"
columnTemplate=
"#=textField#"
itemTemplate=
"#=textField#"
>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"applyAmount"
cname=
"申请数量"
width=
"120"
align=
"right"
format=
"{0:N3}"
required=
"true"
/>
<EF:EFColumn
ename=
"applyWeight"
cname=
"申请重量"
width=
"120"
align=
"right"
format=
"{0:N3}"
required=
"true"
/>
<EF:EFColumn
ename=
"applyRemark"
cname=
"说明"
width=
"150"
editType=
"textarea"
copy=
"true"
/>
<EF:EFColumn
ename=
"amount"
cname=
"库存数量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
sumType=
"all"
/>
<EF:EFColumn
ename=
"weight"
cname=
"库存重量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
sumType=
"all"
/>
<EF:EFColumn
ename=
"remark"
cname=
"备注"
enable=
"false"
width=
"150"
/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
src/main/webapp/HP/KC/HPKC004A.jsp
View file @
133f9bd8
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
</EF:EFComboColumn>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"applyAmount"
cname=
"申请数量"
width=
"120"
align=
"right"
format=
"{0:N3}"
required=
"true"
/>
<EF:EFColumn
ename=
"applyAmount"
cname=
"申请数量"
width=
"120"
align=
"right"
format=
"{0:N3}"
required=
"true"
/>
<EF:EFColumn
ename=
"applyWeight"
cname=
"申请重量"
width=
"120"
align=
"right"
format=
"{0:N3}"
required=
"true"
/>
<EF:EFColumn
ename=
"applyWeight"
cname=
"申请重量"
width=
"120"
align=
"right"
format=
"{0:N3}"
required=
"true"
/>
<EF:EFColumn
ename=
"applyRemark"
cname=
"说明"
enable=
"false"
width=
"150"
editType=
"textarea"
copy=
"true"
/>
<EF:EFColumn
ename=
"applyRemark"
cname=
"说明"
width=
"150"
editType=
"textarea"
copy=
"true"
/>
<EF:EFColumn
ename=
"amount"
cname=
"库存数量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
<EF:EFColumn
ename=
"amount"
cname=
"库存数量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
sumType=
"all"
/>
sumType=
"all"
/>
<EF:EFColumn
ename=
"weight"
cname=
"库存重量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
<EF:EFColumn
ename=
"weight"
cname=
"库存重量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
...
...
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