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
c945af87
Commit
c945af87
authored
Mar 06, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024/03/06 物料清单删除同步删除附件
parent
e0a6d4d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
40 deletions
+31
-40
HPDS002.xml
src/main/java/com/baosight/hpjx/hp/ds/sql/HPDS002.xml
+10
-28
ServiceHPSC002.java
.../java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002.java
+14
-9
ServiceHPSC002A.java
...java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002A.java
+7
-3
No files found.
src/main/java/com/baosight/hpjx/hp/ds/sql/HPDS002.xml
View file @
c945af87
<?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">
<!-- table information
Generate time : 2024-03-06 16:14:16
Version : 1.0
schema : hpjx
...
...
@@ -29,6 +29,9 @@
<isNotEmpty
prepend=
" AND "
property=
"docId"
>
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"docIds"
>
DOC_ID in $docIds$
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"dirId"
>
DIR_ID = #dirId#
</isNotEmpty>
...
...
@@ -177,8 +180,13 @@
<delete
id=
"delete"
>
DELETE FROM ${hpjxSchema}.TEUDM_TEMP WHERE
COMPANY_CODE = #companyCode# AND
COMPANY_CODE = #companyCode#
<isNotEmpty
prepend=
" AND "
property=
"docId"
>
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"docIds"
>
DOC_ID in $docIds$
</isNotEmpty>
</delete>
<update
id=
"update"
>
...
...
@@ -202,30 +210,4 @@
DOC_ID = #docId#
</update>
<!--批量删除-->
<delete
id=
"deleteByBatch"
>
DELETE FROM hpjx.TEUDM_TEMP WHERE DOC_ID in $docId$
</delete>
<!--查询物料清单文件ID-->
<select
id=
"queryByDocId"
parameterMap=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
select
DOC_ID as "docId",
<!-- 文件标识 -->
DIR_ID as "dirId",
<!-- 目录标识 -->
DOC_NAME as "docName",
<!-- 文件名 -->
CHG_NAME as "chgName",
<!-- 物理文件名 -->
DOC_SIZE as "docSize",
<!-- 文件大小 -->
DOC_TAG as "docTag",
<!-- 文件标签 -->
REC_CREATOR as "recCreator",
<!-- 记录创建者 -->
REC_CREATE_TIME as "recCreateTime",
<!-- 记录创建时间 -->
REC_REVISOR as "recRevisor",
<!-- 记录修改者 -->
REC_REVISE_TIME as "recReviseTime",
<!-- 记录修改时间 -->
ARCHIVE_FLAG as "archiveFlag",
<!-- 同步标记 -->
REAL_PATH as "realPath"
<!-- 物理路径 -->
from
HPJX.TEUDM_TEMP
where
DOC_ID in $docId$
</select>
</sqlMap>
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002.java
View file @
c945af87
...
...
@@ -4,6 +4,7 @@ import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import
com.baosight.hpjx.common.DdynamicEnum
;
import
com.baosight.hpjx.core.constant.CommonConstant
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.core.security.UserSessionUtils
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.ds.domain.HPDS002
;
import
com.baosight.hpjx.hp.kc.tools.HPKCTools
;
...
...
@@ -472,6 +473,9 @@ public class ServiceHPSC002 extends ServiceBase {
for
(
Map
resultRow
:
resultRows
)
{
HPSC002
fSc002
=
new
HPSC002
();
fSc002
.
fromMap
(
resultRow
);
// 删除附件文件
delectDoc
(
fSc002
.
getId
());
DaoUtils
.
update
(
"HPSC002.delete"
,
fSc002
);
// 修改父级节点状态是叶子节点或非叶子节点
this
.
checkTreeNodeLeaf
(
fSc002
.
getParentId
());
...
...
@@ -482,8 +486,6 @@ public class ServiceHPSC002 extends ServiceBase {
HPSCTools
.
HpSc004
.
deleteByMat
(
fSc002
.
getId
());
// 同步删除生产订单
HPSCTools
.
HpSc005
.
deleteByMat
(
fSc002
.
getId
());
// 删除附件文件
delectDoc
(
fSc002
.
getId
());
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
...
...
@@ -747,13 +749,16 @@ public class ServiceHPSC002 extends ServiceBase {
@OperationLogAnnotation
(
operModul
=
"物料清单"
,
operType
=
"删除"
,
operDesc
=
"删除附件文件"
)
public
void
delectDoc
(
Long
id
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"docId"
,
"(select DOC_ID from HPJX.T_HPSC002A\n"
+
" where MAT_ID in( select distinct ID from HPJX.T_HPSC002 where ID = '"
+
id
+
"' or PARENT_ID = '"
+
id
+
"')"
);
List
<
HPDS002
>
list
=
this
.
dao
.
query
(
"HPDS002.queryByDocId"
,
map
);
for
(
HPDS002
hpds002:
list
)
{
FileUtils
.
deleteFile
(
hpds002
.
getRealPath
());
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
map
.
put
(
"docIds"
,
"(select DOC_ID from HPJX.T_HPSC002A where MAT_ID in("
+
" select distinct ID from HPJX.T_HPSC002 where COMPANY_CODE = '"
+
companyCode
+
"' and (ID = '"
+
id
+
"' or PARENT_ID = '"
+
id
+
"')))"
);
List
<
HPDS002
>
list
=
this
.
dao
.
query
(
"HPDS002.query"
,
map
);
if
(
list
.
size
()
>
0
)
{
for
(
HPDS002
hpds002:
list
)
{
String
realPath
=
hpds002
.
getRealPath
();
FileUtils
.
deleteFile
(
realPath
);
}
this
.
dao
.
delete
(
HPDS002
.
DELETE
,
map
);
}
this
.
dao
.
delete
(
HPDS002
.
DELETE_BATCH
,
map
);
}
}
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002A.java
View file @
c945af87
...
...
@@ -134,8 +134,12 @@ public class ServiceHPSC002A extends ServiceEPBase {
public
void
delectDoc
(
String
docId
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"docId"
,
docId
);
List
<
Map
>
list
=
this
.
dao
.
query
(
HPDS002
.
QUERY
,
map
);
FileUtils
.
deleteFile
(
list
.
get
(
0
).
get
(
HPDS002
.
FIELD_REAL_PATH
).
toString
());
this
.
dao
.
delete
(
HPDS002
.
DELETE
,
map
);
List
<
HPDS002
>
list
=
this
.
dao
.
query
(
HPDS002
.
QUERY
,
map
);
if
(
list
.
size
()
>
0
)
{
String
realPath
=
list
.
get
(
0
).
getRealPath
();
FileUtils
.
deleteFile
(
realPath
);
this
.
dao
.
delete
(
HPDS002
.
DELETE
,
map
);
}
}
}
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