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
3891d88f
Commit
3891d88f
authored
Feb 23, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.生产库存收发存统计
parent
2bf7b156
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
373 additions
and
317 deletions
+373
-317
HPSqlConstant.java
...ain/java/com/baosight/hpjx/hp/constant/HPSqlConstant.java
+15
-1
HPKC009A.java
src/main/java/com/baosight/hpjx/hp/kc/domain/HPKC009A.java
+134
-135
ServiceHPKC009A.java
...java/com/baosight/hpjx/hp/kc/service/ServiceHPKC009A.java
+86
-109
ServiceHPKC011A.java
...java/com/baosight/hpjx/hp/kc/service/ServiceHPKC011A.java
+41
-0
HPKC009A.xml
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC009A.xml
+22
-22
HPKC011A.xml
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC011A.xml
+8
-8
HPSC001.xml
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC001.xml
+27
-40
HPSCTools.java
src/main/java/com/baosight/hpjx/hp/sc/tools/HPSCTools.java
+39
-1
HPSC005.js
src/main/webapp/HP/SC/HPSC005.js
+1
-1
No files found.
src/main/java/com/baosight/hpjx/hp/constant/HPSqlConstant.java
View file @
3891d88f
...
...
@@ -189,7 +189,7 @@ public class HPSqlConstant {
public
class
HPKC010A
{
// 按日期删除
public
static
final
String
DELETE_BY_TIME
=
"HPKC0
09
.deleteByTime"
;
public
static
final
String
DELETE_BY_TIME
=
"HPKC0
10A
.deleteByTime"
;
// 备份数量
public
static
final
String
BACKUP
=
"HPKC010A.backup"
;
}
...
...
@@ -207,6 +207,20 @@ public class HPSqlConstant {
}
/**
* HPKC011A SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public
class
HPKC011A
{
// 按日期删除
public
static
final
String
DELETE_BY_TIME
=
"HPKC011A.deleteByTime"
;
// 备份数量
public
static
final
String
BACKUP
=
"HPKC011A.backup"
;
}
/**
* HPPZ010 SQL 定义
*
* @author:songx
...
...
src/main/java/com/baosight/hpjx/hp/kc/domain/HPKC009A.java
View file @
3891d88f
package
com
.
baosight
.
hpjx
.
hp
.
kc
.
domain
;
import
com.baosight.iplat4j.core.data.DaoEPBase
;
import
com.baosight.iplat4j.core.ei.EiColumn
;
import
com.baosight.iplat4j.core.util.NumberUtils
;
import
com.baosight.iplat4j.core.util.StringUtils
;
import
java.math.BigDecimal
;
import
com.baosight.iplat4j.core.ei.EiColumn
;
import
com.baosight.iplat4j.core.data.DaoEPBase
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.baosight.iplat4j.core.util.StringUtils
;
/**
* Project: <br>
...
...
@@ -17,12 +16,12 @@ import java.util.Map;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-02-23 1
3:43:22
create
* @history 2024-02-23 1
6:22:11
create
*/
public
class
HPKC009A
extends
DaoEPBase
{
private
static
final
long
serialVersionUID
=
1L
;
public
static
final
String
FIELD_ID
=
"id"
;
public
static
final
String
FIELD_COMPANY_CODE
=
"companyCode"
;
/* 企业编码 预留*/
public
static
final
String
FIELD_DEP_CODE
=
"depCode"
;
/* 部门编码*/
...
...
@@ -38,10 +37,10 @@ public class HPKC009A extends DaoEPBase {
public
static
final
String
FIELD_WH_NAME
=
"whName"
;
/* 仓库名称*/
public
static
final
String
FIELD_PROJ_CODE
=
"projCode"
;
/* 项目编码*/
public
static
final
String
FIELD_PROJ_NAME
=
"projName"
;
/* 项目名称*/
public
static
final
String
FIELD_
PRDT_CODE
=
"prdtCode"
;
/* 产品
编码*/
public
static
final
String
FIELD_
PRDT_NAME
=
"prdtName"
;
/* 产品
名称*/
public
static
final
String
FIELD_
PART_CODE
=
"par
tCode"
;
/* 零件编码*/
public
static
final
String
FIELD_
PART_NAME
=
"par
tName"
;
/* 零件名称*/
public
static
final
String
FIELD_
INVENT_CODE
=
"inventCode"
;
/* 部件
编码*/
public
static
final
String
FIELD_
INVENT_NAME
=
"inventName"
;
/* 部件
名称*/
public
static
final
String
FIELD_
SUB_INVENT_CODE
=
"subInven
tCode"
;
/* 零件编码*/
public
static
final
String
FIELD_
SUB_INVENT_NAME
=
"subInven
tName"
;
/* 零件名称*/
public
static
final
String
FIELD_INIT_AMOUNT
=
"initAmount"
;
/* 期初数量*/
public
static
final
String
FIELD_INIT_WEIGHT
=
"initWeight"
;
/* 期初重量*/
public
static
final
String
FIELD_ENTER_AMOUNT
=
"enterAmount"
;
/* 入库数量*/
...
...
@@ -52,7 +51,7 @@ public class HPKC009A extends DaoEPBase {
public
static
final
String
FIELD_PD_DIFF_WEIGHT
=
"pdDiffWeight"
;
/* 盘点差异重量*/
public
static
final
String
FIELD_END_AMOUNT
=
"endAmount"
;
/* 期末数量*/
public
static
final
String
FIELD_END_WEIGHT
=
"endWeight"
;
/* 期末重量*/
public
static
final
String
COL_ID
=
"ID"
;
public
static
final
String
COL_COMPANY_CODE
=
"COMPANY_CODE"
;
/* 企业编码 预留*/
public
static
final
String
COL_DEP_CODE
=
"DEP_CODE"
;
/* 部门编码*/
...
...
@@ -68,10 +67,10 @@ public class HPKC009A extends DaoEPBase {
public
static
final
String
COL_WH_NAME
=
"WH_NAME"
;
/* 仓库名称*/
public
static
final
String
COL_PROJ_CODE
=
"PROJ_CODE"
;
/* 项目编码*/
public
static
final
String
COL_PROJ_NAME
=
"PROJ_NAME"
;
/* 项目名称*/
public
static
final
String
COL_
PRDT_CODE
=
"PRDT_CODE"
;
/* 产品
编码*/
public
static
final
String
COL_
PRDT_NAME
=
"PRDT_NAME"
;
/* 产品
名称*/
public
static
final
String
COL_
PART_CODE
=
"PAR
T_CODE"
;
/* 零件编码*/
public
static
final
String
COL_
PART_NAME
=
"PAR
T_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_INVEN
T_CODE"
;
/* 零件编码*/
public
static
final
String
COL_
SUB_INVENT_NAME
=
"SUB_INVEN
T_NAME"
;
/* 零件名称*/
public
static
final
String
COL_INIT_AMOUNT
=
"INIT_AMOUNT"
;
/* 期初数量*/
public
static
final
String
COL_INIT_WEIGHT
=
"INIT_WEIGHT"
;
/* 期初重量*/
public
static
final
String
COL_ENTER_AMOUNT
=
"ENTER_AMOUNT"
;
/* 入库数量*/
...
...
@@ -82,13 +81,13 @@ public class HPKC009A extends DaoEPBase {
public
static
final
String
COL_PD_DIFF_WEIGHT
=
"PD_DIFF_WEIGHT"
;
/* 盘点差异重量*/
public
static
final
String
COL_END_AMOUNT
=
"END_AMOUNT"
;
/* 期末数量*/
public
static
final
String
COL_END_WEIGHT
=
"END_WEIGHT"
;
/* 期末重量*/
public
static
final
String
QUERY
=
"HPKC009A.query"
;
public
static
final
String
COUNT
=
"HPKC009A.count"
;
public
static
final
String
INSERT
=
"HPKC009A.insert"
;
public
static
final
String
UPDATE
=
"HPKC009A.update"
;
public
static
final
String
DELETE
=
"HPKC009A.delete"
;
private
Long
id
;
private
String
companyCode
=
" "
;
/* 企业编码 预留*/
private
String
depCode
=
" "
;
/* 部门编码*/
...
...
@@ -104,10 +103,10 @@ public class HPKC009A extends DaoEPBase {
private
String
whName
=
" "
;
/* 仓库名称*/
private
String
projCode
=
" "
;
/* 项目编码*/
private
String
projName
=
" "
;
/* 项目名称*/
private
String
prdtCode
=
" "
;
/* 产品
编码*/
private
String
prdtName
=
" "
;
/* 产品
名称*/
private
String
par
tCode
=
" "
;
/* 零件编码*/
private
String
par
tName
=
" "
;
/* 零件名称*/
private
String
inventCode
=
" "
;
/* 部件
编码*/
private
String
inventName
=
" "
;
/* 部件
名称*/
private
String
subInven
tCode
=
" "
;
/* 零件编码*/
private
String
subInven
tName
=
" "
;
/* 零件名称*/
private
BigDecimal
initAmount
=
new
BigDecimal
(
0.000
);
/* 期初数量*/
private
BigDecimal
initWeight
=
new
BigDecimal
(
0.000
);
/* 期初重量*/
private
BigDecimal
enterAmount
=
new
BigDecimal
(
0.000
);
/* 入库数量*/
...
...
@@ -118,170 +117,170 @@ public class HPKC009A extends DaoEPBase {
private
BigDecimal
pdDiffWeight
=
new
BigDecimal
(
0.000
);
/* 盘点差异重量*/
private
BigDecimal
endAmount
=
new
BigDecimal
(
0.000
);
/* 期末数量*/
private
BigDecimal
endWeight
=
new
BigDecimal
(
0.000
);
/* 期末重量*/
/**
* initialize the metadata.
*/
public
void
initMetaData
()
{
EiColumn
eiColumn
;
eiColumn
=
new
EiColumn
(
FIELD_ID
);
eiColumn
.
setPrimaryKey
(
true
);
eiColumn
.
setDescName
(
" "
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_COMPANY_CODE
);
eiColumn
.
setDescName
(
"企业编码 预留"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_DEP_CODE
);
eiColumn
.
setDescName
(
"部门编码"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_CREATED_BY
);
eiColumn
.
setDescName
(
"创建人"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_CREATED_NAME
);
eiColumn
.
setDescName
(
"创建人名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_CREATED_TIME
);
eiColumn
.
setDescName
(
"创建时间"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_UPDATED_BY
);
eiColumn
.
setDescName
(
"更新人"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_UPDATED_NAME
);
eiColumn
.
setDescName
(
"更新人名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_UPDATED_TIME
);
eiColumn
.
setDescName
(
"更新时间"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_DATE_TYPE
);
eiColumn
.
setDescName
(
"日期类型:DAY:天,MONTH:月"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_DATE_PROC
);
eiColumn
.
setDescName
(
"日期"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_WH_CODE
);
eiColumn
.
setDescName
(
"仓库编码"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_WH_NAME
);
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_
PRD
T_CODE
);
eiColumn
.
setDescName
(
"
产品
编码"
);
eiColumn
=
new
EiColumn
(
FIELD_
INVEN
T_CODE
);
eiColumn
.
setDescName
(
"
部件
编码"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_
PRD
T_NAME
);
eiColumn
.
setDescName
(
"
产品
名称"
);
eiColumn
=
new
EiColumn
(
FIELD_
INVEN
T_NAME
);
eiColumn
.
setDescName
(
"
部件
名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_
PAR
T_CODE
);
eiColumn
=
new
EiColumn
(
FIELD_
SUB_INVEN
T_CODE
);
eiColumn
.
setDescName
(
"零件编码"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_
PAR
T_NAME
);
eiColumn
=
new
EiColumn
(
FIELD_
SUB_INVEN
T_NAME
);
eiColumn
.
setDescName
(
"零件名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_INIT_AMOUNT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
15
);
eiColumn
.
setDescName
(
"期初数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_INIT_WEIGHT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
15
);
eiColumn
.
setDescName
(
"期初重量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_ENTER_AMOUNT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
15
);
eiColumn
.
setDescName
(
"入库数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_ENTER_WEIGHT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
15
);
eiColumn
.
setDescName
(
"入库重量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_OUTER_AMOUNT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
15
);
eiColumn
.
setDescName
(
"出库数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_OUTER_WEIGHT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
15
);
eiColumn
.
setDescName
(
"出库重量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_PD_DIFF_AMOUNT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
15
);
eiColumn
.
setDescName
(
"盘点差异数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_PD_DIFF_WEIGHT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
15
);
eiColumn
.
setDescName
(
"盘点差异重量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_END_AMOUNT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
15
);
eiColumn
.
setDescName
(
"期末数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_END_WEIGHT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
15
);
eiColumn
.
setDescName
(
"期末重量"
);
eiMetadata
.
addMeta
(
eiColumn
);
}
/**
* the constructor.
*/
public
HPKC009A
()
{
initMetaData
();
}
/**
* get the id .
* @return the id
...
...
@@ -289,7 +288,7 @@ public class HPKC009A extends DaoEPBase {
public
Long
getId
()
{
return
this
.
id
;
}
/**
* set the id .
*
...
...
@@ -305,7 +304,7 @@ public class HPKC009A extends DaoEPBase {
public
String
getCompanyCode
()
{
return
this
.
companyCode
;
}
/**
* set the companyCode - 企业编码 预留.
*
...
...
@@ -321,7 +320,7 @@ public class HPKC009A extends DaoEPBase {
public
String
getDepCode
()
{
return
this
.
depCode
;
}
/**
* set the depCode - 部门编码.
*
...
...
@@ -337,7 +336,7 @@ public class HPKC009A extends DaoEPBase {
public
String
getCreatedBy
()
{
return
this
.
createdBy
;
}
/**
* set the createdBy - 创建人.
*
...
...
@@ -353,7 +352,7 @@ public class HPKC009A extends DaoEPBase {
public
String
getCreatedName
()
{
return
this
.
createdName
;
}
/**
* set the createdName - 创建人名称.
*
...
...
@@ -369,7 +368,7 @@ public class HPKC009A extends DaoEPBase {
public
String
getCreatedTime
()
{
return
this
.
createdTime
;
}
/**
* set the createdTime - 创建时间.
*
...
...
@@ -385,7 +384,7 @@ public class HPKC009A extends DaoEPBase {
public
String
getUpdatedBy
()
{
return
this
.
updatedBy
;
}
/**
* set the updatedBy - 更新人.
*
...
...
@@ -401,7 +400,7 @@ public class HPKC009A extends DaoEPBase {
public
String
getUpdatedName
()
{
return
this
.
updatedName
;
}
/**
* set the updatedName - 更新人名称.
*
...
...
@@ -417,7 +416,7 @@ public class HPKC009A extends DaoEPBase {
public
String
getUpdatedTime
()
{
return
this
.
updatedTime
;
}
/**
* set the updatedTime - 更新时间.
*
...
...
@@ -433,7 +432,7 @@ public class HPKC009A extends DaoEPBase {
public
String
getDateType
()
{
return
this
.
dateType
;
}
/**
* set the dateType - 日期类型:DAY:天,MONTH:月.
*
...
...
@@ -449,7 +448,7 @@ public class HPKC009A extends DaoEPBase {
public
String
getDateProc
()
{
return
this
.
dateProc
;
}
/**
* set the dateProc - 日期.
*
...
...
@@ -465,7 +464,7 @@ public class HPKC009A extends DaoEPBase {
public
String
getWhCode
()
{
return
this
.
whCode
;
}
/**
* set the whCode - 仓库编码.
*
...
...
@@ -481,7 +480,7 @@ public class HPKC009A extends DaoEPBase {
public
String
getWhName
()
{
return
this
.
whName
;
}
/**
* set the whName - 仓库名称.
*
...
...
@@ -497,7 +496,7 @@ public class HPKC009A extends DaoEPBase {
public
String
getProjCode
()
{
return
this
.
projCode
;
}
/**
* set the projCode - 项目编码.
*
...
...
@@ -513,7 +512,7 @@ public class HPKC009A extends DaoEPBase {
public
String
getProjName
()
{
return
this
.
projName
;
}
/**
* set the projName - 项目名称.
*
...
...
@@ -523,68 +522,68 @@ public class HPKC009A extends DaoEPBase {
this
.
projName
=
projName
;
}
/**
* get the
prdtCode - 产品
编码.
* @return the
prd
tCode
* get the
inventCode - 部件
编码.
* @return the
inven
tCode
*/
public
String
get
Prd
tCode
()
{
return
this
.
prd
tCode
;
public
String
get
Inven
tCode
()
{
return
this
.
inven
tCode
;
}
/**
* set the
prdtCode - 产品
编码.
* set the
inventCode - 部件
编码.
*
* @param
prdtCode - 产品
编码
* @param
inventCode - 部件
编码
*/
public
void
set
PrdtCode
(
String
prd
tCode
)
{
this
.
prdtCode
=
prd
tCode
;
public
void
set
InventCode
(
String
inven
tCode
)
{
this
.
inventCode
=
inven
tCode
;
}
/**
* get the
prdtName - 产品
名称.
* @return the
prd
tName
* get the
inventName - 部件
名称.
* @return the
inven
tName
*/
public
String
get
Prd
tName
()
{
return
this
.
prd
tName
;
public
String
get
Inven
tName
()
{
return
this
.
inven
tName
;
}
/**
* set the
prdtName - 产品
名称.
* set the
inventName - 部件
名称.
*
* @param
prdtName - 产品
名称
* @param
inventName - 部件
名称
*/
public
void
set
PrdtName
(
String
prd
tName
)
{
this
.
prdtName
=
prd
tName
;
public
void
set
InventName
(
String
inven
tName
)
{
this
.
inventName
=
inven
tName
;
}
/**
* get the
par
tCode - 零件编码.
* @return the
par
tCode
* get the
subInven
tCode - 零件编码.
* @return the
subInven
tCode
*/
public
String
get
Par
tCode
()
{
return
this
.
par
tCode
;
public
String
get
SubInven
tCode
()
{
return
this
.
subInven
tCode
;
}
/**
* set the
par
tCode - 零件编码.
* set the
subInven
tCode - 零件编码.
*
* @param
par
tCode - 零件编码
* @param
subInven
tCode - 零件编码
*/
public
void
set
PartCode
(
String
par
tCode
)
{
this
.
partCode
=
par
tCode
;
public
void
set
SubInventCode
(
String
subInven
tCode
)
{
this
.
subInventCode
=
subInven
tCode
;
}
/**
* get the
par
tName - 零件名称.
* @return the
par
tName
* get the
subInven
tName - 零件名称.
* @return the
subInven
tName
*/
public
String
get
Par
tName
()
{
return
this
.
par
tName
;
public
String
get
SubInven
tName
()
{
return
this
.
subInven
tName
;
}
/**
* set the
par
tName - 零件名称.
* set the
subInven
tName - 零件名称.
*
* @param
par
tName - 零件名称
* @param
subInven
tName - 零件名称
*/
public
void
set
PartName
(
String
par
tName
)
{
this
.
partName
=
par
tName
;
public
void
set
SubInventName
(
String
subInven
tName
)
{
this
.
subInventName
=
subInven
tName
;
}
/**
* get the initAmount - 期初数量.
...
...
@@ -593,7 +592,7 @@ public class HPKC009A extends DaoEPBase {
public
BigDecimal
getInitAmount
()
{
return
this
.
initAmount
;
}
/**
* set the initAmount - 期初数量.
*
...
...
@@ -609,7 +608,7 @@ public class HPKC009A extends DaoEPBase {
public
BigDecimal
getInitWeight
()
{
return
this
.
initWeight
;
}
/**
* set the initWeight - 期初重量.
*
...
...
@@ -625,7 +624,7 @@ public class HPKC009A extends DaoEPBase {
public
BigDecimal
getEnterAmount
()
{
return
this
.
enterAmount
;
}
/**
* set the enterAmount - 入库数量.
*
...
...
@@ -641,7 +640,7 @@ public class HPKC009A extends DaoEPBase {
public
BigDecimal
getEnterWeight
()
{
return
this
.
enterWeight
;
}
/**
* set the enterWeight - 入库重量.
*
...
...
@@ -657,7 +656,7 @@ public class HPKC009A extends DaoEPBase {
public
BigDecimal
getOuterAmount
()
{
return
this
.
outerAmount
;
}
/**
* set the outerAmount - 出库数量.
*
...
...
@@ -673,7 +672,7 @@ public class HPKC009A extends DaoEPBase {
public
BigDecimal
getOuterWeight
()
{
return
this
.
outerWeight
;
}
/**
* set the outerWeight - 出库重量.
*
...
...
@@ -689,7 +688,7 @@ public class HPKC009A extends DaoEPBase {
public
BigDecimal
getPdDiffAmount
()
{
return
this
.
pdDiffAmount
;
}
/**
* set the pdDiffAmount - 盘点差异数量.
*
...
...
@@ -705,7 +704,7 @@ public class HPKC009A extends DaoEPBase {
public
BigDecimal
getPdDiffWeight
()
{
return
this
.
pdDiffWeight
;
}
/**
* set the pdDiffWeight - 盘点差异重量.
*
...
...
@@ -721,7 +720,7 @@ public class HPKC009A extends DaoEPBase {
public
BigDecimal
getEndAmount
()
{
return
this
.
endAmount
;
}
/**
* set the endAmount - 期末数量.
*
...
...
@@ -737,7 +736,7 @@ public class HPKC009A extends DaoEPBase {
public
BigDecimal
getEndWeight
()
{
return
this
.
endWeight
;
}
/**
* set the endWeight - 期末重量.
*
...
...
@@ -753,7 +752,7 @@ public class HPKC009A extends DaoEPBase {
*/
@Override
public
void
fromMap
(
Map
map
)
{
setId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_ID
)),
id
));
setCompanyCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_COMPANY_CODE
)),
companyCode
));
setDepCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DEP_CODE
)),
depCode
));
...
...
@@ -769,10 +768,10 @@ public class HPKC009A extends DaoEPBase {
setWhName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_WH_NAME
)),
whName
));
setProjCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_PROJ_CODE
)),
projCode
));
setProjName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_PROJ_NAME
)),
projName
));
set
PrdtCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_PRDT_CODE
)),
prd
tCode
));
set
PrdtName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_PRDT_NAME
)),
prd
tName
));
set
PartCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_PART_CODE
)),
par
tCode
));
set
PartName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_PART_NAME
)),
par
tName
));
set
InventCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_INVENT_CODE
)),
inven
tCode
));
set
InventName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_INVENT_NAME
)),
inven
tName
));
set
SubInventCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_SUB_INVENT_CODE
)),
subInven
tCode
));
set
SubInventName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_SUB_INVENT_NAME
)),
subInven
tName
));
setInitAmount
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_INIT_AMOUNT
)),
initAmount
));
setInitWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_INIT_WEIGHT
)),
initWeight
));
setEnterAmount
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_ENTER_AMOUNT
)),
enterAmount
));
...
...
@@ -784,13 +783,13 @@ public class HPKC009A extends DaoEPBase {
setEndAmount
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_END_AMOUNT
)),
endAmount
));
setEndWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_END_WEIGHT
)),
endWeight
));
}
/**
* set the value to Map.
*/
@Override
public
Map
toMap
()
{
Map
map
=
new
HashMap
();
map
.
put
(
FIELD_ID
,
StringUtils
.
toString
(
id
,
eiMetadata
.
getMeta
(
FIELD_ID
)));
map
.
put
(
FIELD_COMPANY_CODE
,
StringUtils
.
toString
(
companyCode
,
eiMetadata
.
getMeta
(
FIELD_COMPANY_CODE
)));
...
...
@@ -807,10 +806,10 @@ public class HPKC009A extends DaoEPBase {
map
.
put
(
FIELD_WH_NAME
,
StringUtils
.
toString
(
whName
,
eiMetadata
.
getMeta
(
FIELD_WH_NAME
)));
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_
PRDT_CODE
,
StringUtils
.
toString
(
prdtCode
,
eiMetadata
.
getMeta
(
FIELD_PRD
T_CODE
)));
map
.
put
(
FIELD_
PRDT_NAME
,
StringUtils
.
toString
(
prdtName
,
eiMetadata
.
getMeta
(
FIELD_PRD
T_NAME
)));
map
.
put
(
FIELD_
PART_CODE
,
StringUtils
.
toString
(
partCode
,
eiMetadata
.
getMeta
(
FIELD_PAR
T_CODE
)));
map
.
put
(
FIELD_
PART_NAME
,
StringUtils
.
toString
(
partName
,
eiMetadata
.
getMeta
(
FIELD_PAR
T_NAME
)));
map
.
put
(
FIELD_
INVENT_CODE
,
StringUtils
.
toString
(
inventCode
,
eiMetadata
.
getMeta
(
FIELD_INVEN
T_CODE
)));
map
.
put
(
FIELD_
INVENT_NAME
,
StringUtils
.
toString
(
inventName
,
eiMetadata
.
getMeta
(
FIELD_INVEN
T_NAME
)));
map
.
put
(
FIELD_
SUB_INVENT_CODE
,
StringUtils
.
toString
(
subInventCode
,
eiMetadata
.
getMeta
(
FIELD_SUB_INVEN
T_CODE
)));
map
.
put
(
FIELD_
SUB_INVENT_NAME
,
StringUtils
.
toString
(
subInventName
,
eiMetadata
.
getMeta
(
FIELD_SUB_INVEN
T_NAME
)));
map
.
put
(
FIELD_INIT_AMOUNT
,
StringUtils
.
toString
(
initAmount
,
eiMetadata
.
getMeta
(
FIELD_INIT_AMOUNT
)));
map
.
put
(
FIELD_INIT_WEIGHT
,
StringUtils
.
toString
(
initWeight
,
eiMetadata
.
getMeta
(
FIELD_INIT_WEIGHT
)));
map
.
put
(
FIELD_ENTER_AMOUNT
,
StringUtils
.
toString
(
enterAmount
,
eiMetadata
.
getMeta
(
FIELD_ENTER_AMOUNT
)));
...
...
@@ -821,7 +820,7 @@ public class HPKC009A extends DaoEPBase {
map
.
put
(
FIELD_PD_DIFF_WEIGHT
,
StringUtils
.
toString
(
pdDiffWeight
,
eiMetadata
.
getMeta
(
FIELD_PD_DIFF_WEIGHT
)));
map
.
put
(
FIELD_END_AMOUNT
,
StringUtils
.
toString
(
endAmount
,
eiMetadata
.
getMeta
(
FIELD_END_AMOUNT
)));
map
.
put
(
FIELD_END_WEIGHT
,
StringUtils
.
toString
(
endWeight
,
eiMetadata
.
getMeta
(
FIELD_END_WEIGHT
)));
return
map
;
}
}
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC009A.java
View file @
3891d88f
...
...
@@ -3,19 +3,16 @@ package com.baosight.hpjx.hp.kc.service;
import
com.baosight.hpjx.common.DdynamicEnum
;
import
com.baosight.hpjx.core.constant.CommonConstant
;
import
com.baosight.hpjx.hp.constant.HPSqlConstant
;
import
com.baosight.hpjx.hp.kc.domain.HPKC001
;
import
com.baosight.hpjx.hp.kc.domain.HPKC002
;
import
com.baosight.hpjx.hp.kc.domain.HPKC003
;
import
com.baosight.hpjx.hp.kc.domain.HPKC004
;
import
com.baosight.hpjx.hp.kc.domain.HPKC005
;
import
com.baosight.hpjx.hp.kc.domain.HPKC006
;
import
com.baosight.hpjx.hp.kc.domain.HPKC007
;
import
com.baosight.hpjx.hp.kc.domain.HPKC009
;
import
com.baosight.hpjx.hp.kc.domain.HPKC009A
;
import
com.baosight.hpjx.hp.kc.domain.HPKC01
0
A
;
import
com.baosight.hpjx.hp.kc.domain.HPKC01
1
A
;
import
com.baosight.hpjx.hp.pz.domain.HPPZ004
;
import
com.baosight.hpjx.hp.pz.domain.HPPZ007
;
import
com.baosight.hpjx.hp.pz.tools.HPPZTools
;
import
com.baosight.hpjx.hp.sc.domain.HPSC001
;
import
com.baosight.hpjx.hp.sc.tools.HPSCTools
;
import
com.baosight.hpjx.util.BeanUtils
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.DateUtils
;
...
...
@@ -166,98 +163,64 @@ public class ServiceHPKC009A extends ServiceBase {
List
<
HPKC009A
>
newKc009As
=
new
ArrayList
<>();
// 1.1、期末库存
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"yesterTo"
));
List
<
HPKC010A
>
endKcs
=
dao
.
query
(
HPKC010A
.
QUERY
,
queryMap
);
// 1.2、采购入库
List
<
HPKC011A
>
endKcs
=
dao
.
query
(
HPKC011A
.
QUERY
,
queryMap
);
queryMap
.
put
(
"createdTimeFrom"
,
queryMap
.
get
(
"yesterFrom"
)
+
"000000"
);
queryMap
.
put
(
"createdTimeTo"
,
queryMap
.
get
(
"yesterTo"
)
+
"235959"
);
List
<
HPKC001
>
cgRks
=
dao
.
query
(
HPSqlConstant
.
HPKC001
.
STAT_DATE
,
queryMap
);
Map
<
String
,
HPKC001
>
cgRkMap
=
cgRks
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
buildKey
(
item
.
getCompanyCode
(),
item
.
getDepCode
(),
item
.
getInventType
(),
item
.
getInventCode
(),
item
.
getWhCode
(),
item
.
getInventRecordId
()),
item
->
item
));
// 1.3、生产入库
// List<HPKC003> scRks = dao.query(HPSqlConstant.HPKC003.STAT_DATE, queryMap);
// Map<String, HPKC003> scRkMap = scRks.stream().collect(Collectors.toMap(item ->
// buildKey(item.getCompanyCode(), item.getDepCode(), item.getPartType(), item.getPartCode(),
// item.getWhCode(), null), item -> item));
// 1.4、其他入库
List
<
HPKC006
>
qtRks
=
dao
.
query
(
HPSqlConstant
.
HPKC006
.
STAT_DATE
,
queryMap
);
Map
<
String
,
HPKC006
>
qtRkMap
=
qtRks
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
buildKey
(
item
.
getCompanyCode
(),
item
.
getDepCode
(),
item
.
getInventType
(),
item
.
getInventCode
(),
item
.
getWhCode
(),
item
.
getInventRecordId
()),
item
->
item
));
// 1.5、生产领料
List
<
HPKC002
>
scCks
=
dao
.
query
(
HPSqlConstant
.
HPKC002
.
STAT_DATE
,
queryMap
);
Map
<
String
,
HPKC002
>
scCkMap
=
scCks
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
buildKey
(
item
.
getCompanyCode
(),
item
.
getDepCode
(),
item
.
getInventType
(),
item
.
getInventCode
(),
item
.
getWhCode
(),
item
.
getInventRecordId
()),
item
->
item
));
List
<
HPKC003
>
scRks
=
dao
.
query
(
HPSqlConstant
.
HPKC003
.
STAT_DATE
,
queryMap
);
Map
<
String
,
HPKC003
>
scRkMap
=
scRks
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
buildKey
(
item
.
getCompanyCode
(),
item
.
getDepCode
(),
item
.
getWhCode
(),
item
.
getProjCode
(),
item
.
getPrdtCode
(),
item
.
getPartCode
()),
item
->
item
));
// 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.getInventCode(), item.getSubInventCode(),
// 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
->
buildKey
(
item
.
getCompanyCode
(),
item
.
getDepCode
(),
item
.
getInventType
(),
item
.
getInventCode
(),
item
.
getWhCode
(),
item
.
getInventRecordId
()),
item
->
item
));
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
.
getWhCode
(),
item
.
getProjCode
(),
item
.
getInventCode
(),
item
.
getSubInventCode
()),
item
->
item
));
// 1.8、盘点差异数量
List
<
HPKC005
>
pdDiffs
=
dao
.
query
(
HPSqlConstant
.
HPKC005
.
STAT_DATE
,
queryMap
);
Map
<
String
,
HPKC005
>
pdDiffMap
=
pdDiffs
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
buildKey
(
item
.
getCompanyCode
(),
item
.
getDepCode
(),
item
.
getInventType
(),
item
.
getInventCode
(),
item
.
getWhCode
(),
item
.
getInventRecordId
()),
item
->
item
));
//
List<HPKC005> pdDiffs = dao.query(HPSqlConstant.HPKC005.STAT_DATE, queryMap);
//
Map<String, HPKC005> pdDiffMap = pdDiffs.stream().collect(Collectors.toMap(item ->
//
buildKey(item.getCompanyCode(), item.getDepCode(), item.getInventType(), item.getInventCode(),
//
item.getWhCode(), item.getInventRecordId()), item -> item));
// 1.9、期初库存
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"beforeDate"
));
List
<
HPKC009
>
initKcs
=
dao
.
query
(
HPKC009
.
QUERY
,
new
HashMap
<>());
Map
<
String
,
HPKC009
>
initKcMap
=
initKcs
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
buildKey
(
item
.
getCompanyCode
(),
item
.
getDepCode
(),
item
.
get
InventType
(),
item
.
getInvent
Code
(),
item
.
get
WhCode
(),
item
.
getInventRecordId
()),
item
->
item
));
List
<
HPKC009
A
>
initKcs
=
dao
.
query
(
HPKC009A
.
QUERY
,
new
HashMap
<>());
Map
<
String
,
HPKC009
A
>
initKcMap
=
initKcs
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
buildKey
(
item
.
getCompanyCode
(),
item
.
getDepCode
(),
item
.
get
WhCode
(),
item
.
getProj
Code
(),
item
.
get
InventCode
(),
item
.
getSubInventCode
()),
item
->
item
));
// 根据期末库存生成收发存对象
for
(
HPKC010A
endKc
:
endKcs
)
{
String
key
=
buildKey
(
endKc
.
getCompanyCode
(),
endKc
.
getDepCode
(),
endKc
.
getInventType
(),
endKc
.
getInventCode
(),
endKc
.
getWhCode
(),
endKc
.
getInventRecordId
());
HPKC009A
kc009
=
BeanUtils
.
copy
(
endKc
,
HPKC009A
.
class
);
kc009
.
setDateType
(
queryMap
.
get
(
"dateType"
).
toString
());
kc009
.
setDateProc
(
queryMap
.
get
(
"yesterDate"
).
toString
());
// 1.1期末
kc009
.
setEndAmount
(
endKc
.
getAmount
());
kc009
.
setEndWeight
(
endKc
.
getWeight
());
// 1.4、入库
// kc009.setEnterAmount(kc009.getCgEnterAmount().add(kc009.getScEnterAmount())
// .add(kc009.getQtEnterAmount()));
// kc009.setEnterWeight(kc009.getCgEnterWeight().add(kc009.getScEnterWeight())
// .add(kc009.getQtEnterWeight()));
// // 1.5、生产领料
// HPKC002 scCk = scCkMap.get(key);
// kc009.setScOuterAmount(scCk == null ? BigDecimal.ZERO : scCk.getAmount());
// kc009.setScOuterWeight(scCk == null ? BigDecimal.ZERO : scCk.getWeight());
// // 1.6、销售出库
// HPKC004 xsCk = null;//xsCkMap.get(key);
// kc009.setXsOuterAmount(xsCk == null ? BigDecimal.ZERO : xsCk.getAmount());
// kc009.setXsOuterWeight(xsCk == null ? BigDecimal.ZERO : xsCk.getWeight());
// // 1.7、其他出库
// HPKC007 qtCk = qtCkMap.get(key);
// kc009.setQtOuterAmount(qtCk == null ? BigDecimal.ZERO : qtCk.getAmount());
// kc009.setQtOuterWeight(qtCk == null ? BigDecimal.ZERO : qtCk.getWeight());
// // 1.8、出库
// kc009.setOuterAmount(kc009.getScOuterAmount().add(kc009.getXsOuterAmount())
// .add(kc009.getQtOuterAmount()));
// kc009.setOuterWeight(kc009.getScOuterWeight().add(kc009.getXsOuterWeight())
// .add(kc009.getQtOuterWeight()));
for
(
HPKC011A
endKc
:
endKcs
)
{
String
key
=
buildKey
(
endKc
.
getCompanyCode
(),
endKc
.
getDepCode
(),
endKc
.
getWhCode
(),
endKc
.
getProjCode
(),
endKc
.
getInventCode
(),
endKc
.
getSubInventCode
());
HPKC009A
newKc009a
=
BeanUtils
.
copy
(
endKc
,
HPKC009A
.
class
);
newKc009a
.
setDateType
(
queryMap
.
get
(
"dateType"
).
toString
());
newKc009a
.
setDateProc
(
queryMap
.
get
(
"yesterDate"
).
toString
());
// 1.1、期末
newKc009a
.
setEndAmount
(
endKc
.
getAmount
());
newKc009a
.
setEndWeight
(
endKc
.
getWeight
());
// 1.2、入库
HPKC003
scRk
=
scRkMap
.
get
(
key
);
newKc009a
.
setEnterAmount
(
scRk
==
null
?
BigDecimal
.
ZERO
:
scRk
.
getAmount
());
newKc009a
.
setEnterWeight
(
scRk
==
null
?
BigDecimal
.
ZERO
:
scRk
.
getWeight
());
// 1.3、出库
HPKC004
xsCk
=
xsCkMap
.
get
(
key
);
newKc009a
.
setOuterAmount
(
xsCk
==
null
?
BigDecimal
.
ZERO
:
xsCk
.
getAmount
());
newKc009a
.
setOuterWeight
(
xsCk
==
null
?
BigDecimal
.
ZERO
:
xsCk
.
getWeight
());
// 1.8、盘点差异数量
HPKC005
pdDiff
=
pdDiffMap
.
get
(
key
);
kc009
.
setPdDiffAmount
(
pdDiff
==
null
?
BigDecimal
.
ZERO
:
pdDiff
.
getDiffAmount
());
kc009
.
setPdDiffWeight
(
pdDiff
==
null
?
BigDecimal
.
ZERO
:
pdDiff
.
getDiffWeight
());
//
HPKC005 pdDiff = pdDiffMap.get(key);
//
kc009.setPdDiffAmount(pdDiff == null ? BigDecimal.ZERO : pdDiff.getDiffAmount());
//
kc009.setPdDiffWeight(pdDiff == null ? BigDecimal.ZERO : pdDiff.getDiffWeight());
// 1.9、期初
HPKC009
initKc
=
initKcMap
.
get
(
key
);
HPKC009
A
initKc
=
initKcMap
.
get
(
key
);
if
(
initKc
!=
null
)
{
kc009
.
setInitAmount
(
initKc
.
getEndAmount
());
kc009
.
setInitWeight
(
initKc
.
getEndWeight
());
newKc009a
.
setInitAmount
(
initKc
.
getEndAmount
());
newKc009a
.
setInitWeight
(
initKc
.
getEndWeight
());
}
else
{
kc009
.
setInitAmount
(
kc009
.
getEndAmount
().
subtract
(
kc009
.
getPdDiffAmount
())
.
add
(
kc009
.
getOuterAmount
()).
subtract
(
kc009
.
getEnterAmount
()));
kc009
.
setInitWeight
(
kc009
.
getEndWeight
().
subtract
(
kc009
.
getPdDiffWeight
())
.
add
(
kc009
.
getOuterWeight
()).
subtract
(
kc009
.
getEnterWeight
()));
newKc009a
.
setInitAmount
(
newKc009a
.
getEndAmount
().
subtract
(
newKc009a
.
getPdDiffAmount
())
.
add
(
newKc009a
.
getOuterAmount
()).
subtract
(
newKc009a
.
getEnterAmount
()));
newKc009a
.
setInitWeight
(
newKc009a
.
getEndWeight
().
subtract
(
newKc009a
.
getPdDiffWeight
())
.
add
(
newKc009a
.
getOuterWeight
()).
subtract
(
newKc009a
.
getEnterWeight
()));
}
newKc009As
.
add
(
kc009
);
newKc009As
.
add
(
newKc009a
);
}
return
newKc009As
;
}
...
...
@@ -265,28 +228,42 @@ public class ServiceHPKC009A extends ServiceBase {
/**
* 设置基础信息
*
* @param kc009s
* @param kc009
a
s
*/
private
void
setBaseInfo
(
List
<
HPKC009A
>
kc009s
)
{
private
void
setBaseInfo
(
List
<
HPKC009A
>
kc009
a
s
)
{
// 仓库名称
List
<
String
>
whCodes
=
kc009s
.
stream
().
map
(
HPKC009A:
:
getWhCode
).
collect
(
Collectors
.
toList
());
List
<
String
>
whCodes
=
kc009
a
s
.
stream
().
map
(
HPKC009A:
:
getWhCode
).
collect
(
Collectors
.
toList
());
Map
<
String
,
HPPZ007
>
mapPz007
=
HPPZTools
.
HpPz007
.
map
(
whCodes
);
// 存货名称
List
<
String
>
inventCodes
=
kc009s
.
stream
().
map
(
HPKC009A:
:
getPrdtCode
).
collect
(
Collectors
.
toList
());
Map
<
String
,
HPPZ004
>
mapPz004
=
HPPZTools
.
HpPz004
.
map
(
inventCodes
);
for
(
HPKC009A
kc009
:
kc009s
)
{
// 项目名称
List
<
String
>
projCodes
=
kc009as
.
stream
().
map
(
HPKC009A:
:
getProjCode
).
collect
(
Collectors
.
toList
());
Map
<
String
,
HPSC001
>
sc001Map
=
HPSCTools
.
HpSc001
.
map
(
projCodes
);
// 部件名称
List
<
String
>
inventCodes
=
kc009as
.
stream
().
map
(
HPKC009A:
:
getInventCode
).
collect
(
Collectors
.
toList
());
Map
<
String
,
HPPZ004
>
pz004Map
=
HPPZTools
.
HpPz004
.
map
(
inventCodes
);
// 零件名称
List
<
String
>
subInventCodes
=
kc009as
.
stream
().
map
(
HPKC009A:
:
getSubInventCode
).
collect
(
Collectors
.
toList
());
Map
<
String
,
HPPZ004
>
subPz004Map
=
HPPZTools
.
HpPz004
.
map
(
subInventCodes
);
for
(
HPKC009A
kc009a
:
kc009as
)
{
// 仓库名称
String
whCode
=
kc009
.
getWhCode
();
String
whCode
=
kc009
a
.
getWhCode
();
HPPZ007
pz007
=
mapPz007
==
null
?
null
:
mapPz007
.
get
(
whCode
);
kc009
.
setWhName
(
pz007
==
null
?
""
:
pz007
.
getWhName
());
// 存货名称
String
inventCode
=
kc009
.
getPrdtCode
();
HPPZ004
pz004
=
mapPz004
==
null
?
null
:
mapPz004
.
get
(
inventCode
);
kc009
.
setPrdtName
(
pz004
==
null
?
""
:
pz004
.
getInventName
());
kc009a
.
setWhName
(
pz007
==
null
?
""
:
pz007
.
getWhName
());
// 项目名称
String
projCode
=
kc009a
.
getProjCode
();
HPSC001
sc001
=
sc001Map
==
null
?
null
:
sc001Map
.
get
(
projCode
);
kc009a
.
setProjName
(
sc001
==
null
?
""
:
sc001
.
getProjName
());
// 部件名称
String
inventCode
=
kc009a
.
getInventCode
();
HPPZ004
pz004
=
pz004Map
==
null
?
null
:
pz004Map
.
get
(
inventCode
);
kc009a
.
setInventName
(
pz004
==
null
?
""
:
pz004
.
getInventName
());
// 零件名称
String
subInventCode
=
kc009a
.
getSubInventCode
();
HPPZ004
subPz004
=
subPz004Map
==
null
?
null
:
subPz004Map
.
get
(
subInventCode
);
kc009a
.
setSubInventName
(
subPz004
==
null
?
""
:
subPz004
.
getInventName
());
// 创建时间
kc009
.
setCreatedBy
(
UserSession
.
getLoginName
());
kc009
.
setCreatedName
(
UserSession
.
getLoginCName
());
kc009
.
setCreatedTime
(
DateUtils
.
shortDateTime
());
kc009
a
.
setCreatedBy
(
UserSession
.
getLoginName
());
kc009
a
.
setCreatedName
(
UserSession
.
getLoginCName
());
kc009
a
.
setCreatedTime
(
DateUtils
.
shortDateTime
());
}
}
...
...
@@ -295,19 +272,19 @@ public class ServiceHPKC009A extends ServiceBase {
*
* @param companyCode
* @param depCode
* @param inventType
* @param inventCode
* @param whCode
* @param inventRecordId
* @param projCode
* @param inventCode
* @param subInventCode
* @return
*/
private
String
buildKey
(
Object
companyCode
,
Object
depCode
,
Object
inventTyp
e
,
Object
inventCode
,
Object
whCode
,
Object
inventRecordId
)
{
private
String
buildKey
(
Object
companyCode
,
Object
depCode
,
Object
whCode
,
Object
projCod
e
,
Object
inventCode
,
Object
subInventCode
)
{
return
ObjectUtils
.
trimToEmpty
(
companyCode
)
+
"#"
+
ObjectUtils
.
trimToEmpty
(
depCode
)
+
"#"
+
ObjectUtils
.
trimToEmpty
(
inventType
)
+
"#"
+
ObjectUtils
.
trimToEmpty
(
inventCode
)
+
"#"
+
ObjectUtils
.
trimToEmpty
(
whCode
)
+
"#"
+
ObjectUtils
.
trimToEmpty
(
inventRecordId
);
+
ObjectUtils
.
trimToEmpty
(
projCode
)
+
"#"
+
ObjectUtils
.
trimToEmpty
(
inventCode
)
+
"#"
+
ObjectUtils
.
trimToEmpty
(
subInventCode
);
}
}
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC011A.java
0 → 100644
View file @
3891d88f
package
com
.
baosight
.
hpjx
.
hp
.
kc
.
service
;
import
com.baosight.hpjx.hp.constant.HPSqlConstant
;
import
com.baosight.hpjx.util.DateUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
java.time.LocalDate
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @author:songx
* @date:2024/1/25,18:49
*/
public
class
ServiceHPKC011A
extends
ServiceBase
{
/**
* 备份数据
*
* @param inInfo
* @return
*/
public
EiInfo
backup
(
EiInfo
inInfo
)
{
try
{
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"dateProc"
,
LocalDate
.
now
().
minusDays
(
1
).
format
(
DateUtils
.
SHORT_DATE
));
// 清除数据
dao
.
delete
(
HPSqlConstant
.
HPKC011A
.
DELETE_BY_TIME
,
queryMap
);
// 备份数据
dao
.
insert
(
HPSqlConstant
.
HPKC011A
.
BACKUP
,
queryMap
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsg
(
"备份数据成功"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"新增失败"
);
}
return
inInfo
;
}
}
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC009A.xml
View file @
3891d88f
...
...
@@ -18,10 +18,10 @@
WH_NAME as "whName",
<!-- 仓库名称 -->
PROJ_CODE as "projCode",
<!-- 项目编码 -->
PROJ_NAME as "projName",
<!-- 项目名称 -->
PRDT_CODE as "prdtCode",
<!-- 产品
编码 -->
PRDT_NAME as "prdtName",
<!-- 产品
名称 -->
PART_CODE as "par
tCode",
<!-- 零件编码 -->
PART_NAME as "par
tName",
<!-- 零件名称 -->
INVENT_CODE as "inventCode",
<!-- 部件
编码 -->
INVENT_NAME as "inventName",
<!-- 部件
名称 -->
SUB_INVENT_CODE as "subInven
tCode",
<!-- 零件编码 -->
SUB_INVENT_NAME as "subInven
tName",
<!-- 零件名称 -->
INIT_AMOUNT as "initAmount",
<!-- 期初数量 -->
INIT_WEIGHT as "initWeight",
<!-- 期初重量 -->
ENTER_AMOUNT as "enterAmount",
<!-- 入库数量 -->
...
...
@@ -80,18 +80,18 @@
<isNotEmpty
prepend=
" AND "
property=
"projName"
>
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"prd
tCode"
>
PRDT_CODE = #prd
tCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"prd
tName"
>
PRDT_NAME = #prd
tName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"par
tCode"
>
PART_CODE = #par
tCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"par
tName"
>
PART_NAME = #par
tName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"inven
tCode"
>
INVENT_CODE = #inven
tCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"inven
tName"
>
INVENT_NAME = #inven
tName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"subInven
tCode"
>
SUB_INVENT_CODE = #subInven
tCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"subInven
tName"
>
SUB_INVENT_NAME = #subInven
tName#
</isNotEmpty>
</sql>
<sql
id=
"order"
>
...
...
@@ -105,7 +105,7 @@
</dynamic>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
resultClass=
"com.baosight.
gxzl.common.mc.domain.THpkc009a
"
>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
resultClass=
"com.baosight.
hpjx.hp.kc.domain.HPKC009A
"
>
SELECT
<include
refid=
"column"
/>
FROM ${hpjxSchema}.T_HPKC009A
...
...
@@ -151,10 +151,10 @@
WH_NAME,
<!-- 仓库名称 -->
PROJ_CODE,
<!-- 项目编码 -->
PROJ_NAME,
<!-- 项目名称 -->
PRDT_CODE,
<!-- 产品
编码 -->
PRDT_NAME,
<!-- 产品
名称 -->
PAR
T_CODE,
<!-- 零件编码 -->
PAR
T_NAME,
<!-- 零件名称 -->
INVENT_CODE,
<!-- 部件
编码 -->
INVENT_NAME,
<!-- 部件
名称 -->
SUB_INVEN
T_CODE,
<!-- 零件编码 -->
SUB_INVEN
T_NAME,
<!-- 零件名称 -->
INIT_AMOUNT,
<!-- 期初数量 -->
INIT_WEIGHT,
<!-- 期初重量 -->
ENTER_AMOUNT,
<!-- 入库数量 -->
...
...
@@ -168,7 +168,7 @@
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#dateType#, #dateProc#, #whCode#, #whName#, #projCode#, #projName#,
#
prdtCode#, #prdtName#, #partCode#, #par
tName#, #initAmount#, #initWeight#,
#
inventCode#, #inventName#, #subInventCode#, #subInven
tName#, #initAmount#, #initWeight#,
#enterAmount#, #enterWeight#, #outerAmount#, #outerWeight#, #pdDiffAmount#,
#pdDiffWeight#, #endAmount#, #endWeight#
)
...
...
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC011A.xml
View file @
3891d88f
...
...
@@ -191,16 +191,16 @@
<!-- 备份数据 -->
<insert
id=
"backup"
>
INSERT INTO ${hpjxSchema}.T_HPKC011A (
COMPANY_CODE, DEP_CODE, DATE_PROC, WH_CODE, WH_NAME,
INVENT_TYP
E,
INVENT_CODE, INVENT_NAME, INVENT_RECORD_ID, AMOUNT, WEIGHT
,
CREATED_BY, CREATED_NAME, CREATED_TIME, UPDATED_BY, UPD
ATED_NAME,
UPDATED_TIME, VERSION
COMPANY_CODE, DEP_CODE, DATE_PROC, WH_CODE, WH_NAME,
PROD_NO, PROJ_COD
E,
PROJ_NAME, INVENT_CODE, INVENT_NAME, SUB_INVENT_CODE, SUB_INVENT_NAME, LENGTH
,
WIDTH, THICK, AMOUNT, UNIT_WEIGHT, WEIGHT, REMARK, CREATED_BY, CRE
ATED_NAME,
CREATED_TIME, UPDATED_BY, UPDATED_NAME,
UPDATED_TIME, VERSION
)
SELECT
COMPANY_CODE, DEP_CODE, #dateProc#, WH_CODE, WH_NAME,
INVENT_TYP
E,
INVENT_CODE, INVENT_NAME, INVENT_RECORD_ID, AMOUNT, WEIGHT
,
CREATED_BY, CREATED_NAME, CREATED_TIME, UPDATED_BY, UPD
ATED_NAME,
UPDATED_TIME, VERSION
COMPANY_CODE, DEP_CODE, #dateProc#, WH_CODE, WH_NAME,
PROD_NO, PROJ_COD
E,
PROJ_NAME, INVENT_CODE, INVENT_NAME, SUB_INVENT_CODE, SUB_INVENT_NAME, LENGTH
,
WIDTH, THICK, AMOUNT, UNIT_WEIGHT, WEIGHT, REMARK, CREATED_BY, CRE
ATED_NAME,
CREATED_TIME, UPDATED_BY, UPDATED_NAME,
UPDATED_TIME, VERSION
FROM ${hpjxSchema}.T_HPKC011
</insert>
...
...
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC001.xml
View file @
3891d88f
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-01-10 9:33:44
Version : 1.0
tableName :hpjx.t_hpsc001
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
PROJ_TYPE TINYINT,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PRINC1 VARCHAR,
PRINC2 VARCHAR,
STATUS TINYINT,
CREATED_BY VARCHAR,
CREATED_TIME DATETIME,
UPDATED_BY VARCHAR,
UPDATED_TIME DATETIME,
DEP_CODE VARCHAR
-->
<sqlMap
namespace=
"HPSC001"
>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
<select
id=
"query"
parameterClass=
"java.util.HashMap"
resultClass=
"com.baosight.hpjx.hp.sc.domain.HPSC001"
>
SELECT
ID as "id",
ID as "id",
COMPANY_CODE as "companyCode",
<!-- 企业编码 预留 -->
PROJ_TYPE as "projType",
<!-- 项目类型 -->
PROJ_CODE as "projCode",
<!-- 项目编码 -->
...
...
@@ -66,13 +48,16 @@
<isNotEmpty
prepend=
" AND "
property=
"companyCode"
>
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"projCodes"
>
PROJ_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"projCodes"
>
#projCodes[]#
</iterate>
</isNotEmpty>
<dynamic
prepend=
"ORDER BY"
>
<isEmpty
property=
"orderBy"
>
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select
id=
"count"
resultClass=
"int"
>
...
...
@@ -101,9 +86,12 @@
<isNotEmpty
prepend=
" AND "
property=
"materialStatus"
>
MATERIAL_STATUS = #materialStatus#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"projCodes"
>
PROJ_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"projCodes"
>
#projCodes[]#
</iterate>
</isNotEmpty>
</select>
<!--
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
...
...
@@ -161,30 +149,30 @@
UPDATED_TIME,
<!-- 更新时间 -->
DEP_CODE,
<!-- 部门编码 -->
REMARK
)
)
VALUES (#id#, #companyCode#, #projType#, #projCode#, #projName#, #princ1#, #princ2#, #status#, 0, #createdBy#, #createdTime#, #updatedBy#, #updatedTime#, #depCode#, #remark#)
</insert>
<delete
id=
"delete"
>
DELETE FROM hpjx.t_hpsc001 WHERE
DELETE FROM hpjx.t_hpsc001 WHERE
ID = #id#
</delete>
<update
id=
"update"
>
UPDATE hpjx.t_hpsc001
SET
COMPANY_CODE = #companyCode#,
<!-- 企业编码 预留 -->
PROJ_TYPE = #projType#,
<!-- 项目类型 -->
PROJ_CODE = #projCode#,
<!-- 项目编码 -->
PROJ_NAME = #projName#,
<!-- 项目名称 -->
PRINC1 = #princ1#,
<!-- 本公司项目负责人 -->
PRINC2 = #princ2#,
<!-- 客户项目负责人 -->
UPDATE hpjx.t_hpsc001
SET
COMPANY_CODE = #companyCode#,
<!-- 企业编码 预留 -->
PROJ_TYPE = #projType#,
<!-- 项目类型 -->
PROJ_CODE = #projCode#,
<!-- 项目编码 -->
PROJ_NAME = #projName#,
<!-- 项目名称 -->
PRINC1 = #princ1#,
<!-- 本公司项目负责人 -->
PRINC2 = #princ2#,
<!-- 客户项目负责人 -->
STATUS = #status#,
<!-- 状态 0-未提交,1-已提交 -->
MATERIAL_STATUS = #materialStatus#,
CREATED_BY = #createdBy#,
<!-- 创建人 -->
CREATED_TIME = #createdTime#,
<!-- 创建时间 -->
UPDATED_BY = #updatedBy#,
<!-- 更新人 -->
UPDATED_TIME = #updatedTime#,
<!-- 更新时间 -->
CREATED_BY = #createdBy#,
<!-- 创建人 -->
CREATED_TIME = #createdTime#,
<!-- 创建时间 -->
UPDATED_BY = #updatedBy#,
<!-- 更新人 -->
UPDATED_TIME = #updatedTime#,
<!-- 更新时间 -->
DEP_CODE = #depCode#,
<!-- 部门编码 -->
REMARK = #remark#
<!-- 备注 -->
WHERE
...
...
@@ -237,4 +225,4 @@
ID = #id#
</isNotEmpty>
</select>
</sqlMap>
\ No newline at end of file
</sqlMap>
src/main/java/com/baosight/hpjx/hp/sc/tools/HPSCTools.java
View file @
3891d88f
...
...
@@ -3,7 +3,16 @@ package com.baosight.hpjx.hp.sc.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.sc.domain.*
;
import
com.baosight.hpjx.hp.sc.domain.HPSC001
;
import
com.baosight.hpjx.hp.sc.domain.HPSC002
;
import
com.baosight.hpjx.hp.sc.domain.HPSC003
;
import
com.baosight.hpjx.hp.sc.domain.HPSC004
;
import
com.baosight.hpjx.hp.sc.domain.HPSC005
;
import
com.baosight.hpjx.hp.sc.domain.HPSC005A
;
import
com.baosight.hpjx.hp.sc.domain.HPSC005B
;
import
com.baosight.hpjx.hp.sc.domain.HPSC005C
;
import
com.baosight.hpjx.hp.sc.domain.HPSC006
;
import
com.baosight.hpjx.hp.sc.domain.HPSC007
;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.DateUtils
;
import
com.baosight.hpjx.util.StringUtils
;
...
...
@@ -137,6 +146,35 @@ public class HPSCTools {
AssertUtils
.
isNull
(
results
,
String
.
format
(
"项目编码[%s]信息不存在"
,
projCode
));
return
results
.
get
(
0
);
}
/**
* 查询
*
* @param projCodes
* @return
*/
public
static
List
<
HPSC001
>
list
(
List
<
String
>
projCodes
)
{
if
(
CollectionUtils
.
isEmpty
(
projCodes
))
{
return
null
;
}
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"projCodes"
,
projCodes
);
return
DaoBase
.
getInstance
().
query
(
"HPSC001.query"
,
queryMap
);
}
/**
* 查询
*
* @param projCodes
* @return
*/
public
static
Map
<
String
,
HPSC001
>
map
(
List
<
String
>
projCodes
)
{
List
<
HPSC001
>
results
=
list
(
projCodes
);
if
(
CollectionUtils
.
isEmpty
(
results
))
{
return
null
;
}
return
results
.
stream
().
collect
(
Collectors
.
toMap
(
HPSC001:
:
getProjCode
,
item
->
item
));
}
}
/**
...
...
src/main/webapp/HP/SC/HPSC005.js
View file @
3891d88f
...
...
@@ -78,7 +78,7 @@ function tearAssign(prodOrderNo) {
/**
* 生产订单详情
*
* @param prod
uction
OrderNo
* @param prodOrderNo
*/
function
tearDetails
(
prodOrderNo
)
{
JSColorbox
.
open
({
...
...
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