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
aa8d63dd
Commit
aa8d63dd
authored
May 20, 2024
by
wuwenlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生产计划排产
parent
ce891bcb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
469 additions
and
24 deletions
+469
-24
HGPZ005.xml
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ005.xml
+3
-0
HGPZ005A.xml
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ005A.xml
+3
-0
HGPZTools.java
src/main/java/com/baosight/hggp/hg/pz/tools/HGPZTools.java
+28
-0
HGSC005.java
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC005.java
+1
-0
HGSC005A.java
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC005A.java
+36
-0
ServiceHGSC001.java
.../java/com/baosight/hggp/hg/sc/service/ServiceHGSC001.java
+0
-1
ServiceHGSC005.java
.../java/com/baosight/hggp/hg/sc/service/ServiceHGSC005.java
+30
-0
ServiceHGSC005A.java
...java/com/baosight/hggp/hg/sc/service/ServiceHGSC005A.java
+19
-7
HGSC005.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC005.xml
+13
-0
HGSC005A.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC005A.xml
+18
-1
HGSCTools.java
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
+116
-3
HGSJ001.xml
src/main/java/com/baosight/hggp/hg/sj/sql/HGSJ001.xml
+3
-0
HGSJTools.java
src/main/java/com/baosight/hggp/hg/sj/tools/HGSJTools.java
+13
-2
DateUtil.java
src/main/java/com/baosight/hggp/util/DateUtil.java
+116
-0
HGSC001.js
src/main/webapp/HG/SC/HGSC001.js
+2
-2
HGSC005.js
src/main/webapp/HG/SC/HGSC005.js
+35
-4
HGSC005A.js
src/main/webapp/HG/SC/HGSC005A.js
+32
-4
HGSC005A.jsp
src/main/webapp/HG/SC/HGSC005A.jsp
+1
-0
No files found.
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ005.xml
View file @
aa8d63dd
...
...
@@ -95,6 +95,9 @@
<isNotEmpty
prepend=
" AND "
property=
"flowId"
>
FLOW_ID = #flowId#
</isNotEmpty>
<isNotEmpty
property=
"inventCodes"
>
INVENT_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"inventCodes"
>
#inventCodes[]#
</iterate>
</isNotEmpty>
</sql>
<sql
id=
"authCondition"
>
...
...
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ005A.xml
View file @
aa8d63dd
...
...
@@ -81,6 +81,9 @@
<isNotEmpty
prepend=
" AND "
property=
"parentId"
>
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty
property=
"ids"
>
ID IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"ids"
>
#ids[]#
</iterate>
</isNotEmpty>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
...
...
src/main/java/com/baosight/hggp/hg/pz/tools/HGPZTools.java
View file @
aa8d63dd
...
...
@@ -204,6 +204,20 @@ public class HGPZTools {
/**
* 查询
*
* @param inventCodes
* @return
*/
public
static
List
<
HGPZ005
>
listByInventCodes
(
List
<
String
>
inventCodes
)
{
AssertUtils
.
isEmpty
(
inventCodes
,
"存货档案编码不能为空!"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"inventCodes"
,
inventCodes
);
return
DaoBase
.
getInstance
().
query
(
HGPZ005
.
QUERY
,
queryMap
);
}
/**
* 查询
*
* @param ids
* @return
*/
...
...
@@ -450,6 +464,20 @@ public class HGPZTools {
List
<
HGPZ005A
>
results
=
DaoBase
.
getInstance
().
query
(
HGPZ005A
.
QUERY
,
paramMap
);
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
}
/**
* 通过存货编码查询存货工序*
*
* @param ids
* @return
*/
public
static
List
<
HGPZ005A
>
queryByIds
(
List
<
Long
>
ids
)
{
AssertUtils
.
isEmpty
(
ids
,
"ID不能为空!"
);
Map
paramMap
=
new
HashMap
();
paramMap
.
put
(
"ids"
,
ids
);
List
<
HGPZ005A
>
results
=
DaoBase
.
getInstance
().
query
(
HGPZ005A
.
QUERY
,
paramMap
);
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
}
}
}
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC005.java
View file @
aa8d63dd
...
...
@@ -70,6 +70,7 @@ public class HGSC005 extends DaoEPBase {
public
static
final
String
INSERT
=
"HGSC005.insert"
;
public
static
final
String
UPDATE
=
"HGSC005.update"
;
public
static
final
String
DELETE
=
"HGSC005.delete"
;
public
static
final
String
BATCH_COMMIT
=
"HGSC005.batch_commit"
;
private
Long
id
=
new
Long
(
0
);
private
Long
matId
=
new
Long
(
0
);
/* 物料清单ID*/
...
...
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC005A.java
View file @
aa8d63dd
...
...
@@ -27,7 +27,9 @@ public class HGSC005A extends DaoEPBase {
public
static
final
String
FIELD_tech_flow_id
=
"techFlowId"
;
/* 工艺流程ID*/
public
static
final
String
FIELD_tech_flow_name
=
"techFlowName"
;
/* 工艺流程名称*/
public
static
final
String
FIELD_invent_process_id
=
"inventProcessId"
;
/* 存货工序ID,对应HGPZ005A.id*/
public
static
final
String
FIELD_process_code
=
"processCode"
;
/* 工序名称*/
public
static
final
String
FIELD_process_name
=
"processName"
;
/* 工序名称*/
public
static
final
String
FIELD_process_order
=
"processOrder"
;
/* 加工顺序*/
public
static
final
String
FIELD_company_code
=
"companyCode"
;
/* 公司编码*/
public
static
final
String
FIELD_company_name
=
"companyName"
;
/* 公司名称*/
public
static
final
String
FIELD_dep_code
=
"depCode"
;
/* 部门编码*/
...
...
@@ -58,7 +60,9 @@ public class HGSC005A extends DaoEPBase {
public
static
final
String
COL_tech_flow_id
=
"tech_flow_id"
;
/* 工艺流程ID*/
public
static
final
String
COL_tech_flow_name
=
"tech_flow_name"
;
/* 工艺流程名称*/
public
static
final
String
COL_invent_process_id
=
"invent_process_id"
;
/* 存货工序ID,对应HGPZ005A.id*/
public
static
final
String
COL_process_code
=
"process_code"
;
/* 工序名称*/
public
static
final
String
COL_process_name
=
"process_name"
;
/* 工序名称*/
public
static
final
String
COL_process_order
=
"processOrder"
;
/* 加工顺序*/
public
static
final
String
COL_company_code
=
"company_code"
;
/* 公司编码*/
public
static
final
String
COL_company_name
=
"company_name"
;
/* 公司名称*/
public
static
final
String
COL_dep_code
=
"dep_code"
;
/* 部门编码*/
...
...
@@ -96,7 +100,9 @@ public class HGSC005A extends DaoEPBase {
private
Long
techFlowId
=
new
Long
(
0
);
/* 工艺流程ID*/
private
Long
techFlowName
=
new
Long
(
0
);
/* 工艺流程名称*/
private
Long
inventProcessId
=
new
Long
(
0
);
/* 存货工序ID,对应HGPZ005A.id*/
private
String
processCode
=
" "
;
/* 工序名称*/
private
String
processName
=
" "
;
/* 工序名称*/
private
Long
processOrder
=
new
Long
(
0
);
private
String
companyCode
=
" "
;
/* 公司编码*/
private
String
companyName
=
" "
;
/* 公司名称*/
private
String
depCode
=
" "
;
/* 部门编码*/
...
...
@@ -152,10 +158,18 @@ public class HGSC005A extends DaoEPBase {
eiColumn
.
setDescName
(
"存货工序ID,对应HGPZ005A.id"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_process_code
);
eiColumn
.
setDescName
(
"工序编码"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_process_name
);
eiColumn
.
setDescName
(
"工序名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_process_order
);
eiColumn
.
setDescName
(
"加工顺序"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_company_code
);
eiColumn
.
setDescName
(
"公司编码"
);
eiMetadata
.
addMeta
(
eiColumn
);
...
...
@@ -354,6 +368,15 @@ public class HGSC005A extends DaoEPBase {
public
void
setInventProcessId
(
Long
inventProcessId
)
{
this
.
inventProcessId
=
inventProcessId
;
}
public
String
getProcessCode
()
{
return
processCode
;
}
public
void
setProcessCode
(
String
processCode
)
{
this
.
processCode
=
processCode
;
}
/**
* get the processName - 工序名称.
* @return the processName
...
...
@@ -370,6 +393,15 @@ public class HGSC005A extends DaoEPBase {
public
void
setProcessName
(
String
processName
)
{
this
.
processName
=
processName
;
}
public
Long
getProcessOrder
()
{
return
processOrder
;
}
public
void
setProcessOrder
(
Long
processOrder
)
{
this
.
processOrder
=
processOrder
;
}
/**
* get the companyCode - 公司编码.
* @return the companyCode
...
...
@@ -752,7 +784,9 @@ public class HGSC005A extends DaoEPBase {
setTechFlowId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_tech_flow_id
)),
techFlowId
));
setTechFlowName
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_tech_flow_name
)),
techFlowName
));
setInventProcessId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_invent_process_id
)),
inventProcessId
));
setProcessCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_process_code
)),
processCode
));
setProcessName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_process_name
)),
processName
));
setProcessOrder
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_process_order
)),
processOrder
));
setCompanyCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_company_code
)),
companyCode
));
setCompanyName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_company_name
)),
companyName
));
setDepCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_dep_code
)),
depCode
));
...
...
@@ -791,7 +825,9 @@ public class HGSC005A extends DaoEPBase {
map
.
put
(
FIELD_tech_flow_id
,
StringUtils
.
toString
(
techFlowId
,
eiMetadata
.
getMeta
(
FIELD_tech_flow_id
)));
map
.
put
(
FIELD_tech_flow_name
,
StringUtils
.
toString
(
techFlowName
,
eiMetadata
.
getMeta
(
FIELD_tech_flow_name
)));
map
.
put
(
FIELD_invent_process_id
,
StringUtils
.
toString
(
inventProcessId
,
eiMetadata
.
getMeta
(
FIELD_invent_process_id
)));
map
.
put
(
FIELD_process_code
,
StringUtils
.
toString
(
processCode
,
eiMetadata
.
getMeta
(
FIELD_process_code
)));
map
.
put
(
FIELD_process_name
,
StringUtils
.
toString
(
processName
,
eiMetadata
.
getMeta
(
FIELD_process_name
)));
map
.
put
(
FIELD_process_order
,
StringUtils
.
toString
(
id
,
eiMetadata
.
getMeta
(
FIELD_process_order
)));
map
.
put
(
FIELD_company_code
,
StringUtils
.
toString
(
companyCode
,
eiMetadata
.
getMeta
(
FIELD_company_code
)));
map
.
put
(
FIELD_company_name
,
StringUtils
.
toString
(
companyName
,
eiMetadata
.
getMeta
(
FIELD_company_name
)));
map
.
put
(
FIELD_dep_code
,
StringUtils
.
toString
(
depCode
,
eiMetadata
.
getMeta
(
FIELD_dep_code
)));
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC001.java
View file @
aa8d63dd
...
...
@@ -96,7 +96,6 @@ public class ServiceHGSC001 extends ServiceBase {
public
EiInfo
commit
(
EiInfo
inInfo
)
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
// 销售单号
List
<
Long
>
ids
=
ObjectUtils
.
listKey
(
resultRows
,
HGSC001
.
FIELD_id
);
DaoUtils
.
update
(
HGSC001
.
BATCH_COMMIT
,
new
HashMap
<
String
,
Object
>(){{
put
(
"ids"
,
ids
);}});
inInfo
=
this
.
query
(
inInfo
);
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC005.java
View file @
aa8d63dd
package
com
.
baosight
.
hggp
.
hg
.
sc
.
service
;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.hg.sc.domain.HGSC005
;
import
com.baosight.hggp.hg.sc.domain.HGSC005A
;
import
com.baosight.hggp.hg.sc.tools.HGSCTools
;
import
com.baosight.hggp.util.*
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
...
...
@@ -50,7 +53,34 @@ public class ServiceHGSC005 extends ServiceBase {
return
inInfo
;
}
@OperationLogAnnotation
(
operModul
=
"生产计划"
,
operType
=
"提交"
,
operDesc
=
"提交"
)
public
EiInfo
commit
(
EiInfo
inInfo
)
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
List
<
String
>
planCodes
=
ObjectUtils
.
listKey
(
resultRows
,
HGSC005
.
FIELD_plan_code
);
List
<
HGSC005A
>
hgsc005AList
=
HGSCTools
.
THGSC005A
.
queryByPlanCodes
(
planCodes
);
this
.
checkCommitDate
(
hgsc005AList
);
List
<
Long
>
ids
=
ObjectUtils
.
listKey
(
resultRows
,
HGSC005
.
FIELD_id
);
DaoUtils
.
update
(
HGSC005
.
BATCH_COMMIT
,
new
HashMap
<
String
,
Object
>(){{
put
(
"ids"
,
ids
);}});
//TODO 生成生产计划
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据提交成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"操作失败"
);
}
return
inInfo
;
}
private
void
checkCommitDate
(
List
<
HGSC005A
>
hgsc005AList
){
AssertUtils
.
isEmpty
(
UserSessionUtils
.
getAccountCode
(),
"当前用户未绑定公司,无法操作数据,请联系管理员!"
);
AssertUtils
.
isEmpty
(
UserSessionUtils
.
getOrgId
(),
"当前用户未绑定部门,无法操作数据,请联系管理员!"
);
hgsc005AList
.
forEach
(
o
->
{
AssertUtils
.
isEmpty
(
o
.
getPlanStartDate
(),
String
.
format
(
"项目[%s]%s,计划详情有未排产的数据,无法提交!"
,
o
.
getProjCode
(),
o
.
getProjName
()));
AssertUtils
.
isEmpty
(
o
.
getPlanEndDate
(),
String
.
format
(
"项目[%s]%s,计划详情有未排产的数据,无法提交!"
,
o
.
getProjCode
(),
o
.
getProjName
()));
});
}
}
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC005A.java
View file @
aa8d63dd
...
...
@@ -4,13 +4,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.core.constant.CommonConstant
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.hg.cg.domain.HGCG002
;
import
com.baosight.hggp.hg.cg.domain.HGCG002A
;
import
com.baosight.hggp.hg.cg.utils.HGCGUtils
;
import
com.baosight.hggp.hg.constant.HGConstant
;
import
com.baosight.hggp.hg.constant.HGSqlConstant
;
import
com.baosight.hggp.hg.sc.domain.HGSC001
;
import
com.baosight.hggp.hg.sc.domain.HGSC001A
;
import
com.baosight.hggp.hg.sc.domain.HGSC005
;
import
com.baosight.hggp.hg.sc.domain.HGSC005A
;
import
com.baosight.hggp.hg.sc.tools.HGSCTools
;
import
com.baosight.hggp.util.*
;
...
...
@@ -82,6 +76,24 @@ public class ServiceHGSC005A extends ServiceBase {
}
}
@OperationLogAnnotation
(
operModul
=
"生产计划详情"
,
operType
=
"排产"
,
operDesc
=
"排产"
)
public
EiInfo
schedule
(
EiInfo
inInfo
)
{
try
{
String
planCode
=
inInfo
.
getString
(
HGSC005
.
FIELD_plan_code
);
HGSC005
hgsc005
=
HGSCTools
.
THGSC005
.
queryByPlanCode
(
planCode
);
this
.
checkScheduleData
(
hgsc005
);
HGSCTools
.
THGSC005A
.
schedule
(
planCode
);
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
// inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据排产成功!");
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"操作失败"
);
}
return
inInfo
;
}
private
void
checkScheduleData
(
HGSC005
hgsc005
)
{
AssertUtils
.
isTrue
(
hgsc005
.
getIsSchedule
().
compareTo
(
CommonConstant
.
YesNo
.
YES_1
)==
0
,
"当前计划已排产,请手动调整计划!"
);
}
}
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC005.xml
View file @
aa8d63dd
...
...
@@ -238,4 +238,17 @@
id = #id#
</update>
<update
id=
"batch_commit"
>
UPDATE ${hggpSchema}.HGSC005
SET
commit_status = 2,
<!-- 审批状态 0:待审;1:审核中;2:已审 -->
updated_by = #updatedBy#,
<!-- 更新人 -->
updated_name = #updatedName#,
<!-- 修改人名称 -->
updated_time = #updatedTime#
<!-- 更新时间 -->
WHERE
id IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"ids"
>
#ids[]#
</iterate>
</update>
</sqlMap>
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC005A.xml
View file @
aa8d63dd
...
...
@@ -38,6 +38,8 @@
<sqlMap
namespace=
"HGSC005A"
>
<sql
id=
"condition"
>
<include
refid=
"HGXSDataAuth.authCondition"
/>
<isNotEmpty
prepend=
" AND "
property=
"id"
>
id = #id#
</isNotEmpty>
...
...
@@ -59,6 +61,12 @@
<isNotEmpty
prepend=
" AND "
property=
"processName"
>
process_name = #processName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"processCode"
>
process_code = #processCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"processOrder"
>
process_order = #processOrder#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"companyCode"
>
company_code = #companyCode#
</isNotEmpty>
...
...
@@ -128,6 +136,9 @@
<isNotEmpty
prepend=
" AND "
property=
"updatedTime"
>
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty
property=
"planCodes"
>
plan_code IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"planCodes"
>
#planCodes[]#
</iterate>
</isNotEmpty>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
...
...
@@ -139,7 +150,9 @@
tech_flow_id as "techFlowId",
<!-- 工艺流程ID -->
tech_flow_name as "techFlowName",
<!-- 工艺流程名称 -->
invent_process_id as "inventProcessId",
<!-- 存货工序ID,对应HGPZ005A.id -->
process_code as "processCode",
<!-- 工序编码 -->
process_name as "processName",
<!-- 工序名称 -->
process_order as "processOrder",
<!-- 加工顺序 -->
company_code as "companyCode",
<!-- 公司编码 -->
company_name as "companyName",
<!-- 公司名称 -->
dep_code as "depCode",
<!-- 部门编码 -->
...
...
@@ -281,7 +294,9 @@
tech_flow_id,
<!-- 工艺流程ID -->
tech_flow_name,
<!-- 工艺流程名称 -->
invent_process_id,
<!-- 存货工序ID,对应HGPZ005A.id -->
process_code,
<!-- 工序名称 -->
process_name,
<!-- 工序名称 -->
process_order,
<!-- 工序名称 -->
company_code,
<!-- 公司编码 -->
company_name,
<!-- 公司名称 -->
dep_code,
<!-- 部门编码 -->
...
...
@@ -306,7 +321,7 @@
updated_name,
<!-- 修改人名称 -->
updated_time
<!-- 更新时间 -->
)
VALUES (#id#, #matId#, #matDetailId#, #techFlowId#, #techFlowName#, #inventProcessId#, #process
Name
#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #planCode#, #productType#, #productCode#, #productName#, #finishDate#, #planStartDate#, #planEndDate#, #quantity#, #finishQuantity#, #unfinishQuantity#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
VALUES (#id#, #matId#, #matDetailId#, #techFlowId#, #techFlowName#, #inventProcessId#, #process
Code#, #processName#, #processOrder
#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #planCode#, #productType#, #productCode#, #productName#, #finishDate#, #planStartDate#, #planEndDate#, #quantity#, #finishQuantity#, #unfinishQuantity#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete
id=
"delete"
>
...
...
@@ -322,7 +337,9 @@
tech_flow_id = #techFlowId#,
<!-- 工艺流程ID -->
tech_flow_name = #techFlowName#,
<!-- 工艺流程名称 -->
invent_process_id = #inventProcessId#,
<!-- 存货工序ID,对应HGPZ005A.id -->
process_code = #processCode#,
<!-- 工序名称 -->
process_name = #processName#,
<!-- 工序名称 -->
process_order = #processOrder#,
<!-- 工序名称 -->
company_code = #companyCode#,
<!-- 公司编码 -->
company_name = #companyName#,
<!-- 公司名称 -->
dep_code = #depCode#,
<!-- 部门编码 -->
...
...
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
View file @
aa8d63dd
This diff is collapsed.
Click to expand it.
src/main/java/com/baosight/hggp/hg/sj/sql/HGSJ001.xml
View file @
aa8d63dd
...
...
@@ -114,6 +114,9 @@
<isNotEmpty
prepend=
" AND "
property=
"processNames"
>
PROCESS_NAME LIKE CONCAT('%', #processNames#, '%')
</isNotEmpty>
<isNotEmpty
property=
"processCodes"
>
PROCESS_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"processCodes"
>
#processCodes[]#
</iterate>
</isNotEmpty>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
...
...
src/main/java/com/baosight/hggp/hg/sj/tools/HGSJTools.java
View file @
aa8d63dd
...
...
@@ -2,7 +2,7 @@ package com.baosight.hggp.hg.sj.tools;
import
com.baosight.hggp.core.dao.DaoBase
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.hg.s
b.domain.HGSB002A
;
import
com.baosight.hggp.hg.s
j.domain.HGSJ001
;
import
com.baosight.hggp.hg.sj.domain.HGSJ002A
;
import
com.baosight.hggp.hg.sj.domain.HGSJ003
;
import
com.baosight.hggp.util.AssertUtils
;
...
...
@@ -22,7 +22,18 @@ import java.util.stream.Collectors;
*/
public
class
HGSJTools
{
/**
public
static
class
Hgsj001
{
public
static
List
<
HGSJ001
>
queryByProcessCodes
(
List
<
String
>
processCodes
){
AssertUtils
.
isEmpty
(
processCodes
,
"工序编码不能为空!"
);
Map
paramMap
=
new
HashMap
();
paramMap
.
put
(
"processCodes"
,
processCodes
);
List
<
HGSJ001
>
results
=
DaoBase
.
getInstance
().
query
(
HGSJ001
.
QUERY
,
paramMap
);
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
}
}
/**
* Hgsj002a公共DAO方法定义
*/
public
static
class
Hgsj002a
{
...
...
src/main/java/com/baosight/hggp/util/DateUtil.java
0 → 100644
View file @
aa8d63dd
package
com
.
baosight
.
hggp
.
util
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Objects
;
/**
* @Author wwl
* @Date 2024/5/20 17:02
*/
public
class
DateUtil
{
protected
static
Logger
logger
=
LogManager
.
getLogger
(
DateUtil
.
class
);
public
static
final
String
DEFAULT_DATE_PATTERN
=
"yyyy-MM-dd"
;
public
static
final
String
DEFAULT_DATETIME_PATTERN
=
"yyyy-MM-dd HH:mm:ss"
;
public
static
final
String
DEFAULT_DATEDETAIL_PATTERN
=
"yyyy-MM-dd HH:mm:ss SSS"
;
public
static
final
String
DATE8_PATTERN
=
"yyyyMMdd"
;
public
static
final
String
DATE10_PATTERN
=
"yyyy-MM-dd"
;
public
static
final
String
DATE11_PATTERN
=
"M月d日"
;
public
static
final
String
TIME6_PATTERN
=
"HHmmss"
;
public
static
final
String
TIME8_PATTERN
=
"HH:mm:ss"
;
public
static
final
String
DATETIME14_PATTERN
=
"yyyyMMddHHmmss"
;
public
static
final
String
DATETIME19_PATTERN
=
"yyyy-MM-dd HH:mm:ss"
;
public
static
final
String
DATEMSEL17_PATTERN
=
"yyyyMMddHHmmssSSS"
;
public
static
final
String
DATEMSEL18_PATTERN
=
"yyyyMMddHHmmssSSSS"
;
/**
* 返回 指定日期时间的
* @param dateStr 日期
* @param day 天数
* @return 返回 dateStr+day后的日期
*/
public
static
String
dateSubStr
(
String
dateStr
,
int
day
)
{
//将时间格式化成yyyyMMdd的格式
SimpleDateFormat
format
=
new
SimpleDateFormat
(
DATE8_PATTERN
);
try
{
//获取当前日期
Date
date
=
format
.
parse
(
dateStr
);
//创建Calendar实例
Calendar
cal
=
Calendar
.
getInstance
();
//设置当前时间
cal
.
setTime
(
date
);
//同理增加一天的方法:
cal
.
add
(
Calendar
.
DATE
,
day
);
return
format
.
format
(
cal
.
getTime
());
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
""
;
}
/**、
* 返回月份天数
* @param dateStr 日期
* @return 天数
*/
public
static
int
getDaysOfMonth
(
String
dateStr
)
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
DATE8_PATTERN
);
try
{
Date
date
=
format
.
parse
(
dateStr
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
date
);
return
calendar
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
0
;
}
/**
* 返回当前日期的上月日期时间
* @param date
* @return
*/
public
static
String
getMonthOfDays
(
String
date
){
Calendar
calendar
=
Calendar
.
getInstance
();
//日历对象
calendar
.
setTime
(
Objects
.
requireNonNull
(
DateUtil
.
toDate
(
date
,
DATE10_PATTERN
)));
//设置当前日期
calendar
.
add
(
Calendar
.
MONTH
,
-
1
);
//月份减一
return
DateUtil
.
toDateStr
(
calendar
.
getTime
(),
DATE8_PATTERN
);
//输出上个月的日期
}
private
static
SimpleDateFormat
getDateParser
(
String
pattern
)
{
return
new
SimpleDateFormat
(
pattern
);
}
public
static
Date
toDate
(
String
dateString
,
String
pattern
)
{
Date
date
=
null
;
try
{
date
=
getDateParser
(
pattern
).
parse
(
dateString
);
return
date
;
}
catch
(
Exception
var4
)
{
logger
.
warn
(
"解析date字符串时出错,返回null. dateString:"
+
dateString
+
"ex:"
+
var4
);
return
null
;
}
}
public
static
String
toDateStr
(
Date
date
,
String
pattern
)
{
if
(
date
==
null
)
{
if
(
logger
.
isInfoEnabled
())
{
logger
.
info
(
"传入的date对象为空,返回空字符串"
);
}
return
""
;
}
else
{
return
getDateParser
(
pattern
).
format
(
date
);
}
}
}
src/main/webapp/HG/SC/HGSC001.js
View file @
aa8d63dd
...
...
@@ -50,9 +50,9 @@ $(function () {
$
(
"#BNT_MODIFY"
).
on
(
"click"
,
update
);
//删除
$
(
"#BNT_REMOVE"
).
on
(
"click"
,
remove
);
//
删除
//
完工
$
(
"#BNT_COMPLETE"
).
on
(
"click"
,
complete
);
//
删除
//
提交
$
(
"#BNT_COMMIT"
).
on
(
"click"
,
commit
);
},
onAdd
:
function
(
e
)
{
...
...
src/main/webapp/HG/SC/HGSC005.js
View file @
aa8d63dd
...
...
@@ -23,8 +23,8 @@ $(function () {
}
],
loadComplete
:
function
(
grid
)
{
//
此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
//
提交
$
(
"#BNT_COMMIT"
).
on
(
"click"
,
commit
);
},
onSuccess
:
function
(
e
)
{
if
(
e
.
eiInfo
.
extAttr
.
methodName
==
'commit'
||
e
.
eiInfo
.
extAttr
.
methodName
==
'delete'
){
...
...
@@ -56,4 +56,36 @@ function showUploadFile(id) {
width
:
"80%"
,
height
:
"80%"
,
});
}
\ No newline at end of file
}
function
commit
()
{
let
rows
=
resultGrid
.
getCheckedRows
()
if
(
rows
.
length
<
1
)
{
message2
(
"提交"
,
"没有选中的行"
);
return
;
}
IPLAT
.
confirm
({
title
:
'提交'
,
message
:
'确认提交此数据么?'
,
okFn
:
function
()
{
var
post
=
new
EiInfo
();
post
.
addBlock
(
resultGrid
.
getCheckedBlockData
());
post
.
set
(
"recursion"
,
true
);
EiCommunicator
.
send
(
"HGSC005"
,
"commit"
,
post
,{
onSuccess
:
function
(
ei
)
{
if
(
ei
.
getStatus
()
>=
0
)
{
NotificationUtil
(
ei
);
resultGrid
.
dataSource
.
query
();
}
else
{
NotificationUtil
(
ei
,
"error"
);
}
},
onFail
:
function
(
ei
)
{
// 发生异常
NotificationUtil
(
"操作失败,原因["
+
ei
+
"]"
,
"error"
);
}
});
}
})
}
src/main/webapp/HG/SC/HGSC005A.js
View file @
aa8d63dd
...
...
@@ -13,8 +13,8 @@ $(function () {
columns
:
[
],
loadComplete
:
function
(
grid
)
{
//
此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
//
排产
$
(
"#BNT_SCHEDULE"
).
on
(
"click"
,
schedule
);
},
onSuccess
:
function
(
e
)
{
if
(
e
.
eiInfo
.
extAttr
.
methodName
==
'save'
||
e
.
eiInfo
.
extAttr
.
methodName
==
'delete'
){
...
...
@@ -23,4 +23,33 @@ $(function () {
}
}
});
\ No newline at end of file
});
function
schedule
()
{
var
planCode
=
$
(
"#inqu_status-0-planCode"
).
val
();
var
inInfo
=
new
EiInfo
();
inInfo
.
set
(
"inqu_status-0-planCode"
,
planCode
);
IPLAT
.
confirm
({
title
:
'提交'
,
message
:
'自动排产将覆盖原排产数据,且只能执行一次,请谨慎操作,确认对当前数据进行排产?'
,
okFn
:
function
()
{
var
inInfo
=
new
EiInfo
();
inInfo
.
set
(
"inqu_status-0-planCode"
,
planCode
);
EiCommunicator
.
send
(
"HGSC005"
,
"schedule"
,
inInfo
,{
onSuccess
:
function
(
ei
)
{
if
(
ei
.
getStatus
()
>=
0
)
{
NotificationUtil
(
ei
);
resultGrid
.
dataSource
.
query
();
}
else
{
NotificationUtil
(
ei
,
"error"
);
}
},
onFail
:
function
(
ei
)
{
// 发生异常
NotificationUtil
(
"操作失败,原因["
+
ei
+
"]"
,
"error"
);
}
});
}
})
}
src/main/webapp/HG/SC/HGSC005A.jsp
View file @
aa8d63dd
...
...
@@ -13,6 +13,7 @@
<EF:EFPage
title=
"生产计划详情"
>
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<div
class=
"row"
>
<EF:EFInput
ename=
"inqu_status-0-planCode"
cname=
"计划编码"
type=
"hidden"
/>
<EF:EFInput
ename=
"inqu_status-0-productName"
cname=
"产品名称"
colWidth=
"3"
/>
<EF:EFSelect
cname=
"工序"
ename=
"result-0-processName"
colWidth=
"3"
required=
"true"
filter=
"contains"
>
<EF:EFOptions
blockId=
"plan_process_block_id"
valueField=
"valueField"
textField=
"textField"
/>
...
...
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