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
f7796178
Commit
f7796178
authored
Jan 31, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.销售出库逻辑关联生产任务
parent
c4e7d5a0
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
618 additions
and
456 deletions
+618
-456
HPSqlConstant.java
...ain/java/com/baosight/hpjx/hp/constant/HPSqlConstant.java
+2
-0
HPKC004.java
src/main/java/com/baosight/hpjx/hp/kc/domain/HPKC004.java
+264
-78
ServiceHPKC002A.java
...java/com/baosight/hpjx/hp/kc/service/ServiceHPKC002A.java
+2
-2
ServiceHPKC004.java
.../java/com/baosight/hpjx/hp/kc/service/ServiceHPKC004.java
+5
-5
ServiceHPKC004A.java
...java/com/baosight/hpjx/hp/kc/service/ServiceHPKC004A.java
+4
-4
ServiceHPKC005A.java
...java/com/baosight/hpjx/hp/kc/service/ServiceHPKC005A.java
+2
-2
ServiceHPKC007A.java
...java/com/baosight/hpjx/hp/kc/service/ServiceHPKC007A.java
+2
-2
ServiceHPKC009.java
.../java/com/baosight/hpjx/hp/kc/service/ServiceHPKC009.java
+2
-206
HPKC004.xml
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC004.xml
+84
-32
CKExcelTools.java
...main/java/com/baosight/hpjx/hp/kc/tools/CKExcelTools.java
+98
-73
HPKCTools.java
src/main/java/com/baosight/hpjx/hp/kc/tools/HPKCTools.java
+57
-8
StringUtils.java
src/main/java/com/baosight/hpjx/util/StringUtils.java
+19
-0
HPKC004.js
src/main/webapp/HP/KC/HPKC004.js
+31
-0
HPKC004.jsp
src/main/webapp/HP/KC/HPKC004.jsp
+38
-41
HPKC90.jsp
src/main/webapp/HP/KC/HPKC90.jsp
+8
-3
No files found.
src/main/java/com/baosight/hpjx/hp/constant/HPSqlConstant.java
View file @
f7796178
...
...
@@ -58,6 +58,8 @@ public class HPSqlConstant {
public
static
final
String
STAT_DATE
=
"HPKC004.statDate"
;
// 锁
public
static
final
String
LOCK
=
"HPKC004.lock"
;
// 修改打印状态
public
static
final
String
UPDATE_PRINT
=
"HPKC004.updatePrint"
;
}
/**
...
...
src/main/java/com/baosight/hpjx/hp/kc/domain/HPKC004.java
View file @
f7796178
...
...
@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-01-
25 22:17:45
create
* @history 2024-01-
31 17:22:56
create
*/
public
class
HPKC004
extends
DaoEPBase
{
...
...
@@ -29,16 +29,23 @@ public class HPKC004 extends DaoEPBase {
public
static
final
String
FIELD_SALE_NO
=
"saleNo"
;
/* 销售单号*/
public
static
final
String
FIELD_WH_CODE
=
"whCode"
;
/* 仓库编码*/
public
static
final
String
FIELD_WH_NAME
=
"whName"
;
/* 仓库名称*/
public
static
final
String
FIELD_INVENT_TYPE
=
"inventType"
;
/* 存货类型*/
public
static
final
String
FIELD_INVENT_CODE
=
"inventCode"
;
/* 存货编码*/
public
static
final
String
FIELD_INVENT_NAME
=
"inventName"
;
/* 存货名称*/
public
static
final
String
FIELD_INVENT_RECORD_ID
=
"inventRecordId"
;
/* 规格*/
public
static
final
String
FIELD_PROD_NO
=
"prodNo"
;
/* 生产订单号*/
public
static
final
String
FIELD_PROJ_CODE
=
"projCode"
;
/* 项目号*/
public
static
final
String
FIELD_PROJ_NAME
=
"projName"
;
/* 项目名称*/
public
static
final
String
FIELD_INVENT_CODE
=
"inventCode"
;
/* 部件编码*/
public
static
final
String
FIELD_INVENT_NAME
=
"inventName"
;
/* 部件名称*/
public
static
final
String
FIELD_SUB_INVENT_CODE
=
"subInventCode"
;
/* 零部件编码*/
public
static
final
String
FIELD_SUB_INVENT_NAME
=
"subInventName"
;
/* 零部件名称*/
public
static
final
String
FIELD_LENGTH
=
"length"
;
/* 长*/
public
static
final
String
FIELD_WIDTH
=
"width"
;
/* 宽*/
public
static
final
String
FIELD_THICK
=
"thick"
;
/* 厚*/
public
static
final
String
FIELD_AMOUNT
=
"amount"
;
/* 数量*/
public
static
final
String
FIELD_UNIT_WEIGHT
=
"unitWeight"
;
/* 单重*/
public
static
final
String
FIELD_WEIGHT
=
"weight"
;
/* 重量*/
public
static
final
String
FIELD_STATUS
=
"status"
;
/* 状态*/
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_IS_PRINT
=
"isPrint"
;
/* 是否打印:0.否1.是*/
public
static
final
String
FIELD_CREATED_BY
=
"createdBy"
;
/* 创建人*/
public
static
final
String
FIELD_CREATED_NAME
=
"createdName"
;
/* 创建人名称*/
public
static
final
String
FIELD_CREATED_TIME
=
"createdTime"
;
/* 创建时间*/
...
...
@@ -54,16 +61,23 @@ public class HPKC004 extends DaoEPBase {
public
static
final
String
COL_SALE_NO
=
"SALE_NO"
;
/* 销售单号*/
public
static
final
String
COL_WH_CODE
=
"WH_CODE"
;
/* 仓库编码*/
public
static
final
String
COL_WH_NAME
=
"WH_NAME"
;
/* 仓库名称*/
public
static
final
String
COL_INVENT_TYPE
=
"INVENT_TYPE"
;
/* 存货类型*/
public
static
final
String
COL_INVENT_CODE
=
"INVENT_CODE"
;
/* 存货编码*/
public
static
final
String
COL_INVENT_NAME
=
"INVENT_NAME"
;
/* 存货名称*/
public
static
final
String
COL_INVENT_RECORD_ID
=
"INVENT_RECORD_ID"
;
/* 规格*/
public
static
final
String
COL_PROD_NO
=
"PROD_NO"
;
/* 生产订单号*/
public
static
final
String
COL_PROJ_CODE
=
"PROJ_CODE"
;
/* 项目号*/
public
static
final
String
COL_PROJ_NAME
=
"PROJ_NAME"
;
/* 项目名称*/
public
static
final
String
COL_INVENT_CODE
=
"INVENT_CODE"
;
/* 部件编码*/
public
static
final
String
COL_INVENT_NAME
=
"INVENT_NAME"
;
/* 部件名称*/
public
static
final
String
COL_SUB_INVENT_CODE
=
"SUB_INVENT_CODE"
;
/* 零部件编码*/
public
static
final
String
COL_SUB_INVENT_NAME
=
"SUB_INVENT_NAME"
;
/* 零部件名称*/
public
static
final
String
COL_LENGTH
=
"LENGTH"
;
/* 长*/
public
static
final
String
COL_WIDTH
=
"WIDTH"
;
/* 宽*/
public
static
final
String
COL_THICK
=
"THICK"
;
/* 厚*/
public
static
final
String
COL_AMOUNT
=
"AMOUNT"
;
/* 数量*/
public
static
final
String
COL_UNIT_WEIGHT
=
"UNIT_WEIGHT"
;
/* 单重*/
public
static
final
String
COL_WEIGHT
=
"WEIGHT"
;
/* 重量*/
public
static
final
String
COL_STATUS
=
"STATUS"
;
/* 状态*/
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_IS_PRINT
=
"IS_PRINT"
;
/* 是否打印:0.否1.是*/
public
static
final
String
COL_CREATED_BY
=
"CREATED_BY"
;
/* 创建人*/
public
static
final
String
COL_CREATED_NAME
=
"CREATED_NAME"
;
/* 创建人名称*/
public
static
final
String
COL_CREATED_TIME
=
"CREATED_TIME"
;
/* 创建时间*/
...
...
@@ -78,23 +92,30 @@ public class HPKC004 extends DaoEPBase {
public
static
final
String
UPDATE
=
"HPKC004.update"
;
public
static
final
String
DELETE
=
"HPKC004.delete"
;
private
Long
id
=
null
;
/* ID*/
private
Long
id
;
/* ID*/
private
String
companyCode
=
" "
;
/* 企业编码 预留*/
private
String
depCode
=
" "
;
/* 部门编码 预留*/
private
String
receiptDate
=
" "
;
/* 票据日期*/
private
String
saleNo
=
" "
;
/* 销售单号*/
private
String
whCode
=
" "
;
/* 仓库编码*/
private
String
whName
=
" "
;
/* 仓库名称*/
private
String
inventType
=
" "
;
/* 存货类型*/
private
String
inventCode
=
" "
;
/* 存货编码*/
private
String
inventName
=
" "
;
/* 存货名称*/
private
Long
inventRecordId
=
null
;
/* 规格*/
private
BigDecimal
amount
=
new
BigDecimal
(
0
);
/* 数量*/
private
BigDecimal
weight
=
new
BigDecimal
(
0
);
/* 重量*/
private
Integer
status
;
/* 状态*/
private
String
prodNo
=
" "
;
/* 生产订单号*/
private
String
projCode
=
" "
;
/* 项目号*/
private
String
projName
=
" "
;
/* 项目名称*/
private
String
inventCode
=
" "
;
/* 部件编码*/
private
String
inventName
=
" "
;
/* 部件名称*/
private
String
subInventCode
=
" "
;
/* 零部件编码*/
private
String
subInventName
=
" "
;
/* 零部件名称*/
private
BigDecimal
length
=
new
BigDecimal
(
"0"
);
/* 长*/
private
BigDecimal
width
=
new
BigDecimal
(
"0"
);
/* 宽*/
private
BigDecimal
thick
=
new
BigDecimal
(
"0"
);
/* 厚*/
private
BigDecimal
amount
=
new
BigDecimal
(
0.000
);
/* 数量*/
private
BigDecimal
unitWeight
=
new
BigDecimal
(
0.000
);
/* 单重*/
private
BigDecimal
weight
=
new
BigDecimal
(
0.000
);
/* 重量*/
private
String
remark
=
" "
;
/* 备注*/
private
Long
kcId
=
new
Long
(
0
)
;
/* 库存ID*/
private
Long
kcId
;
/* 库存ID*/
private
String
oldSaleNo
=
" "
;
/* 原销售单号*/
private
Integer
isPrint
;
/* 是否打印:0.否1.是*/
private
String
createdBy
=
" "
;
/* 创建人*/
private
String
createdName
=
" "
;
/* 创建人名称*/
private
String
createdTime
=
" "
;
/* 创建时间*/
...
...
@@ -138,38 +159,74 @@ public class HPKC004 extends DaoEPBase {
eiColumn
.
setDescName
(
"仓库名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_INVENT_TYPE
);
eiColumn
.
setDescName
(
"存货类型"
);
eiColumn
=
new
EiColumn
(
FIELD_PROD_NO
);
eiColumn
.
setDescName
(
"生产订单号"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_PROJ_CODE
);
eiColumn
.
setDescName
(
"项目号"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_PROJ_NAME
);
eiColumn
.
setDescName
(
"项目名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_INVENT_CODE
);
eiColumn
.
setDescName
(
"
存货
编码"
);
eiColumn
.
setDescName
(
"
部件
编码"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_INVENT_NAME
);
eiColumn
.
setDescName
(
"
存货
名称"
);
eiColumn
.
setDescName
(
"
部件
名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_
INVENT_RECORD_ID
);
eiColumn
.
setDescName
(
"
规格
"
);
eiColumn
=
new
EiColumn
(
FIELD_
SUB_INVENT_CODE
);
eiColumn
.
setDescName
(
"
零部件编码
"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_AMOUNT
);
eiColumn
=
new
EiColumn
(
FIELD_SUB_INVENT_NAME
);
eiColumn
.
setDescName
(
"零部件名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_LENGTH
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
0
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
12
);
eiColumn
.
setDescName
(
"
数量
"
);
eiColumn
.
setDescName
(
"
长
"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_W
EIGHT
);
eiColumn
=
new
EiColumn
(
FIELD_W
IDTH
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
0
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
12
);
eiColumn
.
setDescName
(
"
重量
"
);
eiColumn
.
setDescName
(
"
宽
"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_STATUS
);
eiColumn
.
setDescName
(
"状态"
);
eiColumn
=
new
EiColumn
(
FIELD_THICK
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
12
);
eiColumn
.
setDescName
(
"厚"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_AMOUNT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
15
);
eiColumn
.
setDescName
(
"数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_UNIT_WEIGHT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
15
);
eiColumn
.
setDescName
(
"单重"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_WEIGHT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
15
);
eiColumn
.
setDescName
(
"重量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_REMARK
);
...
...
@@ -184,6 +241,10 @@ public class HPKC004 extends DaoEPBase {
eiColumn
.
setDescName
(
"原销售单号"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_IS_PRINT
);
eiColumn
.
setDescName
(
"是否打印:0.否1.是"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_CREATED_BY
);
eiColumn
.
setDescName
(
"创建人"
);
eiMetadata
.
addMeta
(
eiColumn
);
...
...
@@ -335,23 +396,55 @@ public class HPKC004 extends DaoEPBase {
this
.
whName
=
whName
;
}
/**
* get the inventType - 存货类型.
* @return the inventType
* get the prodNo - 生产订单号.
* @return the prodNo
*/
public
String
getProdNo
()
{
return
this
.
prodNo
;
}
/**
* set the prodNo - 生产订单号.
*
* @param prodNo - 生产订单号
*/
public
void
setProdNo
(
String
prodNo
)
{
this
.
prodNo
=
prodNo
;
}
/**
* get the projCode - 项目号.
* @return the projCode
*/
public
String
getProjCode
()
{
return
this
.
projCode
;
}
/**
* set the projCode - 项目号.
*
* @param projCode - 项目号
*/
public
void
setProjCode
(
String
projCode
)
{
this
.
projCode
=
projCode
;
}
/**
* get the projName - 项目名称.
* @return the projName
*/
public
String
get
InventTyp
e
()
{
return
this
.
inventTyp
e
;
public
String
get
ProjNam
e
()
{
return
this
.
projNam
e
;
}
/**
* set the
inventType - 存货类型
.
* set the
projName - 项目名称
.
*
* @param
inventType - 存货类型
* @param
projName - 项目名称
*/
public
void
set
InventType
(
String
inventTyp
e
)
{
this
.
inventType
=
inventTyp
e
;
public
void
set
ProjName
(
String
projNam
e
)
{
this
.
projName
=
projNam
e
;
}
/**
* get the inventCode -
存货
编码.
* get the inventCode -
部件
编码.
* @return the inventCode
*/
public
String
getInventCode
()
{
...
...
@@ -359,15 +452,15 @@ public class HPKC004 extends DaoEPBase {
}
/**
* set the inventCode -
存货
编码.
* set the inventCode -
部件
编码.
*
* @param inventCode -
存货
编码
* @param inventCode -
部件
编码
*/
public
void
setInventCode
(
String
inventCode
)
{
this
.
inventCode
=
inventCode
;
}
/**
* get the inventName -
存货
名称.
* get the inventName -
部件
名称.
* @return the inventName
*/
public
String
getInventName
()
{
...
...
@@ -375,29 +468,92 @@ public class HPKC004 extends DaoEPBase {
}
/**
* set the inventName -
存货
名称.
* set the inventName -
部件
名称.
*
* @param inventName -
存货
名称
* @param inventName -
部件
名称
*/
public
void
setInventName
(
String
inventName
)
{
this
.
inventName
=
inventName
;
}
/**
* get the subInventCode - 零部件编码.
* @return the subInventCode
*/
public
String
getSubInventCode
()
{
return
this
.
subInventCode
;
}
/**
* set the subInventCode - 零部件编码.
*
* @param subInventCode - 零部件编码
*/
public
void
setSubInventCode
(
String
subInventCode
)
{
this
.
subInventCode
=
subInventCode
;
}
/**
* get the subInventName - 零部件名称.
* @return the subInventName
*/
public
String
getSubInventName
()
{
return
this
.
subInventName
;
}
/**
* set the subInventName - 零部件名称.
*
* @param subInventName - 零部件名称
*/
public
void
setSubInventName
(
String
subInventName
)
{
this
.
subInventName
=
subInventName
;
}
/**
* get the length - 长.
* @return the length
*/
public
BigDecimal
getLength
()
{
return
this
.
length
;
}
/**
* get the inventRecordId - 规格.
* @return the inventRecordId
* set the length - 长.
*
* @param length - 长
*/
public
void
setLength
(
BigDecimal
length
)
{
this
.
length
=
length
;
}
/**
* get the width - 宽.
* @return the width
*/
public
BigDecimal
getWidth
()
{
return
this
.
width
;
}
/**
* set the width - 宽.
*
* @param width - 宽
*/
public
void
setWidth
(
BigDecimal
width
)
{
this
.
width
=
width
;
}
/**
* get the thick - 厚.
* @return the thick
*/
public
Long
getInventRecordId
()
{
return
this
.
inventRecordId
;
public
BigDecimal
getThick
()
{
return
this
.
thick
;
}
/**
* set the
inventRecordId - 规格
.
* set the
thick - 厚
.
*
* @param
inventRecordId - 规格
* @param
thick - 厚
*/
public
void
set
InventRecordId
(
Long
inventRecordId
)
{
this
.
inventRecordId
=
inventRecordId
;
public
void
set
Thick
(
BigDecimal
thick
)
{
this
.
thick
=
thick
;
}
/**
* get the amount - 数量.
...
...
@@ -416,36 +572,36 @@ public class HPKC004 extends DaoEPBase {
this
.
amount
=
amount
;
}
/**
* get the
weight - 重量
.
* @return the
w
eight
* get the
unitWeight - 单重
.
* @return the
unitW
eight
*/
public
BigDecimal
getWeight
()
{
return
this
.
w
eight
;
public
BigDecimal
get
Unit
Weight
()
{
return
this
.
unitW
eight
;
}
/**
* set the
weight - 重量
.
* set the
unitWeight - 单重
.
*
* @param
weight - 重量
* @param
unitWeight - 单重
*/
public
void
set
Weight
(
BigDecimal
w
eight
)
{
this
.
weight
=
w
eight
;
public
void
set
UnitWeight
(
BigDecimal
unitW
eight
)
{
this
.
unitWeight
=
unitW
eight
;
}
/**
* get the
status - 状态
.
* @return the
status
* get the
weight - 重量
.
* @return the
weight
*/
public
Integer
getStatus
()
{
return
this
.
status
;
public
BigDecimal
getWeight
()
{
return
this
.
weight
;
}
/**
* set the
status - 状态
.
* set the
weight - 重量
.
*
* @param
status - 状态
* @param
weight - 重量
*/
public
void
set
Status
(
Integer
status
)
{
this
.
status
=
status
;
public
void
set
Weight
(
BigDecimal
weight
)
{
this
.
weight
=
weight
;
}
/**
* get the remark - 备注.
...
...
@@ -496,6 +652,22 @@ public class HPKC004 extends DaoEPBase {
this
.
oldSaleNo
=
oldSaleNo
;
}
/**
* get the isPrint - 是否打印:0.否1.是.
* @return the isPrint
*/
public
Integer
getIsPrint
()
{
return
this
.
isPrint
;
}
/**
* set the isPrint - 是否打印:0.否1.是.
*
* @param isPrint - 是否打印:0.否1.是
*/
public
void
setIsPrint
(
Integer
isPrint
)
{
this
.
isPrint
=
isPrint
;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
...
...
@@ -622,16 +794,23 @@ public class HPKC004 extends DaoEPBase {
setSaleNo
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_SALE_NO
)),
saleNo
));
setWhCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_WH_CODE
)),
whCode
));
setWhName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_WH_NAME
)),
whName
));
setInventType
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_INVENT_TYPE
)),
inventType
));
setProdNo
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_PROD_NO
)),
prodNo
));
setProjCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_PROJ_CODE
)),
projCode
));
setProjName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_PROJ_NAME
)),
projName
));
setInventCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_INVENT_CODE
)),
inventCode
));
setInventName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_INVENT_NAME
)),
inventName
));
setInventRecordId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_INVENT_RECORD_ID
)),
inventRecordId
));
setSubInventCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_SUB_INVENT_CODE
)),
subInventCode
));
setSubInventName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_SUB_INVENT_NAME
)),
subInventName
));
setLength
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_LENGTH
)),
length
));
setWidth
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_WIDTH
)),
width
));
setThick
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_THICK
)),
thick
));
setAmount
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_AMOUNT
)),
amount
));
setUnitWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_UNIT_WEIGHT
)),
unitWeight
));
setWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_WEIGHT
)),
weight
));
setStatus
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_STATUS
)),
status
));
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
));
setIsPrint
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_IS_PRINT
)),
isPrint
));
setCreatedBy
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_CREATED_BY
)),
createdBy
));
setCreatedName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_CREATED_NAME
)),
createdName
));
setCreatedTime
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_CREATED_TIME
)),
createdTime
));
...
...
@@ -655,16 +834,23 @@ public class HPKC004 extends DaoEPBase {
map
.
put
(
FIELD_SALE_NO
,
StringUtils
.
toString
(
saleNo
,
eiMetadata
.
getMeta
(
FIELD_SALE_NO
)));
map
.
put
(
FIELD_WH_CODE
,
StringUtils
.
toString
(
whCode
,
eiMetadata
.
getMeta
(
FIELD_WH_CODE
)));
map
.
put
(
FIELD_WH_NAME
,
StringUtils
.
toString
(
whName
,
eiMetadata
.
getMeta
(
FIELD_WH_NAME
)));
map
.
put
(
FIELD_INVENT_TYPE
,
StringUtils
.
toString
(
inventType
,
eiMetadata
.
getMeta
(
FIELD_INVENT_TYPE
)));
map
.
put
(
FIELD_PROD_NO
,
StringUtils
.
toString
(
prodNo
,
eiMetadata
.
getMeta
(
FIELD_PROD_NO
)));
map
.
put
(
FIELD_PROJ_CODE
,
StringUtils
.
toString
(
projCode
,
eiMetadata
.
getMeta
(
FIELD_PROJ_CODE
)));
map
.
put
(
FIELD_PROJ_NAME
,
StringUtils
.
toString
(
projName
,
eiMetadata
.
getMeta
(
FIELD_PROJ_NAME
)));
map
.
put
(
FIELD_INVENT_CODE
,
StringUtils
.
toString
(
inventCode
,
eiMetadata
.
getMeta
(
FIELD_INVENT_CODE
)));
map
.
put
(
FIELD_INVENT_NAME
,
StringUtils
.
toString
(
inventName
,
eiMetadata
.
getMeta
(
FIELD_INVENT_NAME
)));
map
.
put
(
FIELD_INVENT_RECORD_ID
,
StringUtils
.
toString
(
inventRecordId
,
eiMetadata
.
getMeta
(
FIELD_INVENT_RECORD_ID
)));
map
.
put
(
FIELD_SUB_INVENT_CODE
,
StringUtils
.
toString
(
subInventCode
,
eiMetadata
.
getMeta
(
FIELD_SUB_INVENT_CODE
)));
map
.
put
(
FIELD_SUB_INVENT_NAME
,
StringUtils
.
toString
(
subInventName
,
eiMetadata
.
getMeta
(
FIELD_SUB_INVENT_NAME
)));
map
.
put
(
FIELD_LENGTH
,
StringUtils
.
toString
(
length
,
eiMetadata
.
getMeta
(
FIELD_LENGTH
)));
map
.
put
(
FIELD_WIDTH
,
StringUtils
.
toString
(
width
,
eiMetadata
.
getMeta
(
FIELD_WIDTH
)));
map
.
put
(
FIELD_THICK
,
StringUtils
.
toString
(
thick
,
eiMetadata
.
getMeta
(
FIELD_THICK
)));
map
.
put
(
FIELD_AMOUNT
,
StringUtils
.
toString
(
amount
,
eiMetadata
.
getMeta
(
FIELD_AMOUNT
)));
map
.
put
(
FIELD_UNIT_WEIGHT
,
StringUtils
.
toString
(
unitWeight
,
eiMetadata
.
getMeta
(
FIELD_UNIT_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_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_IS_PRINT
,
StringUtils
.
toString
(
isPrint
,
eiMetadata
.
getMeta
(
FIELD_IS_PRINT
)));
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_TIME
,
StringUtils
.
toString
(
createdTime
,
eiMetadata
.
getMeta
(
FIELD_CREATED_TIME
)));
...
...
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC002A.java
View file @
f7796178
...
...
@@ -91,9 +91,9 @@ public class ServiceHPKC002A extends ServiceEPBase {
// 库存ID
List
<
Long
>
ids
=
ObjectUtils
.
listKey
(
resultRows
,
"id"
);
// 行锁
HPKCTools
.
lockKc010
(
ids
);
HPKCTools
.
HpKc010
.
lock
(
ids
);
// 获取库存信息
Map
<
Long
,
HPKC010
>
dbKc010Map
=
HPKCTools
.
mapKc010
(
ids
);
Map
<
Long
,
HPKC010
>
dbKc010Map
=
HPKCTools
.
HpKc010
.
map
(
ids
);
// 状态校验
for
(
Map
row
:
resultRows
)
{
Long
id
=
MapUtils
.
getLong
(
row
,
"id"
);
...
...
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC004.java
View file @
f7796178
...
...
@@ -89,9 +89,9 @@ public class ServiceHPKC004 extends ServiceBase {
// 销售单号
List
<
String
>
saleNos
=
ObjectUtils
.
listKey
(
resultRows
,
"saleNo"
);
// 锁记录
HPKCTools
.
lockKc004
(
saleNos
);
HPKCTools
.
HpKc004
.
lock
(
saleNos
);
// 查询数据库记录
Map
<
String
,
HPKC004
>
mapKc004
=
HPKCTools
.
mapKc004
(
saleNos
);
Map
<
String
,
HPKC004
>
mapKc004
=
HPKCTools
.
HpKc004
.
map
(
saleNos
);
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
HPKC004
fKc004
=
new
HPKC004
();
fKc004
.
fromMap
(
resultRows
.
get
(
i
));
...
...
@@ -101,13 +101,13 @@ public class ServiceHPKC004 extends ServiceBase {
HPKC004
newKc004
=
BeanUtils
.
copy
(
dbKc004
,
HPKC004
.
class
);
newKc004
.
setSaleNo
(
SequenceGenerator
.
getNextSequence
(
HPConstant
.
SequenceId
.
HPKC004_SALE_NO
));
newKc004
.
setAmount
(
dbKc004
.
getAmount
().
negate
());
newKc004
.
set
Weight
(
dbKc004
.
ge
tWeight
().
negate
());
newKc004
.
set
UnitWeight
(
dbKc004
.
getUni
tWeight
().
negate
());
newKc004
.
setOldSaleNo
(
dbKc004
.
getSaleNo
());
newKc004
.
setDeleteFlag
(
CommonConstant
.
YesNo
.
YES_1
);
DaoUtils
.
insert
(
HPKC004
.
INSERT
,
newKc004
);
// 修改库存
HPKCTools
.
updateStock
(
dbKc004
.
getWhCode
(),
dbKc004
.
getInventRecordId
(),
dbKc004
.
getAmount
(),
dbKc004
.
getWeight
());
//
HPKCTools.updateStock(dbKc004.getWhCode(), dbKc004.getInventRecordId(),
//
dbKc004.getAmount(), dbKc004.getWeight());
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
...
...
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC004A.java
View file @
f7796178
...
...
@@ -92,9 +92,9 @@ public class ServiceHPKC004A extends ServiceEPBase {
// 库存ID
List
<
Long
>
ids
=
ObjectUtils
.
listKey
(
resultRows
,
"id"
);
// 行锁
HPKCTools
.
lockKc010
(
ids
);
HPKCTools
.
HpKc010
.
lock
(
ids
);
// 获取库存信息
Map
<
Long
,
HPKC010
>
dbKc010Map
=
HPKCTools
.
mapKc010
(
ids
);
Map
<
Long
,
HPKC010
>
dbKc010Map
=
HPKCTools
.
HpKc010
.
map
(
ids
);
// 状态校验
for
(
Map
row
:
resultRows
)
{
Long
id
=
MapUtils
.
getLong
(
row
,
"id"
);
...
...
@@ -125,8 +125,8 @@ public class ServiceHPKC004A extends ServiceEPBase {
newKc004
.
setDeleteFlag
(
CommonConstant
.
YesNo
.
NO_0
);
DaoUtils
.
insert
(
HPKC004
.
INSERT
,
newKc004
);
// 修改库存数量
HPKCTools
.
updateStock
(
newKc004
.
getWhCode
(),
newKc004
.
getInventRecordId
(),
newKc004
.
getAmount
().
negate
(),
newKc004
.
getWeight
().
negate
());
//
HPKCTools.updateStock(newKc004.getWhCode(), newKc004.getInventRecordId(),
//
newKc004.getAmount().negate(), newKc004.getWeight().negate());
}
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"生成出库单失败"
);
...
...
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC005A.java
View file @
f7796178
...
...
@@ -81,9 +81,9 @@ public class ServiceHPKC005A extends ServiceEPBase {
// 库存ID
List
<
Long
>
ids
=
ObjectUtils
.
listKey
(
resultRows
,
"id"
);
// 行锁
HPKCTools
.
lockKc010
(
ids
);
HPKCTools
.
HpKc010
.
lock
(
ids
);
// 获取库存信息
Map
<
Long
,
HPKC010
>
dbKc010Map
=
HPKCTools
.
mapKc010
(
ids
);
Map
<
Long
,
HPKC010
>
dbKc010Map
=
HPKCTools
.
HpKc010
.
map
(
ids
);
// 状态校验
for
(
Map
row
:
resultRows
)
{
Long
id
=
MapUtils
.
getLong
(
row
,
"id"
);
...
...
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC007A.java
View file @
f7796178
...
...
@@ -90,9 +90,9 @@ public class ServiceHPKC007A extends ServiceEPBase {
// 库存ID
List
<
Long
>
ids
=
ObjectUtils
.
listKey
(
resultRows
,
"id"
);
// 行锁
HPKCTools
.
lockKc010
(
ids
);
HPKCTools
.
HpKc010
.
lock
(
ids
);
// 获取库存信息
Map
<
Long
,
HPKC010
>
dbKc010Map
=
HPKCTools
.
mapKc010
(
ids
);
Map
<
Long
,
HPKC010
>
dbKc010Map
=
HPKCTools
.
HpKc010
.
map
(
ids
);
// 状态校验
for
(
Map
row
:
resultRows
)
{
Long
id
=
MapUtils
.
getLong
(
row
,
"id"
);
...
...
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC009.java
View file @
f7796178
...
...
@@ -195,8 +195,8 @@ public class ServiceHPKC009 extends ServiceBase {
// 1.6、销售出库
List
<
HPKC004
>
xsCks
=
dao
.
query
(
HPSqlConstant
.
HPKC004
.
STAT_DATE
,
queryMap
);
Map
<
String
,
HPKC004
>
xsCkMap
=
xsCks
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
buildKey
(
item
.
getCompanyCode
(),
item
.
getDepCode
(),
item
.
getInvent
Type
(),
item
.
get
InventCode
(),
item
.
getWhCode
(),
item
.
getInventRecordId
()
),
item
->
item
));
buildKey
(
item
.
getCompanyCode
(),
item
.
getDepCode
(),
item
.
getInvent
Code
(),
item
.
getSub
InventCode
(),
item
.
getWhCode
(),
""
),
item
->
item
));
// 1.7、其它出库
List
<
HPKC007
>
qtCks
=
dao
.
query
(
HPSqlConstant
.
HPKC007
.
STAT_DATE
,
queryMap
);
Map
<
String
,
HPKC007
>
qtCkMap
=
qtCks
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
...
...
@@ -278,210 +278,6 @@ public class ServiceHPKC009 extends ServiceBase {
}
/**
* 按天统计采购库存
*
* @return
*/
private
List
<
HPKC009
>
statCg
(
Map
queryMap
)
{
Map
<
String
,
HPKC009
>
kc009Map
=
new
HashMap
();
// 1.1、期末库存
List
<
HPKC001
>
aItems
=
dao
.
query
(
HPSqlConstant
.
HPKC001
.
STAT_DATE
,
new
HashMap
<>());
// 1.2、收入
queryMap
.
put
(
"createdTimeFrom"
,
queryMap
.
get
(
"yesterFrom"
)
+
"000000"
);
queryMap
.
put
(
"createdTimeTo"
,
queryMap
.
get
(
"yesterTo"
)
+
"235959"
);
List
<
HPKC001
>
bKc001s
=
dao
.
query
(
HPSqlConstant
.
HPKC001
.
STAT_DATE
,
queryMap
);
Map
<
String
,
HPKC001
>
bKc001Map
=
bKc001s
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
+
item
.
getInventType
()
+
"#"
+
item
.
getInventCode
()
+
"#"
+
item
.
getInventRecordId
(),
item
->
item
));
// 1.3、发出
List
<
HPKC002
>
cKc002s
=
dao
.
query
(
HPSqlConstant
.
HPKC002
.
STAT_DATE
,
queryMap
);
Map
<
String
,
HPKC002
>
cKc001Map
=
cKc002s
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
+
item
.
getInventType
()
+
"#"
+
item
.
getInventCode
()
+
"#"
+
item
.
getInventRecordId
(),
item
->
item
));
// 1.4、期初库存
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"beforeDate"
));
queryMap
.
put
(
"kcType"
,
HPConstant
.
KcType
.
CG
);
List
<
HPKC009
>
dKc009s
=
dao
.
query
(
HPKC009
.
QUERY
,
new
HashMap
<>());
Map
<
String
,
HPKC009
>
dKc009Map
=
dKc009s
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
+
item
.
getInventType
()
+
"#"
+
item
.
getInventCode
()
+
"#"
+
item
.
getInventRecordId
(),
item
->
item
));
// 根据期末库存生成收发存对象
for
(
HPKC001
aItem
:
aItems
)
{
String
key
=
aItem
.
getCompanyCode
()
+
"#"
+
aItem
.
getDepCode
()
+
"#"
+
aItem
.
getWhCode
()
+
"#"
+
aItem
.
getInventType
()
+
"#"
+
aItem
.
getInventCode
()
+
"#"
+
aItem
.
getInventRecordId
();
HPKC009
kc009
=
BeanUtils
.
copy
(
aItem
,
HPKC009
.
class
);
kc009
.
setInventType
(
aItem
.
getInventType
());
kc009
.
setInventCode
(
aItem
.
getInventCode
());
kc009
.
setDateType
(
queryMap
.
get
(
"dateType"
).
toString
());
kc009
.
setDateProc
(
queryMap
.
get
(
"yesterDate"
).
toString
());
// 期末
kc009
.
setEndAmount
(
aItem
.
getAmount
());
kc009
.
setEndWeight
(
aItem
.
getWeight
());
// 收入
HPKC001
bKc001
=
bKc001Map
.
get
(
key
);
kc009
.
setEnterAmount
(
bKc001
==
null
?
BigDecimal
.
ZERO
:
bKc001
.
getAmount
());
kc009
.
setEnterWeight
(
bKc001
==
null
?
BigDecimal
.
ZERO
:
bKc001
.
getWeight
());
// 发出
HPKC002
cKc002
=
cKc001Map
.
get
(
key
);
kc009
.
setOuterAmount
(
cKc002
==
null
?
BigDecimal
.
ZERO
:
cKc002
.
getAmount
());
kc009
.
setOuterWeight
(
cKc002
==
null
?
BigDecimal
.
ZERO
:
cKc002
.
getWeight
());
// 期初
HPKC009
dKc009
=
dKc009Map
.
get
(
key
);
if
(
dKc009
!=
null
)
{
kc009
.
setInitAmount
(
dKc009
.
getEndAmount
());
kc009
.
setInitWeight
(
dKc009
.
getEndWeight
());
}
else
{
kc009
.
setInitAmount
(
kc009
.
getEndAmount
().
add
(
kc009
.
getOuterAmount
())
.
subtract
(
kc009
.
getEnterAmount
()));
kc009
.
setInitWeight
(
kc009
.
getEndWeight
().
add
(
kc009
.
getOuterWeight
())
.
subtract
(
kc009
.
getEnterWeight
()));
}
kc009Map
.
put
(
key
,
kc009
);
}
return
kc009Map
.
values
().
stream
().
collect
(
Collectors
.
toList
());
}
/**
* 按天统计生产库存
*
* @param queryMap
* @return
*/
private
List
<
HPKC009
>
statSc
(
Map
queryMap
)
{
Map
<
String
,
HPKC009
>
kc009Map
=
new
HashMap
();
// 1.1、期末库存
List
<
HPKC003
>
aItems
=
dao
.
query
(
HPSqlConstant
.
HPKC003
.
STAT_DATE
,
new
HashMap
<>());
// 1.2、收入
queryMap
.
put
(
"createdTimeFrom"
,
queryMap
.
get
(
"yesterday"
)
+
"000000"
);
queryMap
.
put
(
"createdTimeTo"
,
queryMap
.
get
(
"yesterday"
)
+
"235959"
);
List
<
HPKC003
>
bItems
=
dao
.
query
(
HPSqlConstant
.
HPKC003
.
STAT_DATE
,
queryMap
);
Map
<
String
,
HPKC003
>
bItemMap
=
bItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
+
item
.
getInventType
()
+
"#"
+
item
.
getInventCode
(),
item
->
item
));
// 1.3、发出
List
<
HPKC004
>
cItems
=
dao
.
query
(
HPSqlConstant
.
HPKC004
.
STAT_DATE
,
queryMap
);
Map
<
String
,
HPKC004
>
cItemMap
=
cItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
+
item
.
getInventType
()
+
"#"
+
item
.
getInventCode
(),
item
->
item
));
// 1.4、期初库存
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"beforeDate"
));
queryMap
.
put
(
"kcType"
,
HPConstant
.
KcType
.
SC
);
List
<
HPKC009
>
dItems
=
dao
.
query
(
HPKC009
.
QUERY
,
new
HashMap
<>());
Map
<
String
,
HPKC009
>
dItemMap
=
dItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
+
item
.
getInventType
()
+
"#"
+
item
.
getInventCode
(),
item
->
item
));
// 根据期末库存生成收发存对象
for
(
HPKC003
aItem
:
aItems
)
{
String
key
=
aItem
.
getCompanyCode
()
+
"#"
+
aItem
.
getDepCode
()
+
"#"
+
aItem
.
getWhCode
()
+
"#"
+
aItem
.
getInventType
()
+
"#"
+
aItem
.
getInventCode
();
HPKC009
kc009
=
BeanUtils
.
copy
(
aItem
,
HPKC009
.
class
);
kc009
.
setWhCode
(
aItem
.
getWhCode
());
kc009
.
setInventType
(
aItem
.
getInventType
()
+
""
);
kc009
.
setInventCode
(
aItem
.
getInventCode
());
kc009
.
setDateType
(
queryMap
.
get
(
"dateType"
).
toString
());
kc009
.
setDateProc
(
queryMap
.
get
(
"yesterDate"
).
toString
());
// 期末
kc009
.
setEndAmount
(
aItem
.
getAmount
());
kc009
.
setEndWeight
(
aItem
.
getWeight
());
// 收入
HPKC003
bItem
=
bItemMap
.
get
(
key
);
kc009
.
setEnterAmount
(
bItem
==
null
?
BigDecimal
.
ZERO
:
bItem
.
getAmount
());
kc009
.
setEnterWeight
(
bItem
==
null
?
BigDecimal
.
ZERO
:
bItem
.
getWeight
());
// 发出
HPKC004
cItem
=
cItemMap
.
get
(
key
);
kc009
.
setOuterAmount
(
cItem
==
null
?
BigDecimal
.
ZERO
:
cItem
.
getAmount
());
kc009
.
setOuterWeight
(
cItem
==
null
?
BigDecimal
.
ZERO
:
cItem
.
getWeight
());
// 期初
HPKC009
dItem
=
dItemMap
.
get
(
key
);
if
(
dItem
!=
null
)
{
kc009
.
setInitAmount
(
dItem
.
getEndAmount
());
kc009
.
setInitWeight
(
dItem
.
getEndWeight
());
}
else
{
kc009
.
setInitAmount
(
kc009
.
getEndAmount
().
add
(
kc009
.
getOuterAmount
())
.
subtract
(
kc009
.
getEnterAmount
()));
kc009
.
setInitWeight
(
kc009
.
getEndWeight
().
add
(
kc009
.
getOuterWeight
())
.
subtract
(
kc009
.
getEnterWeight
()));
}
kc009Map
.
put
(
key
,
kc009
);
}
return
kc009Map
.
values
().
stream
().
collect
(
Collectors
.
toList
());
}
/**
* 按天统计其他库存
*
* @param queryMap
* @return
*/
private
List
<
HPKC009
>
statQt
(
Map
queryMap
)
{
Map
<
String
,
HPKC009
>
kc009Map
=
new
HashMap
();
// 1.1、期末库存
List
<
HPKC006
>
aItems
=
dao
.
query
(
HPSqlConstant
.
HPKC006
.
STAT_DATE
,
new
HashMap
<>());
// 1.2、收入
queryMap
.
put
(
"createdTimeFrom"
,
queryMap
.
get
(
"yesterday"
)
+
"000000"
);
queryMap
.
put
(
"createdTimeTo"
,
queryMap
.
get
(
"yesterday"
)
+
"235959"
);
List
<
HPKC006
>
bItems
=
dao
.
query
(
HPSqlConstant
.
HPKC006
.
STAT_DATE
,
queryMap
);
Map
<
String
,
HPKC006
>
bItemMap
=
bItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
+
item
.
getInventType
()
+
"#"
+
item
.
getInventCode
()
+
"#"
+
item
.
getInventRecordId
(),
item
->
item
));
// 1.3、发出
List
<
HPKC007
>
cItems
=
dao
.
query
(
HPSqlConstant
.
HPKC007
.
STAT_DATE
,
queryMap
);
Map
<
String
,
HPKC007
>
cItemMap
=
cItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
+
item
.
getInventType
()
+
"#"
+
item
.
getInventCode
()
+
"#"
+
item
.
getInventRecordId
(),
item
->
item
));
// 1.4、期初库存
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"beforeDate"
));
queryMap
.
put
(
"kcType"
,
HPConstant
.
KcType
.
QT
);
List
<
HPKC009
>
dItems
=
dao
.
query
(
HPKC009
.
QUERY
,
new
HashMap
<>());
Map
<
String
,
HPKC009
>
dItemMap
=
dItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
+
item
.
getInventType
()
+
"#"
+
item
.
getInventCode
()
+
"#"
+
item
.
getInventRecordId
(),
item
->
item
));
// 根据期末库存生成收发存对象
for
(
HPKC006
aItem
:
aItems
)
{
String
key
=
aItem
.
getCompanyCode
()
+
"#"
+
aItem
.
getDepCode
()
+
"#"
+
aItem
.
getWhCode
()
+
"#"
+
aItem
.
getInventType
()
+
"#"
+
aItem
.
getInventCode
()
+
"#"
+
aItem
.
getInventRecordId
();
HPKC009
kc009
=
BeanUtils
.
copy
(
aItem
,
HPKC009
.
class
);
kc009
.
setInventType
(
aItem
.
getInventType
());
kc009
.
setInventCode
(
aItem
.
getInventCode
());
kc009
.
setDateType
(
queryMap
.
get
(
"dateType"
).
toString
());
kc009
.
setDateProc
(
queryMap
.
get
(
"yesterDate"
).
toString
());
// 期末
kc009
.
setEndAmount
(
aItem
.
getAmount
());
kc009
.
setEndWeight
(
aItem
.
getWeight
());
// 收入
HPKC006
bItem
=
bItemMap
.
get
(
key
);
kc009
.
setEnterAmount
(
bItem
==
null
?
BigDecimal
.
ZERO
:
bItem
.
getAmount
());
kc009
.
setEnterWeight
(
bItem
==
null
?
BigDecimal
.
ZERO
:
bItem
.
getWeight
());
// 发出
HPKC007
cItem
=
cItemMap
.
get
(
key
);
kc009
.
setOuterAmount
(
cItem
==
null
?
BigDecimal
.
ZERO
:
cItem
.
getAmount
());
kc009
.
setOuterWeight
(
cItem
==
null
?
BigDecimal
.
ZERO
:
cItem
.
getWeight
());
// 期初
HPKC009
dItem
=
dItemMap
.
get
(
key
);
if
(
dItem
!=
null
)
{
kc009
.
setInitAmount
(
dItem
.
getEndAmount
());
kc009
.
setInitWeight
(
dItem
.
getEndWeight
());
}
else
{
kc009
.
setInitAmount
(
kc009
.
getEndAmount
().
add
(
kc009
.
getOuterAmount
())
.
subtract
(
kc009
.
getOuterAmount
()));
kc009
.
setInitWeight
(
kc009
.
getEndWeight
().
add
(
kc009
.
getOuterWeight
())
.
subtract
(
kc009
.
getEnterWeight
()));
}
kc009Map
.
put
(
key
,
kc009
);
}
return
kc009Map
.
values
().
stream
().
collect
(
Collectors
.
toList
());
}
/**
* 设置基础信息
*
* @param kc009s
...
...
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC004.xml
View file @
f7796178
...
...
@@ -10,16 +10,23 @@
SALE_NO as "saleNo",
<!-- 销售单号 -->
WH_CODE as "whCode",
<!-- 仓库编码 -->
WH_NAME as "whName",
<!-- 仓库名称 -->
INVENT_TYPE as "inventType",
<!-- 存货类型 -->
INVENT_CODE as "inventCode",
<!-- 存货编码 -->
INVENT_NAME as "inventName",
<!-- 存货名称 -->
INVENT_RECORD_ID as "inventRecordId",
<!-- 规格 -->
PROD_NO as "prodNo",
<!-- 生产订单号 -->
PROJ_CODE as "projCode",
<!-- 项目号 -->
PROJ_NAME as "projName",
<!-- 项目名称 -->
INVENT_CODE as "inventCode",
<!-- 部件编码 -->
INVENT_NAME as "inventName",
<!-- 部件名称 -->
SUB_INVENT_CODE as "subInventCode",
<!-- 零部件编码 -->
SUB_INVENT_NAME as "subInventName",
<!-- 零部件名称 -->
LENGTH as "length",
<!-- 长 -->
WIDTH as "width",
<!-- 宽 -->
THICK as "thick",
<!-- 厚 -->
AMOUNT as "amount",
<!-- 数量 -->
UNIT_WEIGHT as "unitWeight",
<!-- 单重 -->
WEIGHT as "weight",
<!-- 重量 -->
STATUS as "status",
<!-- 状态 -->
REMARK as "remark",
<!-- 备注 -->
KC_ID as "kcId",
<!-- 库存ID -->
OLD_SALE_NO as "oldSaleNo",
<!-- 原销售单号 -->
IS_PRINT as "isPrint",
<!-- 是否打印:0.否1.是 -->
CREATED_BY as "createdBy",
<!-- 创建人 -->
CREATED_NAME as "createdName",
<!-- 创建人名称 -->
CREATED_TIME as "createdTime",
<!-- 创建时间 -->
...
...
@@ -51,38 +58,51 @@
<isNotEmpty
prepend=
" AND "
property=
"whName"
>
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"inventType"
>
INVENT_TYPE = #inventType#
<isNotEmpty
prepend=
" AND "
property=
"prodNo"
>
PROD_NO = #prodNo#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"projCode"
>
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"projName"
>
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"inventCode"
>
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"inventName"
>
INVENT_NAME = #inventName#
INVENT_NAME LIKE CONCAT('%', #inventName#, '%')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"subInventCode"
>
SUB_INVENT_CODE = #subInventCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"inventRecordId"
>
INVENT_RECORD_ID = #inventRecordId#
<isNotEmpty
prepend=
" AND "
property=
"subInventName"
>
SUB_INVENT_NAME LIKE CONCAT('%', #subInventName#, '%')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"remark"
>
REMARK = #remark#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"kcId"
>
KC_ID = #kcId#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"oldSaleNo"
>
OLD_SALE_NO = #oldSaleNo#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"isPrint"
>
IS_PRINT = #isPrint#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"deleteFlag"
>
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
</sql>
<sql
id=
"customCondition"
>
<isNotEmpty
prepend=
" AND "
property=
"ids"
>
ID IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"ids"
>
#ids[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"saleNos"
>
SALE_NO IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"saleNos"
>
#saleNos[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"spec"
>
<isEqual
property=
"spec"
compareValue=
"无规格"
>
INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = '')
</isEqual>
<isNotEqual
property=
"spec"
compareValue=
"无规格"
>
INVENT_RECORD_ID IN (SELECT ID FROM ${hpjxSchema}.T_HPPZ006 WHERE SPEC = #spec#)
</isNotEqual>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"createdDateFrom"
>
CREATED_TIME
>
= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
...
...
@@ -91,6 +111,13 @@
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql
id=
"updateRevise"
>
UPDATED_BY = #updatedBy#,
<!-- 修改人 -->
UPDATED_NAME = #updatedName#,
<!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#
<!-- 修改时间 -->
</sql>
<sql
id=
"order"
>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
...
...
@@ -125,27 +152,34 @@
SALE_NO,
<!-- 销售单号 -->
WH_CODE,
<!-- 仓库编码 -->
WH_NAME,
<!-- 仓库名称 -->
INVENT_TYPE,
<!-- 存货类型 -->
INVENT_CODE,
<!-- 存货编码 -->
INVENT_NAME,
<!-- 存货名称 -->
INVENT_RECORD_ID,
<!-- 规格 -->
PROD_NO,
<!-- 生产订单号 -->
PROJ_CODE,
<!-- 项目号 -->
PROJ_NAME,
<!-- 项目名称 -->
INVENT_CODE,
<!-- 部件编码 -->
INVENT_NAME,
<!-- 部件名称 -->
SUB_INVENT_CODE,
<!-- 零部件编码 -->
SUB_INVENT_NAME,
<!-- 零部件名称 -->
LENGTH,
<!-- 长 -->
WIDTH,
<!-- 宽 -->
THICK,
<!-- 厚 -->
AMOUNT,
<!-- 数量 -->
UNIT_WEIGHT,
<!-- 单重 -->
WEIGHT,
<!-- 重量 -->
STATUS,
<!-- 状态 -->
REMARK,
<!-- 备注 -->
KC_ID,
<!-- 库存ID -->
OLD_SALE_NO,
<!-- 原销售单号 -->
IS_PRINT,
<!-- 是否打印:0.否1.是 -->
CREATED_BY,
<!-- 创建人 -->
CREATED_NAME,
<!-- 创建人名称 -->
CREATED_TIME,
<!-- 创建时间 -->
DELETE_FLAG
<!-- 是否删除 -->
) VALUES (
#companyCode#, #depCode#, #receiptDate#, #saleNo#, #whCode#, #whName#,
#inventType#, #inventCode#, #inventName#, #inventRecordId#, #amount#, #weight#, #status#,
#remark#, #kcId#, #oldSaleNo#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#
#companyCode#, #depCode#, #receiptDate#, #saleNo#, #whCode#, #whName#, #prodNo#,
#projCode#, #projName#, #inventCode#, #inventName#, #subInventCode#, #subInventName#,
#length#, #width#, #thick#, #amount#, #unitWeight#, #weight#, #remark#, #kcId#,
#oldSaleNo#, #isPrint#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#
)
</insert>
<!-- 逻辑删除 -->
<delete
id=
"delete"
>
UPDATE ${hpjxSchema}.T_HPKC004 SET DELETE_FLAG = 1 WHERE ID = #id#
...
...
@@ -157,16 +191,26 @@
RECEIPT_DATE = #receiptDate#,
<!-- 票据日期 -->
WH_CODE = #whCode#,
<!-- 仓库编码 -->
WH_NAME = #whName#,
<!-- 仓库名称 -->
INVENT_TYPE = #inventType#,
<!-- 存货类型 -->
INVENT_CODE = #inventCode#,
<!-- 存货编码 -->
INVENT_NAME = #inventName#,
<!-- 存货名称 -->
PROD_NO = #prodNo#,
<!-- 生产订单号 -->
PROJ_CODE = #projCode#,
<!-- 项目号 -->
PROJ_NAME = #projName#,
<!-- 项目名称 -->
INVENT_CODE = #inventCode#,
<!-- 部件编码 -->
INVENT_NAME = #inventName#,
<!-- 部件名称 -->
SUB_INVENT_CODE = #subInventCode#,
<!-- 零部件编码 -->
SUB_INVENT_NAME = #subInventName#,
<!-- 零部件名称 -->
LENGTH = #length#,
<!-- 长 -->
WIDTH = #width#,
<!-- 宽 -->
THICK = #thick#,
<!-- 厚 -->
AMOUNT = #amount#,
<!-- 数量 -->
UNIT_WEIGHT = #unitWeight#,
<!-- 单重 -->
WEIGHT = #weight#,
<!-- 重量 -->
STATUS = #status#,
<!-- 状态 -->
REMARK = #remark#,
<!-- 备注 -->
KC_ID = #kcId#,
<!-- 库存ID -->
OLD_SALE_NO = #oldSaleNo#,
<!-- 原销售单号 -->
UPDATED_BY = #updatedBy#,
<!-- 修改人 -->
UPDATED_NAME = #updatedName#,
<!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#
<!-- 修改时间 -->
UPDATED_TIME = #updatedTime#,
<!-- 修改时间 -->
DELETE_FLAG = #deleteFlag#
<!-- 是否删除 -->
WHERE ID = #id#
</update>
...
...
@@ -183,6 +227,14 @@
</isNotEmpty>
</update>
<!-- 修改状态 -->
<update
id=
"updatePrint"
>
UPDATE ${hpjxSchema}.T_HPKC004
SET IS_PRINT = 1,
<include
refid=
"updateRevise"
/>
WHERE ID IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"ids"
>
#ids[]#
</iterate>
</update>
<!-- 统计库存 -->
<select
id=
"statDate"
resultClass=
"com.baosight.hpjx.hp.kc.domain.HPKC004"
>
SELECT
...
...
src/main/java/com/baosight/hpjx/hp/kc/tools/CKExcelTools.java
View file @
f7796178
package
com
.
baosight
.
hpjx
.
hp
.
kc
.
tools
;
import
com.baosight.hpjx.hp.kc.domain.HPKC004
;
import
com.baosight.hpjx.hp.pz.tools.HPPZTools
;
import
com.baosight.hpjx.util.DateUtils
;
import
com.baosight.hpjx.util.ExcelUtils
;
import
com.baosight.hpjx.util.MapUtils
;
import
com.baosight.hpjx.util.StringUtils
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
org.apache.poi.hssf.usermodel.HSSFCell
;
import
org.apache.poi.hssf.usermodel.HSSFCellStyle
;
import
org.apache.poi.hssf.usermodel.HSSFFont
;
...
...
@@ -23,6 +27,7 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -35,66 +40,55 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public
class
CKExcelTools
{
public
static
void
main
(
String
[]
args
)
{
List
<
Map
<
String
,
Object
>>
items
=
new
ArrayList
<>();
Map
<
String
,
Object
>
itemMap1
=
new
HashMap
<>();
itemMap1
.
put
(
"groupName"
,
"内膜"
);
List
<
Map
<
String
,
String
>>
itemChildren1
=
new
ArrayList
<>();
Map
<
String
,
String
>
childMap1_1
=
new
HashMap
<>();
childMap1_1
.
put
(
"itemName"
,
"内模封板"
);
childMap1_1
.
put
(
"quantity"
,
"4"
);
itemChildren1
.
add
(
childMap1_1
);
Map
<
String
,
String
>
childMap1_2
=
new
HashMap
<>();
childMap1_2
.
put
(
"itemName"
,
"加长定位稍"
);
childMap1_2
.
put
(
"spec"
,
"1200"
);
childMap1_2
.
put
(
"length"
,
"120"
);
childMap1_2
.
put
(
"quantity"
,
"700"
);
childMap1_2
.
put
(
"remark"
,
"含螺母"
);
itemChildren1
.
add
(
childMap1_2
);
itemMap1
.
put
(
"itemChildren"
,
itemChildren1
);
items
.
add
(
itemMap1
);
Map
<
String
,
Object
>
itemMap2
=
new
HashMap
<>();
itemMap2
.
put
(
"groupName"
,
"外模"
);
List
<
Map
<
String
,
String
>>
itemChildren2
=
new
ArrayList
<>();
Map
<
String
,
String
>
childMap2_1
=
new
HashMap
<>();
childMap2_1
.
put
(
"itemName"
,
"中梁底边3米"
);
childMap2_1
.
put
(
"spec"
,
"3000"
);
childMap2_1
.
put
(
"length"
,
"3000"
);
childMap2_1
.
put
(
"quantity"
,
"3"
);
itemChildren2
.
add
(
childMap2_1
);
Map
<
String
,
String
>
childMap2_2
=
new
HashMap
<>();
childMap2_2
.
put
(
"itemName"
,
"中梁底边2米"
);
childMap2_2
.
put
(
"spec"
,
"2000"
);
childMap2_2
.
put
(
"length"
,
"2000"
);
childMap2_2
.
put
(
"quantity"
,
"1"
);
itemChildren2
.
add
(
childMap2_2
);
itemMap2
.
put
(
"itemChildren"
,
itemChildren2
);
items
.
add
(
itemMap2
);
Map
dataMap
=
new
HashMap
();
dataMap
.
put
(
"projectName"
,
"20米液压箱梁"
);
dataMap
.
put
(
"items"
,
items
);
/**
* 下载文件
*
* @param pageContext
*/
public
static
void
downloadFile
(
PageContext
pageContext
)
{
try
{
HSSFWorkbook
workbook
=
build
(
dataMap
);
FileOutputStream
fout
=
new
FileOutputStream
(
"d:/出库单.xls"
);
workbook
.
write
(
fout
);
fout
.
close
();
HttpServletRequest
request
=
(
HttpServletRequest
)
pageContext
.
getRequest
();
HttpServletResponse
response
=
(
HttpServletResponse
)
pageContext
.
getResponse
();
Map
parameter
=
StringUtils
.
encodeParam
(
request
.
getParameter
(
"parameter"
));
// 获取数据
List
<
Long
>
saleIds
=
(
List
<
Long
>)
parameter
.
get
(
"saleIds"
);
List
<
HPKC004
>
dbKc004s
=
HPKCTools
.
HpKc004
.
listById
(
saleIds
);
// 数据格式转换
Map
dataMap
=
convertData
(
dbKc004s
);
// 构建excel
HSSFWorkbook
workbook
=
buildExcel
(
dataMap
);
String
fileName
=
"出库单-"
+
DateUtils
.
shortYmdhmss
()
+
".xls"
;
ExcelUtils
.
download
(
fileName
,
workbook
,
response
);
// 更新状态
HPKCTools
.
HpKc004
.
updatePrint
(
saleIds
);
}
catch
(
Exception
e
)
{
log
.
error
(
"生成出库单失败:{}"
,
e
.
getMessage
(),
e
);
log
.
error
(
"下载文件失败:{}"
,
e
.
getMessage
(),
e
);
throw
new
PlatException
(
"下载打印失败"
);
}
}
/**
*
下载文件
*
数据格式转换
*
* @param pageContext
* @param dbKc004s
* @return
*/
public
static
void
downloadFile
(
PageContext
pageContext
)
throws
IOException
{
HttpServletRequest
request
=
(
HttpServletRequest
)
pageContext
.
getRequest
();
HttpServletResponse
response
=
(
HttpServletResponse
)
pageContext
.
getResponse
();
// String docId = request.getParameter("docId");
// HSSFWorkbook workbook = build(dataMap);
// String fileName = "出库单-" + DateUtils.shortYmdhmss() + ".xls";
// ExcelUtils.download(fileName, workbook, response);
private
static
Map
convertData
(
List
<
HPKC004
>
dbKc004s
)
{
// 转换数据格式用于生成excel
Map
dataMap
=
new
HashMap
();
for
(
HPKC004
dbKc004
:
dbKc004s
)
{
String
projCode
=
dbKc004
.
getProjCode
();
String
dataProjCode
=
MapUtils
.
getString
(
dataMap
,
Field
.
PROJ_CODE
);
if
(
StringUtils
.
isBlank
(
dataProjCode
))
{
dataMap
.
put
(
Field
.
PROJ_CODE
,
dbKc004
.
getProjCode
());
dataMap
.
put
(
Field
.
PROJ_NAME
,
dbKc004
.
getProjName
());
}
else
if
(!
projCode
.
equals
(
dataProjCode
))
{
throw
new
PlatException
(
"打印数据中存在不同的项目信息,请检查"
);
}
}
// 按父级产品分类数据
dataMap
.
put
(
Field
.
CHILDREN
,
dbKc004s
.
stream
().
collect
(
Collectors
.
groupingBy
(
item
->
item
.
getInventName
())));
return
dataMap
;
}
/**
...
...
@@ -102,7 +96,7 @@ public class CKExcelTools {
*
* @param dataMap 数据集
*/
public
static
HSSFWorkbook
build
(
Map
dataMap
)
{
public
static
HSSFWorkbook
build
Excel
(
Map
dataMap
)
{
HSSFWorkbook
workbook
=
new
HSSFWorkbook
();
// 在Workbook中,创建一个sheet,对应Excel中的工作薄(sheet)
HSSFSheet
sheet
=
workbook
.
createSheet
(
"出库单"
);
...
...
@@ -118,13 +112,14 @@ public class CKExcelTools {
// 遍历数据行,excel行从第3行开始
int
headRow
=
2
;
int
lastRow
=
2
;
List
<
Map
<
String
,
Object
>>
items
=
(
List
<
Map
<
String
,
Object
>>)
dataMap
.
get
(
"items"
);
for
(
int
i
=
0
;
i
<
items
.
size
();
i
++)
{
Map
<
String
,
Object
>
itemMap
=
items
.
get
(
i
);
Map
<
String
,
List
<
HPKC004
>>
childrenMap
=
(
Map
<
String
,
List
<
HPKC004
>>)
dataMap
.
get
(
Field
.
CHILDREN
);
for
(
Map
.
Entry
<
String
,
List
<
HPKC004
>>
childrenEntry
:
childrenMap
.
entrySet
())
{
String
key
=
childrenEntry
.
getKey
();
List
<
HPKC004
>
values
=
childrenEntry
.
getValue
();
// 组名称
lastRow
=
buildGroupRow
(
workbook
,
sheet
,
itemMap
,
lastRow
,
headRow
);
lastRow
=
buildGroupRow
(
workbook
,
sheet
,
key
,
lastRow
,
headRow
);
// 明细数据,返回末尾行数
lastRow
=
buildChildRow
(
workbook
,
sheet
,
itemMap
,
lastRow
,
headRow
);
lastRow
=
buildChildRow
(
workbook
,
sheet
,
values
,
lastRow
,
headRow
);
}
// 页脚
buildFoot
(
workbook
,
sheet
,
lastRow
);
...
...
@@ -176,16 +171,15 @@ public class CKExcelTools {
*
* @param workbook
* @param sheet
* @param
itemMap
* @param
values
* @param lastRow
* @param headRow
*/
private
static
int
buildChildRow
(
HSSFWorkbook
workbook
,
HSSFSheet
sheet
,
Map
<
String
,
Object
>
itemMap
,
private
static
int
buildChildRow
(
HSSFWorkbook
workbook
,
HSSFSheet
sheet
,
List
<
HPKC004
>
values
,
int
lastRow
,
int
headRow
)
{
List
<
Map
<
String
,
String
>>
children
=
MapUtils
.
getList
(
itemMap
,
"itemChildren"
);
int
currRow
=
lastRow
+
1
;
for
(
int
i
=
0
;
i
<
children
.
size
();
i
++)
{
Map
<
String
,
String
>
childMap
=
children
.
get
(
i
);
for
(
int
i
=
0
;
i
<
values
.
size
();
i
++)
{
HPKC004
valueMap
=
values
.
get
(
i
);
currRow
=
currRow
+
i
;
HSSFRow
row
=
sheet
.
createRow
(
currRow
);
row
.
setHeight
((
short
)
(
20
*
20
));
...
...
@@ -195,7 +189,7 @@ public class CKExcelTools {
cell1_0
.
setCellStyle
(
getCellStyle
(
workbook
));
// 名称
HSSFCell
cell1_1
=
row
.
createCell
(
1
);
cell1_1
.
setCellValue
(
MapUtils
.
getString
(
childMap
,
"itemName"
));
cell1_1
.
setCellValue
(
valueMap
.
getSubInventName
(
));
cell1_1
.
setCellStyle
(
getCellStyle
(
workbook
));
// 规格
// HSSFCell cell1_2 = row.createCell(2);
...
...
@@ -203,23 +197,23 @@ public class CKExcelTools {
// cell1_2.setCellStyle(getCellStyle(workbook));
// 长
HSSFCell
cell1_2
=
row
.
createCell
(
2
);
cell1_2
.
setCellValue
(
MapUtils
.
getString
(
childMap
,
"length"
));
cell1_2
.
setCellValue
(
valueMap
.
getLength
()
==
null
?
""
:
valueMap
.
getLength
().
toString
(
));
cell1_2
.
setCellStyle
(
getCellStyle
(
workbook
));
// 宽
HSSFCell
cell1_3
=
row
.
createCell
(
3
);
cell1_3
.
setCellValue
(
MapUtils
.
getString
(
childMap
,
"width"
));
cell1_3
.
setCellValue
(
valueMap
.
getWidth
()
==
null
?
""
:
valueMap
.
getWidth
().
toString
(
));
cell1_3
.
setCellStyle
(
getCellStyle
(
workbook
));
// 高
HSSFCell
cell1_4
=
row
.
createCell
(
4
);
cell1_4
.
setCellValue
(
MapUtils
.
getString
(
childMap
,
"height"
));
cell1_4
.
setCellValue
(
valueMap
.
getThick
()
==
null
?
""
:
valueMap
.
getThick
().
toString
(
));
cell1_4
.
setCellStyle
(
getCellStyle
(
workbook
));
// 数量
HSSFCell
cell1_5
=
row
.
createCell
(
5
);
cell1_5
.
setCellValue
(
MapUtils
.
getString
(
childMap
,
"quantity"
)
);
cell1_5
.
setCellValue
(
valueMap
.
getAmount
()
+
""
);
cell1_5
.
setCellStyle
(
getCellStyle
(
workbook
));
// 备注
HSSFCell
cell1_6
=
row
.
createCell
(
6
);
cell1_6
.
setCellValue
(
MapUtils
.
getString
(
childMap
,
"remark"
));
cell1_6
.
setCellValue
(
valueMap
.
getRemark
(
));
cell1_6
.
setCellStyle
(
getCellStyle
(
workbook
));
}
return
currRow
;
...
...
@@ -230,14 +224,12 @@ public class CKExcelTools {
*
* @param workbook
* @param sheet
* @param itemMap
* @param lastRow
* @param headRow
*/
private
static
int
buildGroupRow
(
HSSFWorkbook
workbook
,
HSSFSheet
sheet
,
Map
<
String
,
Object
>
itemMap
,
private
static
int
buildGroupRow
(
HSSFWorkbook
workbook
,
HSSFSheet
sheet
,
String
groupName
,
int
lastRow
,
int
headRow
)
{
int
currRow
=
lastRow
+
1
;
String
groupName
=
MapUtils
.
getString
(
itemMap
,
"groupName"
);
HSSFRow
row
=
sheet
.
createRow
(
currRow
);
row
.
setHeight
((
short
)
(
20
*
20
));
// 序号
...
...
@@ -277,7 +269,7 @@ public class CKExcelTools {
row1
.
setHeight
((
short
)
(
20
*
20
));
// 1.1、表头:项目名
HSSFCell
cell1_1
=
row1
.
createCell
(
0
);
cell1_1
.
setCellValue
(
"项目:"
+
dataMap
.
get
(
"projectName"
));
cell1_1
.
setCellValue
(
"项目:"
+
dataMap
.
get
(
Field
.
PROJ_NAME
));
cell1_1
.
setCellStyle
(
getCellStyle
(
workbook
,
HorizontalAlignment
.
LEFT
,
VerticalAlignment
.
CENTER
,
true
,
false
));
// 1.2、表头日期
HSSFCell
cell1_2
=
row1
.
createCell
(
5
);
...
...
@@ -453,4 +445,37 @@ public class CKExcelTools {
return
cellStyle
;
}
/**
* 字段信息
*/
public
class
Field
{
// 项目号
public
static
final
String
PROJ_CODE
=
"projCode"
;
// 项目名称
public
static
final
String
PROJ_NAME
=
"projName"
;
// 父级产品编码
public
static
final
String
PARENT_PRDT_CODE
=
"parentPrdtCode"
;
// 父级产品名称
public
static
final
String
PARENT_PRDT_NAME
=
"parentPrdtName"
;
// 产品编码
public
static
final
String
PRDT_CODE
=
"prdtCode"
;
// 产品名称
public
static
final
String
PRDT_NAME
=
"prdtName"
;
// 长
public
static
final
String
LENGTH
=
"length"
;
// 宽
public
static
final
String
WIDTH
=
"width"
;
// 高
public
static
final
String
HEIGHT
=
"height"
;
// 厚
public
static
final
String
THICK
=
"thick"
;
// 数量
public
static
final
String
NUM
=
"num"
;
// 备注
public
static
final
String
REMARK
=
"remark"
;
// 子集集合
public
static
final
String
CHILDREN
=
"children"
;
}
}
src/main/java/com/baosight/hpjx/hp/kc/tools/HPKCTools.java
View file @
f7796178
package
com
.
baosight
.
hpjx
.
hp
.
kc
.
tools
;
import
com.baosight.hpjx.core.dao.DaoBase
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.hp.constant.HPSqlConstant
;
import
com.baosight.hpjx.hp.kc.domain.*
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
...
...
@@ -110,12 +111,20 @@ public class HPKCTools {
}
/**
* HPKC004 公共方法定义
*
* @author:songx
* @date:2024/1/31,16:36
*/
public
static
class
HpKc004
{
/**
* 锁
*
* @param saleNos
* @return
*/
public
static
void
lockKc004
(
List
<
String
>
saleNos
)
{
public
static
void
lock
(
List
<
String
>
saleNos
)
{
if
(
CollectionUtils
.
isEmpty
(
saleNos
))
{
return
;
}
...
...
@@ -127,10 +136,25 @@ public class HPKCTools {
/**
* 查询销售出库信息
*
* @param ids
* @return
*/
public
static
List
<
HPKC004
>
listById
(
List
<
Long
>
ids
)
{
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
null
;
}
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"ids"
,
ids
);
return
DaoBase
.
getInstance
().
query
(
HPKC004
.
QUERY
,
queryMap
);
}
/**
* 查询销售出库信息
*
* @param saleNos
* @return
*/
public
static
List
<
HPKC004
>
listKc004
(
List
<
String
>
saleNos
)
{
public
static
List
<
HPKC004
>
list
(
List
<
String
>
saleNos
)
{
if
(
CollectionUtils
.
isEmpty
(
saleNos
))
{
return
null
;
}
...
...
@@ -145,8 +169,8 @@ public class HPKCTools {
* @param saleNos
* @return
*/
public
static
Map
<
String
,
HPKC004
>
mapKc004
(
List
<
String
>
saleNos
)
{
List
<
HPKC004
>
results
=
listKc004
(
saleNos
);
public
static
Map
<
String
,
HPKC004
>
map
(
List
<
String
>
saleNos
)
{
List
<
HPKC004
>
results
=
list
(
saleNos
);
if
(
CollectionUtils
.
isEmpty
(
results
))
{
return
null
;
}
...
...
@@ -154,6 +178,21 @@ public class HPKCTools {
}
/**
* 修改打印状态
*
* @param ids
*/
public
static
void
updatePrint
(
List
<
Long
>
ids
)
{
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
;
}
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"ids"
,
ids
);
DaoUtils
.
update
(
HPSqlConstant
.
HPKC004
.
UPDATE_PRINT
,
queryMap
);
}
}
/**
* 锁
*
* @param checkNos
...
...
@@ -286,12 +325,20 @@ public class HPKCTools {
}
/**
* HPKC004公共DAO方法定义
*
* @author:songx
* @date:2024/1/31,16:42
*/
public
static
class
HpKc010
{
/**
* 查询库存信息
*
* @param ids
* @return
*/
public
static
List
<
HPKC010
>
listKc010
(
List
<
Long
>
ids
)
{
public
static
List
<
HPKC010
>
list
(
List
<
Long
>
ids
)
{
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
null
;
}
...
...
@@ -306,8 +353,8 @@ public class HPKCTools {
* @param ids
* @return
*/
public
static
Map
<
Long
,
HPKC010
>
mapKc010
(
List
<
Long
>
ids
)
{
List
<
HPKC010
>
results
=
listKc010
(
ids
);
public
static
Map
<
Long
,
HPKC010
>
map
(
List
<
Long
>
ids
)
{
List
<
HPKC010
>
results
=
list
(
ids
);
if
(
CollectionUtils
.
isEmpty
(
results
))
{
return
null
;
}
...
...
@@ -320,7 +367,7 @@ public class HPKCTools {
* @param ids
* @return
*/
public
static
void
lockKc010
(
List
<
Long
>
ids
)
{
public
static
void
lock
(
List
<
Long
>
ids
)
{
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
;
}
...
...
@@ -329,6 +376,8 @@ public class HPKCTools {
DaoBase
.
getInstance
().
update
(
HPSqlConstant
.
HPKC010
.
LOCK
,
queryMap
);
}
}
/**
* 更新库存
*
...
...
src/main/java/com/baosight/hpjx/util/StringUtils.java
View file @
f7796178
package
com
.
baosight
.
hpjx
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLDecoder
;
import
java.util.Map
;
import
java.util.UUID
;
/**
...
...
@@ -109,4 +115,17 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
return
str
.
length
()
>
endIndex
?
str
.
substring
(
0
,
endIndex
)
:
str
;
}
/**
* 解码参数
*
* @param parameter
* @return
*/
public
static
Map
<
String
,
Object
>
encodeParam
(
String
parameter
)
throws
UnsupportedEncodingException
{
// 帆软传递进来的参数进行了两次编码,因此需要进行两次解码
String
paramsText
=
URLDecoder
.
decode
(
parameter
,
"UTF-8"
);
paramsText
=
URLDecoder
.
decode
(
paramsText
,
"UTF-8"
);
return
JSONObject
.
parseObject
(
paramsText
).
getInnerMap
();
}
}
src/main/webapp/HP/KC/HPKC004.js
View file @
f7796178
...
...
@@ -18,6 +18,9 @@ $(function () {
// 挑选库存
$
(
"#SELECT_STOCK"
).
on
(
"click"
,
selectStock
);
// 导出打印
$
(
"#PRINT"
).
on
(
"click"
,
exportPrint
);
});
...
...
@@ -59,3 +62,31 @@ let selectStockCallback = function () {
// 关闭弹窗
JSColorbox
.
close
();
}
/**
* 导出打印
*/
let
exportPrint
=
function
()
{
let
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
<
1
)
{
message
(
"请选择同一个项目的数据"
)
return
;
}
let
saleIds
=
[];
let
projCodeTemp
;
for
(
let
i
=
0
;
i
<
rows
.
length
;
i
++
)
{
let
projCode
=
rows
[
i
][
'projCode'
];
if
(
projCodeTemp
==
null
)
{
projCodeTemp
=
projCode
;
}
else
if
(
projCodeTemp
!=
projCode
)
{
message
(
"第"
+
(
i
+
1
)
+
"行项目号不一致,请选择同一个项目的数据"
);
return
;
}
saleIds
.
push
(
rows
[
i
][
'id'
]);
}
let
parameter
=
{
"saleIds"
:
saleIds
};
window
.
location
=
IPLATUI
.
CONTEXT_PATH
+
"/HP/KC/HPKC90.jsp?route=1¶meter="
+
encodeURI
(
encodeURI
(
JSON
.
stringify
(
parameter
)));
}
src/main/webapp/HP/KC/HPKC004.jsp
View file @
f7796178
...
...
@@ -8,66 +8,63 @@
<EF:EFPage
title=
"销售出库单"
>
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<div
class=
"row"
>
<EF:EFDatePicker
cname=
"单据日期"
ename=
"inqu_status-0-receiptDate"
colWidth=
"3"
format=
"yyyy-MM-dd"
readonly=
"true"
/>
<EF:EFInput
cname=
"销售单号"
ename=
"inqu_status-0-saleNo"
colWidth=
"3"
/>
<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', '3', '4')"
/>
</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:EFDatePicker
cname=
"单据日期"
ename=
"receiptDate"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
format=
"yyyy-MM-dd"
readonly=
"true"
/>
<EF:EFInput
cname=
"销售单号"
ename=
"saleNo"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
/>
<EF:EFInput
cname=
"项目号"
ename=
"projCode"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
/>
<EF:EFInput
cname=
"项目名称"
ename=
"projName"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
/>
</div>
<div
class=
"row"
>
<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
cname=
"规格"
ename=
"inqu_status-0-spec"
colWidth=
"3"
filter=
"contains"
>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFOptions
blockId=
"spec_name_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFSelect>
<EF:EFDateSpan
startCname=
"创建日期(从)"
endCname=
"至"
blockId=
"inqu_status"
startName=
"createdDateFrom"
endName=
"createdDateTo"
row=
"0"
role=
"date"
format=
"yyyy-MM-dd"
ratio=
"3:3"
satrtRatio=
"4:8"
endRatio=
"4:8"
readonly=
"true"
>
</EF:EFDateSpan>
<EF:EFInput
cname=
"部件编码"
ename=
"inventCode"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
/>
<EF:EFInput
cname=
"部件名称"
ename=
"inventName"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
/>
<EF:EFInput
cname=
"零部件编码"
ename=
"subInventCode"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
/>
<EF:EFInput
cname=
"零部件名称"
ename=
"subInventName"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
/>
</div>
<div
class=
"row"
>
<EF:EFSelect
cname=
"是否删除"
ename=
"inqu_status-0-deleteFlag"
colWidth=
"3"
defaultValue=
"0"
>
<EF:EFSelect
cname=
"是否打印"
ename=
"isPrint"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
defaultValue=
""
>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFCodeOption
codeName=
"hpjx.hpjx.isPrint"
/>
</EF:EFSelect>
<EF:EFSelect
cname=
"是否删除"
ename=
"deleteFlag"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
defaultValue=
"0"
>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFCodeOption
codeName=
"hpjx.hpjx.deleteFlag"
/>
</EF:EFSelect>
<EF:EFDateSpan
startCname=
"创建日期(从)"
endCname=
"至"
startName=
"createdDateFrom"
endName=
"createdDateTo"
blockId=
"inqu_status"
row=
"0"
role=
"date"
format=
"yyyy-MM-dd"
ratio=
"3:3"
satrtRatio=
"4:8"
endRatio=
"4:8"
readonly=
"true"
>
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion
id=
"result"
title=
"明细信息"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
isFloat=
"true"
checkMode=
"row"
>
<EF:EFColumn
ename=
"id"
cname=
"内码"
hidden=
"true"
/>
<EF:EFColumn
ename=
"saleNo"
cname=
"销售单号"
enable=
"false"
width=
"140"
align=
"center"
/>
<EF:EFColumn
ename=
"receiptDate"
cname=
"单据日期"
enable=
"false"
width=
"90"
align=
"center"
editType=
"date"
dateFormat=
"yyyy-MM-dd"
parseFormats=
"['yyyyMMdd']"
/>
<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=
"projName"
cname=
"项目名称"
enable=
"false"
width=
"140"
align=
"center"
/>
<EF:EFColumn
ename=
"inventName"
cname=
"部件名称"
enable=
"false"
width=
"120"
align=
"center"
/>
<EF:EFColumn
ename=
"subInventName"
cname=
"零部件名称"
enable=
"false"
width=
"120"
align=
"center"
/>
<EF:EFColumn
ename=
"amount"
cname=
"数量"
enable=
"false"
format=
"{0:N3}"
maxLength=
"20"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"weight"
cname=
"重量"
enable=
"false"
format=
"{0:N3}"
maxLength=
"20"
width=
"100"
<EF:EFColumn
ename=
"length"
cname=
"长"
enable=
"false"
format=
"{0:N3}"
maxLength=
"20"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"width"
cname=
"宽"
enable=
"false"
format=
"{0:N3}"
maxLength=
"20"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"thick"
cname=
"厚"
enable=
"false"
format=
"{0:N3}"
maxLength=
"20"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"unitWeight"
cname=
"单重"
enable=
"false"
format=
"{0:N3}"
maxLength=
"20"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"weight"
cname=
"总重"
enable=
"false"
format=
"{0:N3}"
maxLength=
"20"
width=
"100"
align=
"center"
/>
<EF:EFComboColumn
ename=
"isPrint"
cname=
"是否打印"
width=
"80"
align=
"center"
>
<EF:EFCodeOption
codeName=
"hpjx.hpjx.isPrint"
/>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"remark"
cname=
"备注"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"projCode"
cname=
"项目号"
enable=
"false"
width=
"140"
align=
"center"
/>
<EF:EFColumn
ename=
"inventCode"
cname=
"部件编码"
enable=
"false"
width=
"120"
align=
"center"
/>
<EF:EFColumn
ename=
"subInventCode"
cname=
"零部件编码"
enable=
"false"
width=
"120"
align=
"center"
/>
<EF:EFColumn
ename=
"prodNo"
cname=
"生产订单号"
enable=
"false"
width=
"140"
align=
"center"
/>
<EF:EFColumn
ename=
"saleNo"
cname=
"销售单号"
enable=
"false"
width=
"140"
align=
"center"
/>
<EF:EFColumn
ename=
"oldSaleNo"
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"
...
...
src/main/webapp/HP/KC/HPKC90.jsp
View file @
f7796178
<!DOCTYPE html>
<
%@
page
contentType=
"text/html;charset=UTF-8"
%
>
<
%@
page
import=
"com.baosight.hpjx.hp.kc.tools.CKExcelTools"
%
>
<
%@
page
import=
"com.baosight.iplat4j.core.exception.PlatException"
%
>
<
%
try
{
//
1
.出库单
if
("
1
".
equals
(
request
.
getParameter
("
route
")))
{
CKExcelTools
.
downloadFile
(
pageContext
);
}
else
{
throw
new
PlatException
("非法的路由信息");
}
out
.
clear
();
out =
pageContext.pushBody();
}
catch
(
Exception
e
)
{
}
catch
(
Throwable
e
)
{
request
.
setAttribute
("
iplat_msgKey
",
"
ES001
");
request
.
setAttribute
("
iplat_msg
",
"出库单
下载失败");
request
.
setAttribute
("
iplat_msg
",
"文件
下载失败");
request
.
setAttribute
("
iplat_msgDetail
",
e
.
toString
());
request
.
getRequestDispatcher
("/
EU
/
DM
/
EUDM30
.
jsp
").
forward
(
request
,
response
);
}
%
>
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