Commit 7cadec6f by liuyang

2024-08-16 安全记录APP附件上传

parent 759f9179
......@@ -87,6 +87,8 @@ public class HPConstant {
// 整改通知单号
public static final String RECTIFY_ID = "RECTIFY_ID";
//收款单
public static final String CW_COLLECTION_NO = "CW_COLLECTION_NO";
}
/**
......
......@@ -35,6 +35,7 @@ public class HPSB099 extends DaoEPBase {
public static final String FIELD_REAL_PATH = "realPath"; /* 物理路径*/
public static final String FIELD_BIZ_TYPE = "bizType"; /* 业务类型*/
public static final String FIELD_MAT_ID = "matId"; /* 上级ID*/
public static final String FIELD_DOC_VIDEO_ID = "docVideoId";
public static final String COL_COMPANY_CODE = "COMPANY_CODE";
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
......@@ -79,6 +80,7 @@ public class HPSB099 extends DaoEPBase {
private String realPath = " "; /* 物理路径*/
private String bizType = " "; /* 业务类型*/
private Long matId = new Long(0); /* 上级ID*/
private String docVideoId = " ";
/**
* initialize the metadata.
......@@ -163,6 +165,10 @@ public class HPSB099 extends DaoEPBase {
eiColumn.setDescName("上级ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_VIDEO_ID);
eiColumn.setDescName("视频文件标识");
eiMetadata.addMeta(eiColumn);
}
......@@ -462,6 +468,15 @@ public class HPSB099 extends DaoEPBase {
public void setMatId(Long matId) {
this.matId = matId;
}
public String getDocVideoId() {
return docVideoId;
}
public void setDocVideoId(String docVideoId) {
this.docVideoId = docVideoId;
}
/**
* get the value from Map.
*
......@@ -488,6 +503,7 @@ public class HPSB099 extends DaoEPBase {
setRealPath(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REAL_PATH)), realPath));
setBizType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BIZ_TYPE)), bizType));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_MAT_ID)), matId));
setDocVideoId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_VIDEO_ID)), docVideoId));
}
/**
......@@ -515,6 +531,7 @@ public class HPSB099 extends DaoEPBase {
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)));
map.put(FIELD_DOC_VIDEO_ID, StringUtils.toString(docVideoId, eiMetadata.getMeta(FIELD_DOC_VIDEO_ID)));
return map;
}
......
......@@ -7,9 +7,9 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.sb.domain.HPSB003;
import com.baosight.hpjx.hp.sb.domain.HPSB008;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.hp.sb.domain.HPSB099;
import com.baosight.hpjx.hp.sb.tools.HPSBTools;
import com.baosight.hpjx.util.*;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiBlockMeta;
......@@ -98,4 +98,40 @@ public class ServiceHPSB008 extends ServiceEPBase {
public void modify(HPSB008 hgsb002) {
DaoUtils.update(HPSB008.UPDATE, hgsb002);
}
@OperationLogAnnotation(operModul = "安全记录", operType = "新增", operDesc = "app新增操作")
public EiInfo appSave(EiInfo inInfo) {
try{
Map resultMap = EiInfoUtils.getFirstRow(inInfo, EiConstant.resultBlock);
HPSB008 hpsb008 = HPSBTools.Hpsb008.add(resultMap);
String docId = MapUtils.getString(resultMap, HPSB099.FIELD_DOC_ID);
String docVideoId = MapUtils.getString(resultMap, HPSB099.FIELD_DOC_VIDEO_ID);
if (StringUtils.isNotEmpty(docId)) {
String [] docIds = docId.split(",");
for (String docIdStr : docIds){
HPSB099 hgsc099 = new HPSB099();
hgsc099.setBizType("SBJL");
hgsc099.setDocId(docIdStr);
hgsc099.setMatId(hpsb008.getId());
DaoUtils.insert(HPSB099.INSERT, hgsc099);
}
}
if (StringUtils.isNotEmpty(docVideoId)){
String [] docVideoIds = docVideoId.split(",");
for (String docIdStr : docVideoIds){
HPSB099 hgsc099 = new HPSB099();
hgsc099.setBizType("SBJL");
hgsc099.setDocId(docIdStr);
hgsc099.setDocVideoId(docIdStr);
hgsc099.setMatId(hpsb008.getId());
DaoUtils.insert(HPSB099.INSERT, hgsc099);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
}
......@@ -216,28 +216,33 @@
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPSB008 (ID, <!-- ID -->
COMPANY_CODE, <!-- 公司编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
FACTORY_CODE, <!-- 工厂代码(公司名称) -->
FACTORY_NAME, <!-- 工厂名称 -->
GROUP_CODE, <!-- 生产组代码(设备区域) -->
GROUP_NAME, <!-- 生产组名称 -->
RECORD_DATE, <!-- 记录日期 -->
RECORD_CODE, <!-- 记录单号 -->
DEVICE_TYPE, <!-- 设备类型 -->
DEVICE_CODE, <!-- 设备编码 -->
DEVICE_NAME, <!-- 设备名称 -->
DEVICE_MODEL, <!-- 设备型号 -->
SECURE_DESC <!-- 安全事故描述 -->
)
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #recordDate#, #recordCode#, #deviceType#, #deviceCode#, #deviceName#, #deviceModel#, #secureDesc#)
COMPANY_CODE, <!-- 公司编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
FACTORY_CODE, <!-- 工厂代码(公司名称) -->
FACTORY_NAME, <!-- 工厂名称 -->
GROUP_CODE, <!-- 生产组代码(设备区域) -->
GROUP_NAME, <!-- 生产组名称 -->
RECORD_DATE, <!-- 记录日期 -->
RECORD_CODE, <!-- 记录单号 -->
DEVICE_TYPE, <!-- 设备类型 -->
DEVICE_CODE, <!-- 设备编码 -->
DEVICE_NAME, <!-- 设备名称 -->
DEVICE_MODEL, <!-- 设备型号 -->
SECURE_DESC <!-- 安全事故描述 -->
)
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #recordDate#, #recordCode#,
#deviceType#, #deviceCode#, #deviceName#, #deviceModel#, #secureDesc#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hpjxSchema}.T_HPSB008
</selectKey>
</insert>
<delete id="delete">
......
......@@ -20,7 +20,8 @@
A.ARCHIVE_FLAG as "archiveFlag", <!-- 同步标记 -->
A.REAL_PATH as "realPath", <!-- 物理路径 -->
A.BIZ_TYPE as "bizType", <!-- 业务类型 -->
A.MAT_ID as "matId" <!-- 上级ID -->
A.MAT_ID as "matId", <!-- 上级ID -->
A.DOC_VIDEO_ID as "docVideoId"
</sql>
<sql id="columnDev">
......@@ -56,6 +57,9 @@
<isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docVideoId">
A.DOC_VIDEO_ID = #docVideoId#
</isNotEmpty>
</sql>
<!-- 开发环境 -->
......@@ -116,7 +120,8 @@
ARCHIVE_FLAG as "archiveFlag", <!-- 同步标记 -->
REAL_PATH as "realPath", <!-- 物理路径 -->
BIZ_TYPE as "bizType", <!-- 业务类型 -->
MAT_ID as "matId" <!-- 上级ID -->
MAT_ID as "matId", <!-- 上级ID -->
DOC_VIDEO_ID as "docVideoId"
FROM ${hpjxSchema}.T_HPSB099 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
......@@ -246,9 +251,12 @@
ARCHIVE_FLAG, <!-- 同步标记 -->
REAL_PATH, <!-- 物理路径 -->
BIZ_TYPE, <!-- 业务类型 -->
MAT_ID <!-- 上级ID -->
MAT_ID, <!-- 上级ID -->
DOC_VIDEO_ID
)
VALUES (#companyCode#, #depCode#, #docId#, #dirId#, #docName#, #chgName#, #docSize#, #docTag#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #archiveFlag#, #realPath#, #bizType#, #matId#)
VALUES (#companyCode#, #depCode#, #docId#, #dirId#, #docName#, #chgName#, #docSize#, #docTag#, #createdBy#,
#createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #archiveFlag#, #realPath#, #bizType#,
#matId#, #docVideoId#)
</insert>
<delete id="delete">
......@@ -275,7 +283,8 @@
ARCHIVE_FLAG = #archiveFlag#, <!-- 同步标记 -->
REAL_PATH = #realPath#, <!-- 物理路径 -->
BIZ_TYPE = #bizType#, <!-- 业务类型 -->
MAT_ID = #matId# <!-- 上级ID -->
MAT_ID = #matId#, <!-- 上级ID -->
DOC_VIDEO_ID = #docVideoId#
WHERE
COMPANY_CODE = #companyCode# AND
DOC_ID = #docId#
......
......@@ -2,9 +2,16 @@ package com.baosight.hpjx.hp.sb.tools;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.sb.domain.*;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -17,7 +24,7 @@ import java.util.Map;
public class HPSBTools {
/**
* Hgsb002公共DAO方法定义
* Hpsb002公共DAO方法定义
*
*/
public static class Hpsb004 {
......@@ -64,7 +71,7 @@ public class HPSBTools {
}
/**
* Hgsb004公共DAO方法定义
* Hpsb004公共DAO方法定义
*
*/
public static class Hpsb006 {
......@@ -110,6 +117,10 @@ public class HPSBTools {
}
}
/**
* Hpsb007公共DAO方法定义
*
*/
public static class Hpsb007 {
public static HPSB007 getId(Long id) {
......@@ -131,4 +142,26 @@ public class HPSBTools {
return results;
}
}
public static class Hpsb008{
public static HPSB008 getId(Long id) {
AssertUtils.isNull(id, "安全记录不能为空");
Map queryMap = new HashMap();
queryMap.put(HPSB008.FIELD_ID, id);
queryMap.put(HPSB008.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
List<HPSB008> results = DaoBase.getInstance().query(HPSB008.QUERY, queryMap);
AssertUtils.isEmpty(results, "安全记录不存在");
return results.get(0);
}
public static HPSB008 add(Map resultMap) {
//String taskId = MapUtils.getString(resultMap, HGSC008.FIELD_task_id);
//HGSC007 hgsc007 = HGSCTools.THGSC007.getById(Long.valueOf(taskId));
HPSB008 hpsb008 = new HPSB008();
hpsb008.fromMap(resultMap);
hpsb008.setRecordCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.RECORD_CODE));
DaoUtils.insert(HPSB008.INSERT, hpsb008);
return hpsb008;
}
}
}
......@@ -253,7 +253,7 @@ let save = function (btnNode) {
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002A?methodName=initLoad&inqu_status-0-bizType=SB&inqu_status-0-matId=" + id,
href: "HPSB099?methodName=initLoad&inqu_status-0-bizType=SBJL&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
......
......@@ -25,7 +25,7 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="200"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
......
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