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
fcda275c
Commit
fcda275c
authored
Mar 06, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024/03/06 附件备份
parent
96deb3b4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
13 deletions
+72
-13
ServiceHPSC002.java
.../java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002.java
+21
-4
ServiceHPSC002A.java
...java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002A.java
+19
-9
HPSC099.js
src/main/webapp/HP/SC/HPSC099.js
+32
-0
No files found.
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002.java
View file @
fcda275c
...
...
@@ -5,14 +5,12 @@ import com.baosight.hpjx.common.DdynamicEnum;
import
com.baosight.hpjx.core.constant.CommonConstant
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.ds.domain.HPDS002
;
import
com.baosight.hpjx.hp.kc.tools.HPKCTools
;
import
com.baosight.hpjx.hp.pz.tools.HPPZTools
;
import
com.baosight.hpjx.hp.sc.domain.*
;
import
com.baosight.hpjx.hp.sc.tools.HPSCTools
;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.BeanUtils
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.*
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
...
...
@@ -483,6 +481,8 @@ public class ServiceHPSC002 extends ServiceBase {
HPSCTools
.
HpSc004
.
deleteByMat
(
fSc002
.
getId
());
// 同步删除生产订单
HPSCTools
.
HpSc005
.
deleteByMat
(
fSc002
.
getId
());
// 删除附件文件
delectDoc
(
fSc002
.
getId
());
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
...
...
@@ -759,4 +759,21 @@ public class ServiceHPSC002 extends ServiceBase {
}
return
inInfo
;
}
/**
* 删除附件文件
* @param id 文件ID
*/
@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
());
}
this
.
dao
.
delete
(
HPDS002
.
DELETE_BATCH
,
map
);
}
}
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002A.java
View file @
fcda275c
package
com
.
baosight
.
hpjx
.
hp
.
sc
.
service
;
import
com.baosight.hpjx.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hpjx.core.constant.CommonConstant
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.kc.domain.HPKC002
;
import
com.baosight.hpjx.hp.kc.domain.HPKC005
;
import
com.baosight.hpjx.hp.kc.tools.HPKCTools
;
import
com.baosight.hpjx.hp.ds.domain.HPDS002
;
import
com.baosight.hpjx.hp.sc.domain.HPSC002
;
import
com.baosight.hpjx.hp.sc.domain.HPSC002A
;
import
com.baosight.hpjx.hp.sc.domain.HPSC006
;
import
com.baosight.hpjx.util.BeanUtils
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.EiInfoUtils
;
import
com.baosight.hpjx.util.FileUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.ObjectUtils
;
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
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -119,6 +113,9 @@ public class ServiceHPSC002A extends ServiceEPBase {
HPSC002A
fSc002A
=
new
HPSC002A
();
fSc002A
.
fromMap
(
resultRows
.
get
(
i
));
DaoUtils
.
update
(
HPSC002A
.
DELETE
,
fSc002A
);
if
(!
fSc002A
.
getDocId
().
isEmpty
())
{
this
.
delectDoc
(
fSc002A
.
getDocId
());
}
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
...
...
@@ -128,4 +125,17 @@ public class ServiceHPSC002A extends ServiceEPBase {
}
return
inInfo
;
}
/**
* 删除文件
* @param docId 文件ID
*/
@OperationLogAnnotation
(
operModul
=
"附件清单"
,
operType
=
"删除"
,
operDesc
=
"删除附件文件"
)
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
);
}
}
src/main/webapp/HP/SC/HPSC099.js
View file @
fcda275c
...
...
@@ -11,6 +11,7 @@ $(function () {
$
(
"#fileDocId"
).
val
(
docId
);
NotificationUtil
(
"附件上传成功"
);
console
.
log
(
$
(
"#fileDocId"
).
val
())
saveTemp
(
e
);
try
{
parent
.
JSColorbox
.
setValueCallback
(
docId
);
}
catch
(
e
){
...
...
@@ -18,4 +19,35 @@ $(function () {
},
}
};
function
saveTemp
(
e
)
{
let
docId
=
e
.
response
.
docId
;
let
docName
=
e
.
response
.
docName
;
let
docSize
=
e
.
response
.
docSize
;
let
docTag
=
e
.
response
.
docTag
;
let
docUrl
=
e
.
response
.
docUrl
;
let
result
=
new
EiInfo
();
result
.
set
(
"result-0-docId"
,
docId
);
result
.
set
(
"result-0-docName"
,
docName
);
result
.
set
(
"result-0-docSize"
,
docSize
);
result
.
set
(
"result-0-docTag"
,
docTag
);
result
.
set
(
"result-0-realPath"
,
docUrl
);
EiCommunicator
.
send
(
"HPDS002"
,
"insert"
,
result
,
{
onSuccess
:
function
(
ei
)
{
if
(
ei
.
getStatus
()
>=
0
)
{
if
(
ei
.
getStatus
()
==
0
)
{
NotificationUtil
(
ei
,
'warning'
);
}
else
{
NotificationUtil
(
ei
);
}
}
else
{
NotificationUtil
(
ei
,
"error"
);
}
},
onFail
:
function
(
ei
)
{
// 发生异常
NotificationUtil
(
"操作失败,原因["
+
ei
+
"]"
,
"error"
);
}
});
}
});
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