Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-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
hg-smart
Commits
69135b39
Commit
69135b39
authored
Sep 03, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.物料数据库增加排产系数批量修改功能
parent
9b5b24db
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
393 additions
and
215 deletions
+393
-215
HgPzSqlConstant.java
...ava/com/baosight/hggp/hg/pz/constant/HgPzSqlConstant.java
+21
-0
ServiceHGPZ005D.java
...java/com/baosight/hggp/hg/pz/service/ServiceHGPZ005D.java
+123
-0
HGPZ005.xml
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ005.xml
+33
-125
HGPZ005A.xml
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ005A.xml
+15
-77
HGPZTools.java
src/main/java/com/baosight/hggp/hg/pz/tools/HGPZTools.java
+41
-10
HGSJ001.xml
src/main/java/com/baosight/hggp/hg/sj/sql/HGSJ001.xml
+3
-1
AssertUtils.java
src/main/java/com/baosight/hggp/util/AssertUtils.java
+2
-2
HGPZ005C.js
src/main/webapp/HG/PZ/HGPZ005C.js
+19
-0
HGPZ005D.js
src/main/webapp/HG/PZ/HGPZ005D.js
+85
-0
HGPZ005D.jsp
src/main/webapp/HG/PZ/HGPZ005D.jsp
+51
-0
No files found.
src/main/java/com/baosight/hggp/hg/pz/constant/HgPzSqlConstant.java
0 → 100644
View file @
69135b39
package
com
.
baosight
.
hggp
.
hg
.
pz
.
constant
;
/**
* @author:songx
* @date:2024/9/3,14:43
*/
public
class
HgPzSqlConstant
{
/**
* @author:songx
* @date:2024/9/3,14:43
*/
public
class
HgPz005A
{
// 模块名称
public
static
final
String
MODULE
=
"HGPZ005A."
;
// 修改排产系数
public
static
final
String
UPDATE_COMPOSING_COEFF
=
MODULE
+
"updateComposingCoeff"
;
}
}
src/main/java/com/baosight/hggp/hg/pz/service/ServiceHGPZ005D.java
0 → 100644
View file @
69135b39
package
com
.
baosight
.
hggp
.
hg
.
pz
.
service
;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.common.InventTypeDetailEnum
;
import
com.baosight.hggp.core.constant.CommonConstant
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.hg.constant.HGSqlConstant
;
import
com.baosight.hggp.hg.pz.constant.HgPzSqlConstant
;
import
com.baosight.hggp.hg.pz.domain.HGPZ004
;
import
com.baosight.hggp.hg.pz.domain.HGPZ005
;
import
com.baosight.hggp.hg.pz.domain.HGPZ005A
;
import
com.baosight.hggp.hg.pz.tools.HGPZTools
;
import
com.baosight.hggp.hg.sj.domain.HGSJ003
;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.hggp.util.CommonMethod
;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.ObjectUtils
;
import
com.baosight.hggp.util.StringUtils
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* @author:songx
* @date:2024/9/3,14:28
*/
public
class
ServiceHGPZ005D
extends
ServiceEPBase
{
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
try
{
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
PROCESS_CODE_BLOCK_ID
));
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_TYPE_BLOCK_ID
));
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HGPZ005
().
eiMetadata
);
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败"
);
}
return
inInfo
;
}
/**
* 查询
*
* @param inInfo
* @return
*/
@Override
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
processCode
=
MapUtils
.
getString
(
queryMap
,
HGPZ005A
.
FIELD_PROCESS_CODE
);
if
(
ObjectUtils
.
isNullBlank
(
processCode
))
{
return
inInfo
;
}
inInfo
=
super
.
query
(
inInfo
,
HGPZ005
.
QUERY
,
new
HGPZ005
());
// 填充排产系数
List
<
Map
>
results
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
if
(
CollectionUtils
.
isEmpty
(
results
))
{
return
inInfo
;
}
List
<
String
>
inventCodes
=
results
.
stream
().
map
(
item
->
MapUtils
.
getString
(
item
,
HGPZ005
.
FIELD_INVENT_CODE
))
.
collect
(
Collectors
.
toList
());
Map
<
String
,
HGPZ005A
>
dbPz005AMap
=
HGPZTools
.
HgPz005A
.
mapByCode
(
inventCodes
,
processCode
);
for
(
Map
resultMap
:
results
)
{
String
inventCode
=
MapUtils
.
getString
(
resultMap
,
HGPZ005
.
FIELD_INVENT_CODE
);
HGPZ005A
dbPz005A
=
dbPz005AMap
.
get
(
inventCode
);
resultMap
.
put
(
HGPZ005A
.
FIELD_COMPOSING_COEFF
,
dbPz005A
==
null
?
1
:
dbPz005A
.
getComposingCoeff
());
}
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
return
inInfo
;
}
/**
* 保存操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation
(
operModul
=
"工序设置"
,
operType
=
"保存"
,
operDesc
=
"保存操作"
)
public
EiInfo
save
(
EiInfo
inInfo
)
{
try
{
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
processCode
=
MapUtils
.
getString
(
queryMap
,
HGPZ005A
.
FIELD_PROCESS_CODE
);
AssertUtils
.
isEmpty
(
processCode
,
"请选择工序"
);
BigDecimal
composingCoeff
=
MapUtils
.
getBigDecimal
(
queryMap
,
HGPZ005A
.
FIELD_COMPOSING_COEFF
);
AssertUtils
.
isGe
(
BigDecimal
.
ZERO
,
composingCoeff
,
"排产系数必须大于0"
);
List
<
HGPZ005
>
fPz005s
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HGPZ005
.
class
);
List
<
String
>
inventCodes
=
ObjectUtils
.
listEpKey
(
fPz005s
,
HGPZ005A
.
FIELD_INVENT_CODE
);
AssertUtils
.
isEmpty
(
inventCodes
,
"请选择材料"
);
// 写入数据
queryMap
.
put
(
"inventCodes"
,
inventCodes
);
DaoUtils
.
update
(
HgPzSqlConstant
.
HgPz005A
.
UPDATE_COMPOSING_COEFF
,
queryMap
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
fPz005s
.
size
()
+
"]条数据保存成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"保存失败"
);
}
return
inInfo
;
}
}
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ005.xml
View file @
69135b39
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<!-- table information
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
Generate time : 2024-05-07 16:07:42
Version : 1.0
schema : hggp
tableName : HGPZ005
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
INVENT_TYPE TINYINT NOT NULL,
INVENT_CODE VARCHAR NOT NULL,
INVENT_NAME VARCHAR NOT NULL,
SPEC VARCHAR,
LENGTH DECIMAL,
WIDTH DECIMAL,
THICK DECIMAL,
MATERIAL VARCHAR,
COEFFICIENT DECIMAL,
UNIT VARCHAR,
STATUS TINYINT NOT NULL,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT
-->
<sqlMap
namespace=
"HGPZ005"
>
<sqlMap
namespace=
"HGPZ005"
>
<typeAlias
alias=
"HGPZ005"
type=
"com.baosight.hggp.hg.pz.domain.HGPZ005"
/>
<typeAlias
alias=
"HGPZ005"
type=
"com.baosight.hggp.hg.pz.domain.HGPZ005"
/>
<sql
id=
"column"
>
<sql
id=
"column"
>
ID
as "id",
ID
as "id",
ACCOUNT_CODE
as "accountCode",
<!-- 帐套编码 -->
ACCOUNT_CODE
as "accountCode",
<!-- 帐套编码 -->
DEP_CODE
as "depCode",
<!-- 部门编码 -->
DEP_CODE
as "depCode",
<!-- 部门编码 -->
INVENT_TYPE
as "inventType",
<!-- 存货类型 -->
INVENT_TYPE
as "inventType",
<!-- 存货类型 -->
INVENT_TYPE_DETAIL as
"inventTypeDetail",
INVENT_TYPE_DETAIL as
"inventTypeDetail",
INVENT_CODE
as "inventCode",
<!-- 存货编码 -->
INVENT_CODE
as "inventCode",
<!-- 存货编码 -->
INVENT_NAME
as "inventName",
<!-- 存货名称 -->
INVENT_NAME
as "inventName",
<!-- 存货名称 -->
SPEC
as "spec",
<!-- 规格 -->
SPEC
as "spec",
<!-- 规格 -->
LENGTH
as "length",
<!-- 长 -->
LENGTH
as "length",
<!-- 长 -->
WIDTH
as "width",
<!-- 宽 -->
WIDTH
as "width",
<!-- 宽 -->
THICK
as "thick",
<!-- 厚 -->
THICK
as "thick",
<!-- 厚 -->
MATERIAL
as "material",
<!-- 材质 -->
MATERIAL
as "material",
<!-- 材质 -->
COEFFICIENT
as "coefficient",
<!-- 系数 -->
COEFFICIENT
as "coefficient",
<!-- 系数 -->
UNIT
as "unit",
<!-- 单位 -->
UNIT
as "unit",
<!-- 单位 -->
STATUS
as "status",
<!-- 状态 0未启用 1启用 -->
STATUS
as "status",
<!-- 状态 0未启用 1启用 -->
CREATED_BY
as "createdBy",
<!-- 创建人 -->
CREATED_BY
as "createdBy",
<!-- 创建人 -->
CREATED_NAME
as "createdName",
<!-- 创建人名称 -->
CREATED_NAME
as "createdName",
<!-- 创建人名称 -->
CREATED_TIME
as "createdTime",
<!-- 创建时间 -->
CREATED_TIME
as "createdTime",
<!-- 创建时间 -->
UPDATED_BY
as "updatedBy",
<!-- 更新人 -->
UPDATED_BY
as "updatedBy",
<!-- 更新人 -->
UPDATED_NAME
as "updatedName",
<!-- 更新人名称 -->
UPDATED_NAME
as "updatedName",
<!-- 更新人名称 -->
UPDATED_TIME
as "updatedTime",
<!-- 更新时间 -->
UPDATED_TIME
as "updatedTime",
<!-- 更新时间 -->
DELETE_FLAG
as "deleteFlag",
<!-- 是否删除0.否1.是 -->
DELETE_FLAG
as "deleteFlag",
<!-- 是否删除0.否1.是 -->
FLOW_ID as "flowId"
FLOW_ID as "flowId"
</sql>
</sql>
<sql
id=
"condition"
>
<sql
id=
"condition"
>
<!-- 存货档案去除权限限制
<!-- 存货档案去除权限限制
...
@@ -153,12 +128,17 @@
...
@@ -153,12 +128,17 @@
<isEqual
prepend=
" AND "
property=
"isFlowId"
compareValue=
"0"
>
<isEqual
prepend=
" AND "
property=
"isFlowId"
compareValue=
"0"
>
FLOW_ID = #isFlowId#
FLOW_ID = #isFlowId#
</isEqual>
</isEqual>
<isNotEmpty
prepend=
" AND "
property=
"processCode"
>
INVENT_CODE IN (SELECT INVENT_CODE FROM ${hggpSchema}.HGPZ005A WHERE PROCESS_CODE = #processCode#)
</isNotEmpty>
</sql>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
resultClass=
"HGPZ005"
>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
resultClass=
"HGPZ005"
>
SELECT
SELECT
<include
refid=
"column"
/>
<include
refid=
"column"
/>
FROM ${hggpSchema}.HGPZ005 WHERE 1=1 AND DELETE_FLAG = 0
FROM ${hggpSchema}.HGPZ005
WHERE 1=1
AND DELETE_FLAG = 0
<include
refid=
"condition"
/>
<include
refid=
"condition"
/>
<dynamic
prepend=
"ORDER BY"
>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
<isNotEmpty
property=
"orderBy"
>
...
@@ -175,79 +155,6 @@
...
@@ -175,79 +155,6 @@
<include
refid=
"condition"
/>
<include
refid=
"condition"
/>
</select>
</select>
<!--<select id="get" resultClass="HGPZ005">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGPZ005 WHERE 1=1
<include refid="condition"/>
</select>-->
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="width">
WIDTH = #width#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
THICK = #thick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="material">
MATERIAL = #material#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="coefficient">
COEFFICIENT = #coefficient#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
-->
<insert
id=
"insert"
>
<insert
id=
"insert"
>
INSERT INTO ${hggpSchema}.HGPZ005 (ID,
INSERT INTO ${hggpSchema}.HGPZ005 (ID,
ACCOUNT_CODE,
<!-- 帐套编码 -->
ACCOUNT_CODE,
<!-- 帐套编码 -->
...
@@ -463,6 +370,7 @@
...
@@ -463,6 +370,7 @@
<include
refid=
"condition"
/>
<include
refid=
"condition"
/>
ORDER BY ID
ORDER BY ID
</select>
</select>
<!-- 规格下拉框(无ID) -->
<!-- 规格下拉框(无ID) -->
<select
id=
"queryComboBoxSpecName"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
<select
id=
"queryComboBoxSpecName"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
SELECT DISTINCT
SELECT DISTINCT
...
...
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ005A.xml
View file @
69135b39
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<!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-05-15 18:59:20
Version : 1.0
schema : hggp
tableName : HGPZ005A
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
PROCESS_CODE VARCHAR NOT NULL,
PROCESS_NAME VARCHAR NOT NULL,
COMPOSING_COEFF VARCHAR,
UNIT_COEFF VARCHAR,
PARENT_ID BIGINT
-->
<sqlMap
namespace=
"HGPZ005A"
>
<sqlMap
namespace=
"HGPZ005A"
>
<sql
id=
"condition"
>
<sql
id=
"condition"
>
<!--<include refid="HGXSDataAuth.authCondition"/>-->
<!--<include refid="HGXSDataAuth.authCondition"/>-->
<isNotEmpty
prepend=
" AND "
property=
"id"
>
<isNotEmpty
prepend=
" AND "
property=
"id"
>
ID = #id#
ID = #id#
...
@@ -90,9 +69,8 @@
...
@@ -90,9 +69,8 @@
</isNotEmpty>
</isNotEmpty>
</sql>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
<select
id=
"query"
resultClass=
"com.baosight.hggp.hg.pz.domain.HGPZ005A"
>
resultClass=
"com.baosight.hggp.hg.pz.domain.HGPZ005A"
>
SELECT
SELECT
ID as "id",
ID as "id",
ACCOUNT_CODE as "accountCode",
<!-- 帐套编码 -->
ACCOUNT_CODE as "accountCode",
<!-- 帐套编码 -->
DEP_CODE as "depCode",
<!-- 部门编码 -->
DEP_CODE as "depCode",
<!-- 部门编码 -->
...
@@ -132,57 +110,6 @@
...
@@ -132,57 +110,6 @@
<include
refid=
"condition"
/>
<include
refid=
"condition"
/>
</select>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processCode">
PROCESS_CODE = #processCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processName">
PROCESS_NAME = #processName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="composingCoeff">
COMPOSING_COEFF = #composingCoeff#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unitCoeff">
UNIT_COEFF = #unitCoeff#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processClass">
PROCESS_CLASS = #processClass#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
-->
<insert
id=
"insert"
>
<insert
id=
"insert"
>
INSERT INTO ${hggpSchema}.HGPZ005A (ID,
INSERT INTO ${hggpSchema}.HGPZ005A (ID,
ACCOUNT_CODE,
<!-- 帐套编码 -->
ACCOUNT_CODE,
<!-- 帐套编码 -->
...
@@ -259,4 +186,15 @@
...
@@ -259,4 +186,15 @@
</isNotEmpty>
</isNotEmpty>
</select>
</select>
<!-- 修改排产系数 -->
<update
id=
"updateComposingCoeff"
>
UPDATE ${hggpSchema}.HGPZ005A
SET
COMPOSING_COEFF = #composingCoeff#,
<include
refid=
"SqlBase.updateRevise"
/>
WHERE DELETE_FLAG = 0
AND PROCESS_CODE = #processCode#
AND INVENT_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"inventCodes"
>
#inventCodes[]#
</iterate>
</update>
</sqlMap>
</sqlMap>
src/main/java/com/baosight/hggp/hg/pz/tools/HGPZTools.java
View file @
69135b39
...
@@ -146,11 +146,11 @@ public class HGPZTools {
...
@@ -146,11 +146,11 @@ public class HGPZTools {
}
}
return
pz004s
.
stream
().
collect
(
Collectors
.
toMap
(
HGPZ004:
:
getInventType
,
item
->
item
));
return
pz004s
.
stream
().
collect
(
Collectors
.
toMap
(
HGPZ004:
:
getInventType
,
item
->
item
));
}
}
}
}
public
static
class
HgPz006
{
public
static
class
HgPz006
{
public
static
HGPZ006
getWhCode
(
String
wHCode
)
{
public
static
HGPZ006
getWhCode
(
String
wHCode
)
{
HGPZ007
pz007
=
HGPZTools
.
HgPz007
.
get
(
wHCode
);
HGPZ007
pz007
=
HGPZTools
.
HgPz007
.
get
(
wHCode
);
if
(
pz007
==
null
)
{
if
(
pz007
==
null
)
{
...
@@ -698,15 +698,19 @@ public class HGPZTools {
...
@@ -698,15 +698,19 @@ public class HGPZTools {
pz005
.
setUnit
(
hgsc009a
.
getUnit
());
pz005
.
setUnit
(
hgsc009a
.
getUnit
());
pz005
.
setStatus
(
1
);
//默认启用
pz005
.
setStatus
(
1
);
//默认启用
jointSpec
(
pz005
);
jointSpec
(
pz005
);
DaoUtils
.
insert
(
HGPZ005
.
INSERT
,
pz005
);
DaoUtils
.
insert
(
HGPZ005
.
INSERT
,
pz005
);
return
pz005
;
return
pz005
;
}
}
}
}
/**
* @author:songx
* @date:2024/9/3,16:35
*/
public
static
class
HgPz005A
{
public
static
class
HgPz005A
{
/**
/**
* 通过存货编码查询存货工序*
* 通过存货编码查询存货工序*
*
*
...
@@ -720,7 +724,7 @@ public class HGPZTools {
...
@@ -720,7 +724,7 @@ public class HGPZTools {
List
<
HGPZ005A
>
results
=
DaoBase
.
getInstance
().
query
(
HGPZ005A
.
QUERY
,
paramMap
);
List
<
HGPZ005A
>
results
=
DaoBase
.
getInstance
().
query
(
HGPZ005A
.
QUERY
,
paramMap
);
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
}
}
/**
/**
* 通过存货编码查询存货工序*
* 通过存货编码查询存货工序*
*
*
...
@@ -734,7 +738,7 @@ public class HGPZTools {
...
@@ -734,7 +738,7 @@ public class HGPZTools {
List
<
HGPZ005A
>
results
=
DaoBase
.
getInstance
().
query
(
HGPZ005A
.
QUERY
,
paramMap
);
List
<
HGPZ005A
>
results
=
DaoBase
.
getInstance
().
query
(
HGPZ005A
.
QUERY
,
paramMap
);
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
}
}
/**
/**
* 通过存货编码查询存货工序*
* 通过存货编码查询存货工序*
*
*
...
@@ -748,6 +752,33 @@ public class HGPZTools {
...
@@ -748,6 +752,33 @@ public class HGPZTools {
List
<
HGPZ005A
>
results
=
DaoBase
.
getInstance
().
query
(
HGPZ005A
.
QUERY
,
paramMap
);
List
<
HGPZ005A
>
results
=
DaoBase
.
getInstance
().
query
(
HGPZ005A
.
QUERY
,
paramMap
);
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
}
}
/**
* @param inventCodes
* @param processCode
* @return
*/
public
static
List
<
HGPZ005A
>
listByCode
(
List
<
String
>
inventCodes
,
String
processCode
)
{
AssertUtils
.
isEmpty
(
inventCodes
,
"存货编码不能为空"
);
AssertUtils
.
isEmpty
(
processCode
,
"工序编码不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"inventCodes"
,
inventCodes
);
queryMap
.
put
(
"processCode"
,
processCode
);
return
DaoBase
.
getInstance
().
query
(
HGPZ005A
.
QUERY
,
queryMap
);
}
/**
* @param inventCodes
* @param processCode
* @return
*/
public
static
Map
<
String
,
HGPZ005A
>
mapByCode
(
List
<
String
>
inventCodes
,
String
processCode
)
{
List
<
HGPZ005A
>
results
=
listByCode
(
inventCodes
,
processCode
);
if
(
CollectionUtils
.
isEmpty
(
results
))
{
return
null
;
}
return
results
.
stream
().
collect
(
Collectors
.
toMap
(
HGPZ005A:
:
getInventCode
,
item
->
item
));
}
}
}
/**
/**
...
...
src/main/java/com/baosight/hggp/hg/sj/sql/HGSJ001.xml
View file @
69135b39
...
@@ -49,6 +49,7 @@
...
@@ -49,6 +49,7 @@
</sql>
</sql>
<sql
id=
"condition"
>
<sql
id=
"condition"
>
AND DELETE_FLAG = 0
<include
refid=
"authCondition"
/>
<include
refid=
"authCondition"
/>
<isNotEmpty
prepend=
" AND "
property=
"id"
>
<isNotEmpty
prepend=
" AND "
property=
"id"
>
ID = #id#
ID = #id#
...
@@ -307,7 +308,8 @@
...
@@ -307,7 +308,8 @@
STATUS as "status",
STATUS as "status",
DELETE_FLAG as "deleteFlag",
DELETE_FLAG as "deleteFlag",
COST_WEIGHT as "costWeight"
COST_WEIGHT as "costWeight"
FROM ${hggpSchema}.HGGY001 WHERE 1=1
FROM ${hggpSchema}.HGGY001
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"condition"
/>
group by PROCESS_CODE, PROCESS_NAME, FACTORY_CODE, FACTORY_NAME, UNIT, STATUS, DELETE_FLAG, COST_WEIGHT
group by PROCESS_CODE, PROCESS_NAME, FACTORY_CODE, FACTORY_NAME, UNIT, STATUS, DELETE_FLAG, COST_WEIGHT
</select>
</select>
...
...
src/main/java/com/baosight/hggp/util/AssertUtils.java
View file @
69135b39
...
@@ -183,7 +183,7 @@ public class AssertUtils {
...
@@ -183,7 +183,7 @@ public class AssertUtils {
* @param message
* @param message
*/
*/
public
static
void
isGt
(
BigDecimal
a
,
BigDecimal
b
,
String
message
)
{
public
static
void
isGt
(
BigDecimal
a
,
BigDecimal
b
,
String
message
)
{
if
(
a
.
compareTo
(
b
)
==
1
)
{
if
(
a
==
null
||
b
==
null
||
a
.
compareTo
(
b
)
==
1
)
{
throw
new
PlatException
(
message
);
throw
new
PlatException
(
message
);
}
}
}
}
...
@@ -195,7 +195,7 @@ public class AssertUtils {
...
@@ -195,7 +195,7 @@ public class AssertUtils {
* @param b
* @param b
*/
*/
public
static
void
isGe
(
BigDecimal
a
,
BigDecimal
b
,
String
message
)
{
public
static
void
isGe
(
BigDecimal
a
,
BigDecimal
b
,
String
message
)
{
if
(
a
.
compareTo
(
b
)
>
-
1
)
{
if
(
a
==
null
||
b
==
null
||
a
.
compareTo
(
b
)
>
-
1
)
{
throw
new
PlatException
(
message
);
throw
new
PlatException
(
message
);
}
}
}
}
...
...
src/main/webapp/HG/PZ/HGPZ005C.js
View file @
69135b39
...
@@ -9,6 +9,9 @@ $(function() {
...
@@ -9,6 +9,9 @@ $(function() {
batchFlow
();
batchFlow
();
});
});
// 排产系数
$
(
"#BATCH_COE"
).
on
(
"click"
,
batchCoe
);
IPLATUI
.
EFGrid
.
result
=
{
IPLATUI
.
EFGrid
.
result
=
{
pageable
:
{
pageable
:
{
pageSize
:
20
,
pageSize
:
20
,
...
@@ -274,6 +277,22 @@ let deleteFunc = function () {
...
@@ -274,6 +277,22 @@ let deleteFunc = function () {
});
});
}
}
/**
* 排产系数
*
* @param id
* @param inventCode
* @param flowId
*/
function
batchCoe
()
{
JSColorbox
.
open
({
href
:
"HGPZ005D"
,
title
:
"<div style='text-align: center;'>排产系数</div>"
,
width
:
"80%"
,
height
:
"90%"
});
}
function
showDetail
(
id
)
{
function
showDetail
(
id
)
{
JSColorbox
.
open
({
JSColorbox
.
open
({
href
:
"HGPZ005A?methodName=initLoad&inqu_status-0-parentId="
+
id
,
href
:
"HGPZ005A?methodName=initLoad&inqu_status-0-parentId="
+
id
,
...
...
src/main/webapp/HG/PZ/HGPZ005D.js
0 → 100644
View file @
69135b39
$
(
function
()
{
IPLATUI
.
EFSelect
=
{
"inqu_status-0-processCode"
:
{
change
:
function
(
e
)
{
query
();
}
}
}
IPLATUI
.
EFGrid
=
{
"result"
:
{
exportGrid
:
false
,
// 隐藏右侧自定义导出按钮
pageable
:
{
pageSize
:
10
,
pageSizes
:
[
10
,
20
,
50
,
100
],
},
columns
:
[],
loadComplete
:
function
(
grid
)
{
},
}
}
// 查询
$
(
"#QUERY"
).
on
(
"click"
,
query
);
// 保存
$
(
"#SAVE"
).
on
(
"click"
,
save
);
// 按键
downKeyUp
();
})
/**
* 页面加载时执行
*/
$
(
window
).
load
(
function
()
{
// 查询
let
processCode
=
$
(
"#inqu_status-0-processCode"
).
val
();
if
(
!
isBlank
(
processCode
))
{
query
();
}
});
/**
* 查询
*/
let
query
=
function
()
{
let
processCode
=
$
(
"#inqu_status-0-processCode"
).
val
();
if
(
isBlank
(
processCode
))
{
message
(
"请选择工序"
);
return
;
}
resultGrid
.
dataSource
.
page
(
1
);
}
/**
* 保存
*/
let
save
=
function
()
{
let
processCode
=
$
(
"#inqu_status-0-processCode"
).
val
();
if
(
isBlank
(
processCode
))
{
message
(
"请选择工序"
);
return
;
}
let
composingCoeff
=
$
(
"#inqu_status-0-composingCoeff"
).
val
();
if
(
isBlank
(
composingCoeff
))
{
message
(
"请填写排产系数"
);
return
;
}
let
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
<
1
)
{
message
(
"请选择数据"
);
return
;
}
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
保存
\"
操作? "
,
{
ok
:
function
()
{
JSUtils
.
submitGridsData
(
"result"
,
"HGPZ005D"
,
"save"
,
false
,
function
(
res
)
{
message
(
res
.
msg
);
}
);
}
});
}
src/main/webapp/HG/PZ/HGPZ005D.jsp
0 → 100644
View file @
69135b39
<!DOCTYPE html>
<
%@
page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%
>
<
%@
taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%
>
<
%@
taglib
prefix=
"EF"
tagdir=
"/WEB-INF/tags/EF"
%
>
<c:set
var=
"ctx"
value=
"${pageContext.request.contextPath}"
/>
<EF:EFPage
title=
"排产系数"
>
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<div
class=
"row"
>
<EF:EFSelect
cname=
"存货类型"
ename=
"inventType"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
filter=
"contains"
>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFOptions
blockId=
"invent_type_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFSelect>
<EF:EFInput
cname=
"存货编码"
ename=
"inventCodeLike"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
/>
<EF:EFInput
cname=
"存货名称"
ename=
"inventName"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
/>
<EF:EFInput
cname=
"规格"
ename=
"spec"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
/>
</div>
</EF:EFRegion>
<EF:EFRegion
id=
"detail"
title=
"编辑区域"
>
<div
class=
"row"
>
<EF:EFSelect
cname=
"工序"
ename=
"processCode"
blockId=
"inqu_status"
row=
"0"
colWidth=
"6"
ratio=
"2:10"
filter=
"contains"
required=
"true"
>
<EF:EFOptions
blockId=
"processCode_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFSelect>
<EF:EFInput
cname=
"排产系数"
ename=
"composingCoeff"
blockId=
"inqu_status"
row=
"0"
colWidth=
"6"
ratio=
"2:10"
required=
"true"
/>
</div>
</EF:EFRegion>
<EF:EFRegion
id=
"result"
title=
"明细信息"
fitHeight=
"true"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
isFloat=
"true"
height=
"60vh"
>
<EF:EFColumn
cname=
"排产系数"
ename=
"composingCoeff"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
cname=
"存货编码"
ename=
"inventCode"
enable=
"false"
width=
"140"
align=
"center"
/>
<EF:EFComboColumn
ename=
"inventType"
cname=
"存货类型"
enable=
"false"
width=
"120"
align=
"center"
blockName=
"invent_type_block_id"
textField=
"textField"
valueField=
"valueField"
columnTemplate=
"#=textField#"
itemTemplate=
"#=textField#"
>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"inventName"
cname=
"存货名称"
enable=
"false"
width=
"120"
align=
"center"
/>
<EF:EFColumn
ename=
"spec"
cname=
"规格"
enable=
"false"
width=
"140"
align=
"center"
/>
<EF:EFColumn
ename=
"length"
cname=
"长(MM)"
enable=
"false"
width=
"100"
align=
"right"
format=
"{0:N2}"
/>
<EF:EFColumn
ename=
"width"
cname=
"宽(MM)"
enable=
"false"
width=
"100"
align=
"right"
format=
"{0:N2}"
/>
<EF:EFColumn
ename=
"thick"
cname=
"厚(MM)"
enable=
"false"
width=
"100"
align=
"right"
format=
"{0:N2}"
/>
<EF:EFColumn
ename=
"material"
cname=
"材质"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"coefficient"
cname=
"系数"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N2}"
defaultValue=
"1"
/>
<EF:EFColumn
ename=
"unit"
cname=
"单位"
enable=
"false"
width=
"80"
align=
"center"
/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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