Commit c880522f by wuwenlong

项目人员-附件详情dev;

parent 7ad122db
...@@ -38,21 +38,21 @@ import lombok.extern.slf4j.Slf4j; ...@@ -38,21 +38,21 @@ import lombok.extern.slf4j.Slf4j;
public class OperationLogAspect { public class OperationLogAspect {
private static final Dao dao = (Dao) PlatApplicationContext.getBean("dao"); private static final Dao dao = (Dao) PlatApplicationContext.getBean("dao");
/** /**
* 设置操作日志切入点 记录操作日志 在注解的位置切入代码 * 设置操作日志切入点 记录操作日志 在注解的位置切入代码
*/ */
@Pointcut("@annotation(com.baosight.hggp.aspect.annotation.OperationLogAnnotation)") @Pointcut("@annotation(com.baosight.hggp.aspect.annotation.OperationLogAnnotation)")
public void operLogPointCut() { public void operLogPointCut() {
} }
/** /**
* 设置操作异常切入点记录异常日志 扫描所有dc包下操作 * 设置操作异常切入点记录异常日志 扫描所有dc包下操作
*/ */
@Pointcut("execution(* com.baosight.hggp.hp.*.service..*.*(..))") @Pointcut("execution(* com.baosight.hggp.hg.*.service..*.*(..))")
public void operExceptionLogPointCut() { public void operExceptionLogPointCut() {
} }
/** /**
* 正常返回通知,拦截用户操作日志,连接点正常执行完成后执行, 如果连接点抛出异常,则不会执行 * 正常返回通知,拦截用户操作日志,连接点正常执行完成后执行, 如果连接点抛出异常,则不会执行
* *
...@@ -106,7 +106,7 @@ public class OperationLogAspect { ...@@ -106,7 +106,7 @@ public class OperationLogAspect {
} }
} }
} }
/** /**
* 异常返回通知,用于拦截异常日志信息 连接点抛出异常后执行 * 异常返回通知,用于拦截异常日志信息 连接点抛出异常后执行
* *
......
...@@ -19,12 +19,11 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -19,12 +19,11 @@ import com.baosight.iplat4j.core.util.StringUtils;
* @history 2024-05-13 15:26:20 create * @history 2024-05-13 15:26:20 create
*/ */
public class HGSC099 extends DaoEPBase { public class HGSC099 extends DaoEPBase {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public static final String FIELD_id = "id"; /* 主键ID*/ public static final String FIELD_id = "id"; /* 主键ID*/
public static final String FIELD_account_code = "accountCode"; /* 帐套*/ public static final String FIELD_account_code = "accountCode"; /* 帐套*/
public static final String FIELD_main_id = "mainId"; /* 主表ID*/ public static final String FIELD_mat_id = "matId"; /* 物料ID*/
public static final String FIELD_doc_id = "docId"; /* 文件ID*/ public static final String FIELD_doc_id = "docId"; /* 文件ID*/
public static final String FIELD_created_by = "createdBy"; /* 创建人*/ public static final String FIELD_created_by = "createdBy"; /* 创建人*/
public static final String FIELD_created_name = "createdName"; /* 创建人名称*/ public static final String FIELD_created_name = "createdName"; /* 创建人名称*/
...@@ -33,10 +32,11 @@ public class HGSC099 extends DaoEPBase { ...@@ -33,10 +32,11 @@ public class HGSC099 extends DaoEPBase {
public static final String FIELD_updated_name = "updatedName"; /* 修改人名称*/ public static final String FIELD_updated_name = "updatedName"; /* 修改人名称*/
public static final String FIELD_updated_time = "updatedTime"; /* 修改时间*/ public static final String FIELD_updated_time = "updatedTime"; /* 修改时间*/
public static final String FIELD_biz_type = "bizType"; /* 业务类型*/ public static final String FIELD_biz_type = "bizType"; /* 业务类型*/
public static final String FIELD_dep_code = "depCode"; /* 部门编码*/
public static final String COL_id = "id"; /* 主键ID*/ public static final String COL_id = "id"; /* 主键ID*/
public static final String COL_account_code = "account_code"; /* 帐套*/ public static final String COL_account_code = "account_code"; /* 帐套*/
public static final String COL_main_id = "main_id"; /* 主表ID*/ public static final String COL_mat_id = "mat_id"; /* 物料ID*/
public static final String COL_doc_id = "doc_id"; /* 文件ID*/ public static final String COL_doc_id = "doc_id"; /* 文件ID*/
public static final String COL_created_by = "created_by"; /* 创建人*/ public static final String COL_created_by = "created_by"; /* 创建人*/
public static final String COL_created_name = "created_name"; /* 创建人名称*/ public static final String COL_created_name = "created_name"; /* 创建人名称*/
...@@ -45,6 +45,7 @@ public class HGSC099 extends DaoEPBase { ...@@ -45,6 +45,7 @@ public class HGSC099 extends DaoEPBase {
public static final String COL_updated_name = "updated_name"; /* 修改人名称*/ public static final String COL_updated_name = "updated_name"; /* 修改人名称*/
public static final String COL_updated_time = "updated_time"; /* 修改时间*/ public static final String COL_updated_time = "updated_time"; /* 修改时间*/
public static final String COL_biz_type = "biz_type"; /* 业务类型*/ public static final String COL_biz_type = "biz_type"; /* 业务类型*/
public static final String COL_dep_code = "dep_code"; /* 部门编码*/
public static final String QUERY = "HGSC099.query"; public static final String QUERY = "HGSC099.query";
public static final String COUNT = "HGSC099.count"; public static final String COUNT = "HGSC099.count";
...@@ -54,7 +55,7 @@ public class HGSC099 extends DaoEPBase { ...@@ -54,7 +55,7 @@ public class HGSC099 extends DaoEPBase {
private Long id = new Long(0); /* 主键ID*/ private Long id = new Long(0); /* 主键ID*/
private String accountCode = " "; /* 帐套*/ private String accountCode = " "; /* 帐套*/
private Long mainId = new Long(0); /* 主表ID*/ private Long matId = new Long(0); /* 物料ID*/
private String docId = " "; /* 文件ID*/ private String docId = " "; /* 文件ID*/
private String createdBy = " "; /* 创建人*/ private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/ private String createdName = " "; /* 创建人名称*/
...@@ -63,6 +64,7 @@ public class HGSC099 extends DaoEPBase { ...@@ -63,6 +64,7 @@ public class HGSC099 extends DaoEPBase {
private String updatedName = " "; /* 修改人名称*/ private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/ private String updatedTime = " "; /* 修改时间*/
private String bizType = " "; /* 业务类型*/ private String bizType = " "; /* 业务类型*/
private String depCode = " "; /* 部门编码*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -79,8 +81,8 @@ public class HGSC099 extends DaoEPBase { ...@@ -79,8 +81,8 @@ public class HGSC099 extends DaoEPBase {
eiColumn.setDescName("帐套"); eiColumn.setDescName("帐套");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_main_id); eiColumn = new EiColumn(FIELD_mat_id);
eiColumn.setDescName("主表ID"); eiColumn.setDescName("物料ID");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_doc_id); eiColumn = new EiColumn(FIELD_doc_id);
...@@ -115,6 +117,10 @@ public class HGSC099 extends DaoEPBase { ...@@ -115,6 +117,10 @@ public class HGSC099 extends DaoEPBase {
eiColumn.setDescName("业务类型"); eiColumn.setDescName("业务类型");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_code);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
} }
...@@ -158,20 +164,20 @@ public class HGSC099 extends DaoEPBase { ...@@ -158,20 +164,20 @@ public class HGSC099 extends DaoEPBase {
this.accountCode = accountCode; this.accountCode = accountCode;
} }
/** /**
* get the mainId - 主表ID. * get the matId - 物料ID.
* @return the mainId * @return the matId
*/ */
public Long getMainId() { public Long getMatId() {
return this.mainId; return this.matId;
} }
/** /**
* set the mainId - 主表ID. * set the matId - 物料ID.
* *
* @param mainId - 主表ID * @param matId - 物料ID
*/ */
public void setMainId(Long mainId) { public void setMatId(Long matId) {
this.mainId = mainId; this.matId = matId;
} }
/** /**
* get the docId - 文件ID. * get the docId - 文件ID.
...@@ -302,6 +308,22 @@ public class HGSC099 extends DaoEPBase { ...@@ -302,6 +308,22 @@ public class HGSC099 extends DaoEPBase {
this.bizType = bizType; this.bizType = bizType;
} }
/** /**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the value from Map. * get the value from Map.
* *
* @param map - source data map * @param map - source data map
...@@ -311,7 +333,7 @@ public class HGSC099 extends DaoEPBase { ...@@ -311,7 +333,7 @@ public class HGSC099 extends DaoEPBase {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_id)), id)); setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_id)), id));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_account_code)), accountCode)); setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_account_code)), accountCode));
setMainId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_main_id)), mainId)); setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_mat_id)), matId));
setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_doc_id)), docId)); setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_doc_id)), docId));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_by)), createdBy)); setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_by)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_name)), createdName)); setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_name)), createdName));
...@@ -320,6 +342,7 @@ public class HGSC099 extends DaoEPBase { ...@@ -320,6 +342,7 @@ public class HGSC099 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_name)), updatedName)); setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_name)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_time)), updatedTime)); setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_time)), updatedTime));
setBizType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_biz_type)), bizType)); setBizType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_biz_type)), bizType));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_code)), depCode));
} }
/** /**
...@@ -331,7 +354,7 @@ public class HGSC099 extends DaoEPBase { ...@@ -331,7 +354,7 @@ public class HGSC099 extends DaoEPBase {
Map map = new HashMap(); Map map = new HashMap();
map.put(FIELD_id, StringUtils.toString(id, eiMetadata.getMeta(FIELD_id))); map.put(FIELD_id, StringUtils.toString(id, eiMetadata.getMeta(FIELD_id)));
map.put(FIELD_account_code, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_account_code))); map.put(FIELD_account_code, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_account_code)));
map.put(FIELD_main_id, StringUtils.toString(mainId, eiMetadata.getMeta(FIELD_main_id))); map.put(FIELD_mat_id, StringUtils.toString(matId, eiMetadata.getMeta(FIELD_mat_id)));
map.put(FIELD_doc_id, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_doc_id))); map.put(FIELD_doc_id, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_doc_id)));
map.put(FIELD_created_by, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_created_by))); map.put(FIELD_created_by, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_created_by)));
map.put(FIELD_created_name, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_created_name))); map.put(FIELD_created_name, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_created_name)));
...@@ -340,6 +363,7 @@ public class HGSC099 extends DaoEPBase { ...@@ -340,6 +363,7 @@ public class HGSC099 extends DaoEPBase {
map.put(FIELD_updated_name, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_updated_name))); map.put(FIELD_updated_name, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_updated_name)));
map.put(FIELD_updated_time, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_updated_time))); map.put(FIELD_updated_time, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_updated_time)));
map.put(FIELD_biz_type, StringUtils.toString(bizType, eiMetadata.getMeta(FIELD_biz_type))); map.put(FIELD_biz_type, StringUtils.toString(bizType, eiMetadata.getMeta(FIELD_biz_type)));
map.put(FIELD_dep_code, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_dep_code)));
return map; return map;
} }
......
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.hg.sc.domain.HGSC099;
import com.baosight.hggp.util.FileUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ProjectInfo;
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.core.service.soa.XServiceManager;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author wwl
* @Date 2024/5/6 19:48
*/
public class ServiceHGSC099 extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC099().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
inInfo = super.query(inInfo, "HGSC099.queryRun", new HGSC099());
} else {
inInfo = super.query(inInfo, "HGSC099.queryDev", new HGSC099());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGSC099 hgsc099 = new HGSC099();
hgsc099.fromMap(resultRows.get(i));
DaoUtils.insert(HGSC099.INSERT, hgsc099);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGSC099 hgsc099 = new HGSC099();
hgsc099.fromMap(resultRows.get(i));
DaoUtils.update(HGSC099.DELETE, hgsc099);
if (!hgsc099.getDocId().isEmpty()) {
this.delectDoc(hgsc099.getDocId());
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 删除文件
* @param docId 文件ID
*/
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HGSC099.FIELD_doc_id,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
this.dao.delete(HGDS002.DELETE,map);
}
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
/**
*
*/
public class ServiceHGSC099A extends ServiceBase {
/**
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
/**
* 附件上传.
*/
public EiInfo form(EiInfo inInfo) {
return inInfo;
}
}
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
company_code = #companyCode# company_code = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName"> <isNotEmpty prepend=" AND " property="companyName">
company_name = ('%$companyName$') company_name like ('%$companyName$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode"> <isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode# dep_code = #depCode#
...@@ -47,19 +47,19 @@ ...@@ -47,19 +47,19 @@
proj_code = #projCode# proj_code = #projCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
proj_name = ('%$projName$') proj_name like ('%$projName$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="personDepName"> <isNotEmpty prepend=" AND " property="personDepName">
person_dep_name = ('%$personDepName$') person_dep_name like ('%$personDepName$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="personName"> <isNotEmpty prepend=" AND " property="personName">
person_name = ('%$personName$') person_name like ('%$personName$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="personPhone"> <isNotEmpty prepend=" AND " property="personPhone">
person_phone = ('%$personPhone$') person_phone like ('%$personPhone$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="personIdCard"> <isNotEmpty prepend=" AND " property="personIdCard">
person_id_card = ('%$personIdCard$') person_id_card like ('%$personIdCard$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode# account_code = #accountCode#
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
tableName : HGSC099 tableName : HGSC099
id BIGINT NOT NULL primarykey, id BIGINT NOT NULL primarykey,
account_code VARCHAR NOT NULL, account_code VARCHAR NOT NULL,
main_id BIGINT, mat_id BIGINT,
doc_id VARCHAR, doc_id VARCHAR,
created_by VARCHAR, created_by VARCHAR,
created_name VARCHAR, created_name VARCHAR,
...@@ -18,146 +18,155 @@ ...@@ -18,146 +18,155 @@
--> -->
<sqlMap namespace="HGSC099"> <sqlMap namespace="HGSC099">
<sql id="column">
A.ID as "id",
A.ACCOUNT_CODE as "accountCode", <!-- 企业编码 预留 -->
A.DEP_CODE as "depCode", <!-- 部门编码 预留 -->
A.BIZ_TYPE as "bizType", <!-- 物料ID -->
A.MAT_ID as "matId", <!-- 物料ID -->
A.DOC_ID as "docId", <!-- 文件ID -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime" <!-- 修改时间 -->
</sql>
<sql id="columnDev">
<include refid="column"/>,
B.DOC_NAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="columnRun">
<include refid="column"/>,
B.RES_CNAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCodes">
A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition"> <sql id="condition">
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
id = #id# A.ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode# A.ACCOUNT_CODE = #accountCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="mainId"> <isNotEmpty prepend=" AND " property="depCode">
main_id = #mainId# A.DEP_CODE = #depCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="docId"> <isNotEmpty prepend=" AND " property="bizType">
doc_id = #docId# A.BIZ_TYPE = #bizType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName"> <isNotEmpty prepend=" AND " property="matId">
created_name = #createdName# A.MAT_ID = #matId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime"> <isNotEmpty prepend=" AND " property="docId">
created_time = #createdTime# A.DOC_ID = #docId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy"> </sql>
updated_by = #updatedBy#
<!-- 开发环境 -->
<sql id="conditionDev">
AND A.DOC_ID = B.DOC_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName"> </sql>
updated_name = #updatedName#
<!-- 正式环境 -->
<sql id="conditionRun">
AND A.DOC_ID = B.RES_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
B.RES_CNAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime"> </sql>
updated_time = #updatedTime#
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType"> <isNotEmpty prepend=" AND " property="createdDateTo">
biz_type = #bizType# A.CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <sql id="order">
resultClass="com.baosight.hggp.hg.sc.domain.HGSC099">
SELECT
id as "id", <!-- 主键ID -->
account_code as "accountCode", <!-- 帐套 -->
main_id as "mainId", <!-- 主表ID -->
doc_id as "docId", <!-- 文件ID -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 修改人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime", <!-- 修改时间 -->
biz_type as "bizType" <!-- 业务类型 -->
FROM ${hggpSchema}.HGSC099 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="order">
$orderBy$ $order$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="order">
id asc A.ID DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql>
<select id="queryDev" resultClass="com.baosight.hggp.hg.sc.domain.HGSC099">
SELECT
<include refid="columnDev"/>
FROM ${hggpSchema}.HGSC099 A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionDev"/>
<include refid="customCondition"/>
<include refid="order"/>
</select> </select>
<select id="count" resultClass="int"> <select id="countDev" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC099 WHERE 1=1 SELECT COUNT(*) FROM ${hggpSchema}.HGSC099 A, ${platSchema}.TEUDM02 B
<include refid="condition" /> WHERE 1=1
<include refid="conditionDev"/>
<include refid="customCondition"/>
</select> </select>
<!-- <select id="queryRun" resultClass="com.baosight.hggp.hg.sc.domain.HGSC099">
<isNotEmpty prepend=" AND " property="id"> SELECT
id = #id# <include refid="columnRun"/>
</isNotEmpty> FROM ${hggpSchema}.HGSC099 A, ${platSchema}.TEUDM05 B
<isNotEmpty prepend=" AND " property="accountCode"> WHERE 1=1
account_code = #accountCode# <include refid="conditionRun"/>
</isNotEmpty> <include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="mainId"> <include refid="order"/>
main_id = #mainId# </select>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId"> <select id="countRun" resultClass="int">
doc_id = #docId# SELECT COUNT(*) FROM ${hggpSchema}.HGSC099 A, ${platSchema}.TEUDM05 B
</isNotEmpty> WHERE 1=1
<isNotEmpty prepend=" AND " property="createdBy"> <include refid="conditionRun"/>
created_by = #createdBy# <include refid="customCondition"/>
</isNotEmpty> </select>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType">
biz_type = #bizType#
</isNotEmpty>
-->
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGSC099 (id, <!-- 主键ID --> INSERT INTO ${hggpSchema}.HGSC099 (
account_code, <!-- 帐套 --> ACCOUNT_CODE, <!-- 企业编码 预留 -->
main_id, <!-- 主表ID --> DEP_CODE, <!-- 部门编码 预留 -->
doc_id, <!-- 文件ID --> BIZ_TYPE,
created_by, <!-- 创建人 --> MAT_ID, <!-- 物料ID -->
created_name, <!-- 创建人名称 --> DOC_ID, <!-- 文件ID -->
created_time, <!-- 创建时间 --> CREATED_BY, <!-- 创建人 -->
updated_by, <!-- 修改人 --> CREATED_NAME, <!-- 创建人名称 -->
updated_name, <!-- 修改人名称 --> CREATED_TIME <!-- 创建时间 -->
updated_time, <!-- 修改时间 --> ) VALUES (
biz_type <!-- 业务类型 --> #accountCode#, #depCode#, #bizType#, #matId#, #docId#, #createdBy#,
) #createdName#, #createdTime#
VALUES (#id#, #accountCode#, #mainId#, #docId#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #bizType#) )
</insert> </insert>
<delete id="delete"> <delete id="delete">
DELETE FROM ${hggpSchema}.HGSC099 WHERE DELETE FROM ${hggpSchema}.HGSC099 WHERE ID = #id#
id = #id#
</delete> </delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC099
SET
account_code = #accountCode#, <!-- 帐套 -->
main_id = #mainId#, <!-- 主表ID -->
doc_id = #docId#, <!-- 文件ID -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 修改人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime#, <!-- 修改时间 -->
biz_type = #bizType# <!-- 业务类型 -->
WHERE
id = #id#
</update>
</sqlMap> </sqlMap>
...@@ -88,7 +88,7 @@ $(function () { ...@@ -88,7 +88,7 @@ $(function () {
field: "operator", field: "operator",
template: function (item) { template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="showFile(' + item.id + ')" >附件详情</a>'; 'onclick="showUploadFile(' + item.id + ')" >附件详情</a>';
return template; return template;
} }
} }
...@@ -137,13 +137,17 @@ function saveCallBack(){ ...@@ -137,13 +137,17 @@ function saveCallBack(){
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
} }
function showFile(id) { /**
// JSColorbox.open({ * 显示附件清单
// href: "HGSC001D?inqu_status-0-id=" + id + "&efParentFormEname=HGSC001", *
// title: "<div style='text-align: center;'>查看项目</div>", * @param id
// width: "90%", */
// height: "90%", function showUploadFile(id) {
// callbackName: windowCallback JSColorbox.open({
// }); href: "HGSC099?methodName=initLoad&inqu_status-0-bizType=XMRY&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件详情</div>",
width: "80%",
height: "80%",
});
} }
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.docId) + '" target="_blank">附件下载</a>';
return template;
}
}],
loadComplete: function(grid){
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
// 删除
$("#BTN_DELETE").on("click", deleteFunc);
},
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
}
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HGSC099A?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%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(docId) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-matId", $("#inqu_status-0-matId").val());
inEiInfo.set("result-0-docId", docId);
inEiInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val());
EiCommunicator.send('HGSC099', 'insert', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
* 删除
*/
function deleteFunc() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC099", "delete", true);
}
})
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="附件清单">
<EF:EFRegion id="inqu" title="查询区域" type="query">
<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"/>
<div class="row">
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<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="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"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFUpload = {
uploadFile: {
success: function(e) {
let docId = e.response.docId;
if (isBlank(docId)) {
return;
}
$("#fileDocId").val(docId);
NotificationUtil("附件上传成功");
console.log($("#fileDocId").val())
saveTemp(e);
try {
parent.JSColorbox.setValueCallback(docId);
} catch (e){
}
},
}
};
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);
result.set("result-0-bizType",$("#inqu_status-0-bizType").val());
result.set("result-0-matId",$("#inqu_status-0-matId").val());
EiCommunicator.send("HGDS002", "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");
}
});
}
});
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<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="HGSC"/>
</EF:EFRegion>
<EF:EFInput ename="fileDocId" cname="" hidden="true"/>
</EF:EFPage>
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