Commit ac69d870 by liuyang

2024/03/08 添加生产下料文件删除附件删除

parent 0a9bd6e4
......@@ -202,7 +202,28 @@ public enum DdynamicEnum {
* 用途:日志查询
* 编写:wan
*/
OPER_TYPE_BLOCK_ID("oper_type_block_id","operType","operType","HPRZ001.queryOperTypeComboBox");
OPER_TYPE_BLOCK_ID("oper_type_block_id","operType","operType","HPRZ001.queryOperTypeComboBox"),
/**
* 模块:系统管理
* 用途:用户查询
* 编写:ly
*/
USER_ID_BLOCK_ID("user_id_block_id","userId","userName","HPXS001.queryUserId"),
/**
* 模块:系统管理
* 用途:生产组查询
* 编写:ly
*/
GROUP_CODE_BLOCK_ID("group_code_block_id","groupCode","groupName","factoryCode","HPXS001.queryGroupCode"),
/**
* 模块:系统管理
* 用途:厂区查询
* 编写:ly
*/
FACTORY_CODE_BLOCK_ID("factory_code_block_id","factoryCode","factoryName","HPXS001.queryFactoryCode");
/** 将结果集放入的块名 */
private final String blockId;
......
......@@ -37,6 +37,8 @@ public class HPDS002 extends DaoEPBase {
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_ARCHIVE_FLAG = "archiveFlag"; /* 同步标记*/
public static final String FIELD_REAL_PATH = "realPath"; /* 物理路径*/
public static final String FIELD_BIZ_TYPE = "bizType"; /* 业务类型*/
public static final String FIELD_MAT_ID = "matId"; /* 业务类型*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码*/
public static final String COL_DOC_ID = "DOC_ID"; /* 文件标识*/
......@@ -53,6 +55,8 @@ public class HPDS002 extends DaoEPBase {
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_ARCHIVE_FLAG = "ARCHIVE_FLAG"; /* 同步标记*/
public static final String COL_REAL_PATH = "REAL_PATH"; /* 物理路径*/
public static final String COL_BIZ_TYPE = "BIZ_TYPE"; /* 业务类型*/
public static final String COL_MAT_ID = "MAT_ID"; /* 业务类型*/
public static final String QUERY = "HPDS002.query";
public static final String COUNT = "HPDS002.count";
......@@ -76,6 +80,8 @@ public class HPDS002 extends DaoEPBase {
private String updatedTime = " "; /* 记录修改时间*/
private String archiveFlag = " "; /* 同步标记*/
private String realPath = " "; /* 物理路径*/
private String bizType = " "; /* 业务类型*/
private String matId = " "; /* 业务类型*/
/**
* initialize the metadata.
......@@ -148,6 +154,14 @@ public class HPDS002 extends DaoEPBase {
eiColumn.setDescName("物理路径");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_BIZ_TYPE);
eiColumn.setDescName("业务类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MAT_ID);
eiColumn.setDescName("物料ID");
eiMetadata.addMeta(eiColumn);
}
......@@ -399,6 +413,32 @@ public class HPDS002 extends DaoEPBase {
public void setRealPath(String realPath) {
this.realPath = realPath;
}
/**
* get the bizType - 业务类型.
* @return the bizType
*/
public String getBizType() {
return this.bizType;
}
/**
* set the bizType - 业务类型.
*
* @param bizType - 业务类型
*/
public void setBizType(String bizType) {
this.bizType = bizType;
}
public String getMatId() {
return matId;
}
public void setMatId(String matId) {
this.matId = matId;
}
/**
* get the value from Map.
*
......@@ -422,6 +462,8 @@ public class HPDS002 extends DaoEPBase {
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setArchiveFlag(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ARCHIVE_FLAG)), archiveFlag));
setRealPath(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REAL_PATH)), realPath));
setBizType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BIZ_TYPE)), bizType));
setMatId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MAT_ID)), matId));
}
/**
......@@ -446,6 +488,8 @@ public class HPDS002 extends DaoEPBase {
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_ARCHIVE_FLAG, StringUtils.toString(archiveFlag, eiMetadata.getMeta(FIELD_ARCHIVE_FLAG)));
map.put(FIELD_REAL_PATH, StringUtils.toString(realPath, eiMetadata.getMeta(FIELD_REAL_PATH)));
map.put(FIELD_BIZ_TYPE, StringUtils.toString(bizType, eiMetadata.getMeta(FIELD_BIZ_TYPE)));
map.put(FIELD_MAT_ID, StringUtils.toString(matId, eiMetadata.getMeta(FIELD_MAT_ID)));
return map;
}
......
......@@ -71,26 +71,34 @@
<isNotEmpty prepend=" AND " property="realPath">
REAL_PATH = #realPath#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType">
BIZ_TYPE = #bizType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
MAT_ID = #matId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.ds.domain.HPDS002">
SELECT
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DOC_ID as "docId", <!-- 文件标识 -->
DIR_ID as "dirId", <!-- 目录标识 -->
DOC_NAME as "docName", <!-- 文件名 -->
CHG_NAME as "chgName", <!-- 物理文件名 -->
DOC_SIZE as "docSize", <!-- 文件大小 -->
DOC_TAG as "docTag", <!-- 文件标签 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
ARCHIVE_FLAG as "archiveFlag", <!-- 同步标记 -->
REAL_PATH as "realPath" <!-- 物理路径 -->
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DOC_ID as "docId", <!-- 文件标识 -->
DIR_ID as "dirId", <!-- 目录标识 -->
DOC_NAME as "docName", <!-- 文件名 -->
CHG_NAME as "chgName", <!-- 物理文件名 -->
DOC_SIZE as "docSize", <!-- 文件大小 -->
DOC_TAG as "docTag", <!-- 文件标签 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
ARCHIVE_FLAG as "archiveFlag", <!-- 同步标记 -->
REAL_PATH as "realPath", <!-- 物理路径 -->
BIZ_TYPE as "bizType",
MAT_ID as "matId"
FROM ${hpjxSchema}.TEUDM_TEMP WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
......@@ -159,23 +167,27 @@
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.TEUDM_TEMP (COMPANY_CODE, <!-- 企业编码 -->
DOC_ID, <!-- 文件标识 -->
DIR_ID, <!-- 目录标识 -->
DOC_NAME, <!-- 文件名 -->
CHG_NAME, <!-- 物理文件名 -->
DOC_SIZE, <!-- 文件大小 -->
DOC_TAG, <!-- 文件标签 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
ARCHIVE_FLAG, <!-- 同步标记 -->
REAL_PATH <!-- 物理路径 -->
)
VALUES (#companyCode#, #docId#, #dirId#, #docName#, #chgName#, #docSize#, #docTag#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #archiveFlag#, #realPath#)
INSERT INTO ${hpjxSchema}.TEUDM_TEMP (
COMPANY_CODE, <!-- 企业编码 -->
DOC_ID, <!-- 文件标识 -->
DIR_ID, <!-- 目录标识 -->
DOC_NAME, <!-- 文件名 -->
CHG_NAME, <!-- 物理文件名 -->
DOC_SIZE, <!-- 文件大小 -->
DOC_TAG, <!-- 文件标签 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
ARCHIVE_FLAG, <!-- 同步标记 -->
REAL_PATH, <!-- 物理路径 -->
BIZ_TYPE,
MAT_ID
)
VALUES (#companyCode#, #docId#, #dirId#, #docName#, #chgName#, #docSize#, #docTag#, #createdBy#, #createdName#,
#createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #archiveFlag#, #realPath#, #bizType#, #matId#)
</insert>
<delete id="delete">
......@@ -187,27 +199,41 @@
<isNotEmpty prepend=" AND " property="docIds">
DOC_ID in $docIds$
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType">
BIZ_TYPE = #bizType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
MAT_ID = #matId#
</isNotEmpty>
</delete>
<update id="update">
UPDATE ${hpjxSchema}.TEUDM_TEMP
SET
DIR_ID = #dirId#, <!-- 目录标识 -->
DOC_NAME = #docName#, <!-- 文件名 -->
CHG_NAME = #chgName#, <!-- 物理文件名 -->
DOC_SIZE = #docSize#, <!-- 文件大小 -->
DOC_TAG = #docTag#, <!-- 文件标签 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
ARCHIVE_FLAG = #archiveFlag#, <!-- 同步标记 -->
REAL_PATH = #realPath# <!-- 物理路径 -->
WHERE
COMPANY_CODE = #companyCode# AND
DIR_ID = #dirId#, <!-- 目录标识 -->
DOC_NAME = #docName#, <!-- 文件名 -->
CHG_NAME = #chgName#, <!-- 物理文件名 -->
DOC_SIZE = #docSize#, <!-- 文件大小 -->
DOC_TAG = #docTag#, <!-- 文件标签 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
ARCHIVE_FLAG = #archiveFlag#, <!-- 同步标记 -->
REAL_PATH = #realPath# <!-- 物理路径 -->
BIZ_TYPE = #bizType#
MAT_ID = #matId#
WHERE
COMPANY_CODE = #companyCode# AND
DOC_ID = #docId#
<isNotEmpty prepend=" AND " property="bizType">
BIZ_TYPE = #bizType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
MAT_ID = #matId#
</isNotEmpty>
</update>
</sqlMap>
......@@ -750,8 +750,10 @@ public class ServiceHPSC002 extends ServiceBase {
public void delectDoc(Long id){
Map<String,Object> map = new HashMap<>();
String companyCode = UserSessionUtils.getCompanyCode();
map.put("bizType","WL");
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+"')))");
" select distinct ID from HPJX.T_HPSC002 where COMPANY_CODE = '"+companyCode+"' and (ID = '"+id+"' or PARENT_ID = '"+id+"'))" +
" AND BIZ_TYPE = 'WL')");
List<HPDS002> list = this.dao.query("HPDS002.query",map);
if (list.size() > 0) {
for (HPDS002 hpds002: list) {
......
......@@ -7,16 +7,15 @@ import com.baosight.hpjx.common.HPConstants;
import com.baosight.hpjx.common.ProdOrderStatusEnum;
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.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.*;
import com.baosight.hpjx.hp.xs.domain.Org;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
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;
......@@ -208,6 +207,8 @@ public class ServiceHPSC006 extends ServiceBase {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC006.fromMap(map);
// 删除附件文件
delectDoc(HPSC006.getId());
this.dao.delete("HPSC006.delete", HPSC006.toMap());
}
......@@ -293,4 +294,26 @@ public class ServiceHPSC006 extends ServiceBase {
return query(eiInfo);
}
/**
* 删除附件文件
* @param id 文件ID
*/
@OperationLogAnnotation(operModul = "生产下料",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(Long id){
Map<String,Object> map = new HashMap<>();
String companyCode = UserSessionUtils.getCompanyCode();
map.put("bizType","XL");
map.put("docIds","(select DOC_ID from HPJX.T_HPSC002A where MAT_ID in(" +
" select distinct ID from HPJX.T_HPSC006 where COMPANY_CODE = '"+companyCode+"' and ID = '"+id+"')" +
" AND BIZ_TYPE = 'XL')");
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);
}
}
}
......@@ -49,7 +49,7 @@ var query = function (e) {
*/
function uploadFile(id) {
JSColorbox.open({
href: "HPSC099?methodName=initLoad",
href: "HPSC099?methodName=initLoad&inqu_status-0-bizType="+$("#inqu_status-0-bizType").val()+"&inqu_status-0-matId="+$("#inqu_status-0-matId").val(),
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
......
......@@ -32,6 +32,8 @@ $(function () {
result.set("result-0-docSize",docSize);
result.set("result-0-docTag",docTag);
result.set("result-0-realPath",docUrl);
result.set("result-0-bizType",$("#inqu_status-0-bizType").val());
result.set("result-0-matId",$("#inqu_status-0-matId").val());
EiCommunicator.send("HPDS002", "insert", result, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
......
......@@ -6,6 +6,8 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="附件上传">
<EF:EFInput cname="物料ID" ename="matId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFRegion id="result">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="hk_file11" path="A"/>
</EF:EFRegion>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment