Commit 747cce3f by 宋祥

1.客户回访功能

parent 9d2fc311
...@@ -23,7 +23,7 @@ public class HGDM099 extends DaoEPBase { ...@@ -23,7 +23,7 @@ public class HGDM099 extends DaoEPBase {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; public static final String FIELD_ID = "id";
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/ public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码 预留*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/ public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
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"; /* 创建人名称*/
...@@ -52,14 +52,14 @@ public class HGDM099 extends DaoEPBase { ...@@ -52,14 +52,14 @@ public class HGDM099 extends DaoEPBase {
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_DOC_NAME = "DOC_NAME"; /* 文件名称*/ public static final String COL_DOC_NAME = "DOC_NAME"; /* 文件名称*/
public static final String QUERY = "HPDM099.query"; public static final String QUERY = "HGDM099.query";
public static final String COUNT = "HPDM099.count"; public static final String COUNT = "HGDM099.count";
public static final String INSERT = "HPDM099.insert"; public static final String INSERT = "HGDM099.insert";
public static final String UPDATE = "HPDM099.update"; public static final String UPDATE = "HGDM099.update";
public static final String DELETE = "HPDM099.delete"; public static final String DELETE = "HGDM099.delete";
private Long id = new Long(0); private Long id = new Long(0);
private String companyCode = " "; /* 企业编码 预留*/ private String accountCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/ private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/ private String createdName = " "; /* 创建人名称*/
...@@ -84,8 +84,8 @@ public class HGDM099 extends DaoEPBase { ...@@ -84,8 +84,8 @@ public class HGDM099 extends DaoEPBase {
eiColumn.setDescName(" "); eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE); eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("企业编码 预留"); eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE); eiColumn = new EiColumn(FIELD_DEP_CODE);
...@@ -162,20 +162,20 @@ public class HGDM099 extends DaoEPBase { ...@@ -162,20 +162,20 @@ public class HGDM099 extends DaoEPBase {
this.id = id; this.id = id;
} }
/** /**
* get the companyCode - 企业编码 预留. * get the accountCode - 企业编码.
* @return the companyCode * @return the accountCode
*/ */
public String getCompanyCode() { public String getAccountCode() {
return this.companyCode; return this.accountCode;
} }
/** /**
* set the companyCode - 企业编码 预留. * set the accountCode - 企业编码.
* *
* @param companyCode - 企业编码 预留 * @param accountCode - 企业编码
*/ */
public void setCompanyCode(String companyCode) { public void setAccountCode(String accountCode) {
this.companyCode = companyCode; this.accountCode = accountCode;
} }
/** /**
* get the depCode - 部门编码. * get the depCode - 部门编码.
...@@ -358,7 +358,7 @@ public class HGDM099 extends DaoEPBase { ...@@ -358,7 +358,7 @@ public class HGDM099 extends DaoEPBase {
* @return the docName * @return the docName
*/ */
public String getDocName() { public String getDocName() {
return this.getDocName(); return this.docName;
} }
/** /**
...@@ -378,7 +378,7 @@ public class HGDM099 extends DaoEPBase { ...@@ -378,7 +378,7 @@ public class HGDM099 extends DaoEPBase {
public void fromMap(Map map) { public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id)); setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode)); setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
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));
...@@ -401,7 +401,7 @@ public class HGDM099 extends DaoEPBase { ...@@ -401,7 +401,7 @@ public class HGDM099 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_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE))); map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE))); map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
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)));
......
...@@ -46,12 +46,7 @@ public class ServiceHGDM099 extends ServiceEPBase { ...@@ -46,12 +46,7 @@ public class ServiceHGDM099 extends ServiceEPBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
// 文件存储位置 inInfo = super.query(inInfo, HGDM099.QUERY, new HGDM099());
if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) {
inInfo = super.query(inInfo, "HGDM099.queryS3", new HGDM099());
} else {
inInfo = super.query(inInfo, "HGDM099.queryLocal", new HGDM099());
}
} catch (Throwable e) { } catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
...@@ -83,7 +78,7 @@ public class ServiceHGDM099 extends ServiceEPBase { ...@@ -83,7 +78,7 @@ public class ServiceHGDM099 extends ServiceEPBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
public EiInfo delete(EiInfo inInfo) { public EiInfo remove(EiInfo inInfo) {
try { try {
List<HGDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HGDM099.class); List<HGDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HGDM099.class);
for (HGDM099 fDm099 : fDm099s) { for (HGDM099 fDm099 : fDm099s) {
......
...@@ -3,72 +3,48 @@ ...@@ -3,72 +3,48 @@
<sqlMap namespace="HGDM099"> <sqlMap namespace="HGDM099">
<sql id="column"> <sql id="column">
A.ID as "id", ID as "id",
A.COMPANY_CODE as "companyCode", <!-- 企业编码 预留 --> ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
A.DEP_CODE as "depCode", <!-- 部门编码 预留 --> DEP_CODE as "depCode", <!-- 部门编码 预留 -->
A.CREATED_BY as "createdBy", <!-- 创建人 --> CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 --> CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 --> CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 --> UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 --> UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 修改时间 --> UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
A.BIZ_TYPE as "bizType", <!-- 业务类型 --> BIZ_TYPE as "bizType", <!-- 业务类型 -->
A.BIZ_ID as "bizId", <!-- 业务ID --> BIZ_ID as "bizId", <!-- 业务ID -->
A.DOC_ID as "docId" <!-- 文件ID --> DOC_ID as "docId", <!-- 文件ID -->
</sql> DOC_NAME as "docName" <!-- 文件名称 -->
<sql id="columnLocal">
<include refid="column"/>,
B.DOC_NAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="columnS3">
<include refid="column"/>,
B.RES_CNAME as "docName" <!-- 文件名称 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
AND A.DELETE_FLAG = '0' AND DELETE_FLAG = '0'
<include refid="HGXSDataAuth.authConditionA"/> <include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
A.ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType"> <isNotEmpty prepend=" AND " property="bizType">
A.BIZ_TYPE = #bizType# BIZ_TYPE = #bizType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="bizId"> <isNotEmpty prepend=" AND " property="bizId">
A.BIZ_ID = #bizId# BIZ_ID = #bizId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="docId"> <isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId# DOC_ID = #docId#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="customCondition"> <sql id="customCondition">
<include refid="condition"/> <include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom"> <isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000') CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo"> <isNotEmpty prepend=" AND " property="createdDateTo">
A.CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959') CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<!-- 本地 -->
<sql id="conditionLocal">
AND A.DOC_ID = B.DOC_ID
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="docName">
B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<!-- S3地址 -->
<sql id="conditionS3">
AND A.DOC_ID = B.RES_ID
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="docName">
B.RES_CNAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty> </isNotEmpty>
</sql> </sql>
...@@ -78,46 +54,30 @@ ...@@ -78,46 +54,30 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
A.ID asc ID DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql> </sql>
<select id="queryLocal" resultClass="com.baosight.hggp.hg.dm.domain.HGDM099"> <select id="query" resultClass="com.baosight.hggp.hg.dm.domain.HGDM099">
SELECT SELECT
<include refid="columnLocal"/> <include refid="column"/>
FROM ${hggpSchema}.HGDM099 A, ${platSchema}.TEUDM02 B FROM ${hggpSchema}.HGDM099
WHERE 1=1
<include refid="conditionLocal"/>
<include refid="orderBy"/>
</select>
<select id="countLocal" resultClass="int">
SELECT COUNT(*)
FROM ${hggpSchema}.HGDM099 A, ${platSchema}.TEUDM02 B
WHERE 1=1 WHERE 1=1
<include refid="conditionLocal"/> <include refid="customCondition"/>
</select>
<select id="queryS3" resultClass="com.baosight.hpjx.hp.dm.domain.HPDM099">
SELECT
<include refid="columnS3"/>
FROM ${hggpSchema}.HGDM099 A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionS3"/>
<include refid="orderBy"/> <include refid="orderBy"/>
</select> </select>
<select id="countS3" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) SELECT COUNT(*)
FROM ${hggpSchema}.HGDM099 A, ${platSchema}.TEUDM05 B FROM ${hggpSchema}.HGDM099
WHERE 1=1 WHERE 1=1
<include refid="conditionS3"/> <include refid="customCondition"/>
</select> </select>
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGDM099 ( INSERT INTO ${hggpSchema}.HGDM099 (
COMPANY_CODE, <!-- 企业编码 预留 --> ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 --> CREATED_NAME, <!-- 创建人名称 -->
...@@ -126,16 +86,16 @@ ...@@ -126,16 +86,16 @@
BIZ_TYPE, <!-- 业务类型 --> BIZ_TYPE, <!-- 业务类型 -->
BIZ_ID, <!-- 业务ID --> BIZ_ID, <!-- 业务ID -->
DOC_ID, <!-- 文件ID --> DOC_ID, <!-- 文件ID -->
DOC_ID <!-- 文件名称 --> DOC_NAME <!-- 文件名称 -->
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName# #deleteFlag#, #bizType#, #bizId#, #docId#, #docName#
) )
</insert> </insert>
<delete id="delete"> <delete id="delete">
UPDATE ${hggpSchema}.HGDM099 UPDATE ${hggpSchema}.HGDM099
SET DELETE_FLAG = '1' SET DELETE_FLAG = 1
WHERE ID = #id# WHERE ID = #id#
</delete> </delete>
......
package com.baosight.hggp.hg.xs.constant;
/**
* @author:songx
* @date:2024/8/27,9:14
*/
public class HgXsConstant {
/**
* 状态
*
* @author:songx
* @date:2024/5/7,16:36
*/
public static class FolStatus {
// 待回访
public static final Integer S0 = 0;
// 已回访
public static final Integer S1 = 1;
}
}
package com.baosight.hggp.hg.xs.constant;
/**
* @author:songx
* @date:2024/8/27,9:14
*/
public class HgXsSqlConstant {
/**
* 客户回访
*
* @author:songx
* @date:2024/5/7,16:36
*/
public static class HgXs007 {
// 审核
public static final String CHECK = "HGXS007.check";
// 锁
public static final String LOCK = "HGXS007.lock";
}
}
package com.baosight.hggp.hg.xs.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.xs.constant.HgXsConstant;
import com.baosight.hggp.hg.xs.constant.HgXsSqlConstant;
import com.baosight.hggp.hg.xs.domain.HGXS007;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.hg.xs.utils.HGXSUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
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.ServiceBase;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 客户回访
*
* @author:songx
* @date:2024/8/27,9:05
*/
public class ServiceHGXS007 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGXS007().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "客户回访", operType = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGXS007.FIELD_FOL_DATE, DateUtils.formatShort(queryMap.get(HGXS007.FIELD_FOL_DATE)));
inInfo = super.query(inInfo, HGXS007.QUERY, new HGXS007());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "删除")
public EiInfo remove(EiInfo inInfo) {
try {
List<HGXS007> fXs007s = MapUtils.toDaoEPBases(inInfo, HGXS007.class);
Map<Long, HGXS007> dbXs007s = HGXSUtils.HgXs007.lockAndGet(fXs007s);
for (HGXS007 fXs007 : fXs007s) {
Long id = fXs007.getId();
HGXS007 dbXs007 = dbXs007s.get(id);
this.checkData(dbXs007);
DaoUtils.update(HGXS007.DELETE, fXs007);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fXs007s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 审核
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "审核")
public EiInfo check(EiInfo inInfo) {
try {
List<HGXS007> fXs007s = MapUtils.toDaoEPBases(inInfo, HGXS007.class);
Map<Long, HGXS007> dbXs007s = HGXSUtils.HgXs007.lockAndGet(fXs007s);
for (HGXS007 fXs007 : fXs007s) {
Long id = fXs007.getId();
HGXS007 dbXs007 = dbXs007s.get(id);
this.checkData(dbXs007);
fXs007.setFolStatus(HgXsConstant.FolStatus.S1);
DaoUtils.update(HgXsSqlConstant.HgXs007.CHECK, fXs007);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fXs007s.size() + "]条数据审核成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "审核失败");
}
return inInfo;
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
HGXS007 dbXs007 = HGXSUtils.HgXs007.lockAndGet(MapUtils.getLong(queryMap, HGXS007.FIELD_ID));
this.checkData(dbXs007);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param dbXs007
*/
private void checkData(HGXS007 dbXs007) {
AssertUtils.isNotEquals(dbXs007.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("回访单【%s】不是\"未删除\"状态,不允许操作", dbXs007.getId()));
AssertUtils.isNotEquals(dbXs007.getFolStatus(), HgXsConstant.FolStatus.S0,
String.format("回访单【%s】不是\"待回访\"状态,不允许操作", dbXs007.getId()));
}
}
package com.baosight.hggp.hg.xs.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.constant.S3Constant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.cw.domain.HGCW002;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.xs.constant.HgXsConstant;
import com.baosight.hggp.hg.xs.domain.HGXS007;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.hg.xs.utils.HGXSUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 附件清单
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGXS007A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "附件清单", operType = "查询", operDesc = "物料清单-附件清单A-查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGDM099.QUERY, new HGDM099());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
Long bizId = MapUtils.getLong(queryMap, HGDM099.FIELD_BIZ_ID);
HGXS007 dbXs007 = HGXSUtils.HgXs007.lockAndGet(bizId);
this.checkData(dbXs007);
List<HGDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HGDM099.class);
for (HGDM099 fDm099 : fDm099s) {
DaoUtils.update(HGDM099.DELETE, fDm099);
if (!fDm099.getDocId().isEmpty()) {
Iplat4jUtils.deleteFileByDocId(fDm099.getDocId());
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fDm099s.size() + "]条数据删除成功!");
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param dbXs007
*/
private void checkData(HGXS007 dbXs007) {
AssertUtils.isNotEquals(dbXs007.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("回访单【%s】不是\"未删除\"状态,不允许操作", dbXs007.getId()));
AssertUtils.isNotEquals(dbXs007.getFolStatus(), HgXsConstant.FolStatus.S0,
String.format("回访单【%s】不是\"待回访\"状态,不允许操作", dbXs007.getId()));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
Long bizId = MapUtils.getLong(queryRow, HGDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HGXSTools.HgXs007.get(bizId));
block.addBlockMeta(new HGXS007().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hggp.hg.xs.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.constant.HgScSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.constant.HgXsConstant;
import com.baosight.hggp.hg.xs.domain.HGXS007;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.hg.xs.utils.HGXSUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.Map;
/**
* 新增修改
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGXS007B extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
this.setProjectInfo(inInfo);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
HGXS007 fXs007 = MapUtils.toDaoEPBase(inInfo, HGXS007.class);
fXs007.setFolDate(DateUtils.formatShort(fXs007.getFolDate()));
if (fXs007.getId() == null || fXs007.getId() == 0) {
this.add(fXs007);
} else {
this.modify(fXs007);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fXs007
*/
private void add(HGXS007 fXs007) {
fXs007.setFolStatus(HgXsConstant.FolStatus.S0);
DaoUtils.insert(HGXS007.INSERT, fXs007);
}
/**
* 修改数据
*
* @param fXs007
*/
private void modify(HGXS007 fXs007) {
HGXS007 dbXs007 = HGXSUtils.HgXs007.lockAndGet(fXs007);
this.checkData(dbXs007);
DaoUtils.update(HGXS007.UPDATE, fXs007);
}
/**
* 设置项目信息
*
* @param inInfo
*/
public void setProjectInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
Long id = MapUtils.getLong(queryRow, HGXS007.FIELD_ID);
if (id == null) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HGXSTools.HgXs007.get(id));
resultBlock.addBlockMeta(new HGXS007().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param dbXs007
*/
private void checkData(HGXS007 dbXs007) {
AssertUtils.isNotEquals(dbXs007.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("回访单【%s】不是\"未删除\"状态,不允许操作", dbXs007.getId()));
AssertUtils.isNotEquals(dbXs007.getFolStatus(), HgXsConstant.FolStatus.S0,
String.format("回访单【%s】不是\"待回访\"状态,不允许操作", dbXs007.getId()));
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGXS007">
<sql id="column">
ID as "id", <!-- ID -->
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
FOL_DATE as "folDate", <!-- 回访日期 -->
FOL_TYPE as "folType", <!-- 回访方式 1-电话回访 2-上门回访 -->
FOL_STATUS as "folStatus" <!-- 回访状态 0-待回访 1-已回访 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="HGXSDataAuth.authCondition"/>
<include refid="idCondition"/>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<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="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="folDate">
FOL_DATE = #folDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="folType">
FOL_TYPE = #folType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="folStatus">
FOL_STATUS = #folStatus#
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate open="(" close=")" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.xs.domain.HGXS007">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGXS007
WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGXS007
WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGXS007 (
ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
FOL_DATE, <!-- 回访日期 -->
FOL_TYPE, <!-- 回访方式 1-电话回访 2-上门回访 -->
FOL_STATUS <!-- 回访状态 0-待回访 1-已回访 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#companyCode#, #companyName#, #folDate#, #folType#, #folStatus#
)
</insert>
<!-- 逻辑删除 -->
<delete id="delete">
UPDATE ${hggpSchema}.HGXS007
SET DELETE_FLAG = 1,
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</delete>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGXS007
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<update id="update">
UPDATE ${hggpSchema}.HGXS007
SET
FOL_DATE = #folDate#, <!-- 回访日期 -->
FOL_TYPE = #folType#, <!-- 回访方式 1-电话回访 2-上门回访 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<!-- 审核 -->
<update id="check">
UPDATE ${hggpSchema}.HGXS007
SET
FOL_STATUS = #folStatus#, <!-- 回访状态 0-待回访 1-已回访 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
</sqlMap>
...@@ -4,6 +4,8 @@ import com.baosight.hggp.core.dao.DaoBase; ...@@ -4,6 +4,8 @@ import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.enums.OrgTypeEnum; import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.xs.constant.HgXsSqlConstant;
import com.baosight.hggp.hg.xs.domain.HGXS007;
import com.baosight.hggp.hg.xs.domain.Org; import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.domain.UserGroup; import com.baosight.hggp.hg.xs.domain.UserGroup;
...@@ -33,6 +35,81 @@ import java.util.stream.Collectors; ...@@ -33,6 +35,81 @@ import java.util.stream.Collectors;
public class HGXSTools { public class HGXSTools {
/** /**
* 客户回访
*
* @author:songx
* @date:2024/8/27,9:27
*/
public static class HgXs007 {
/**
* 锁.
*
* @param id ID
*/
public static void lock(Long id) {
AssertUtils.isNull(id, "ID不能为空!");
Map<String, Object> map = new HashMap<>();
map.put(HGXS007.FIELD_ID, id);
DaoBase.getInstance().update(HgXsSqlConstant.HgXs007.LOCK, map);
}
/**
* 锁.
*
* @param ids ID
*/
public static void lock(List<Long> ids) {
AssertUtils.isEmpty(ids, "ID不能为空!");
Map<String, Object> map = new HashMap<>();
map.put("ids", ids);
DaoBase.getInstance().update(HgXsSqlConstant.HgXs007.LOCK, map);
}
/**
* 查询
*
* @param id ID
* @return
*/
public static HGXS007 get(Long id) {
if (id == null) {
return null;
}
Map<String, Object> paramMap = new HashMap();
paramMap.put(HGXS007.FIELD_ID, id);
List<HGXS007> results = DaoBase.getInstance().query(HGXS007.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param ids ID
* @return
*/
public static List<HGXS007> list(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return null;
}
Map<String, Object> paramMap = new HashMap();
paramMap.put("ids", ids);
return DaoBase.getInstance().query(HGXS007.QUERY, paramMap);
}
/**
* 查询
*
* @param ids ID
* @return
*/
public static Map<Long, HGXS007> map(List<Long> ids) {
List<HGXS007> results = list(ids);
return results.stream().collect(Collectors.toMap(HGXS007::getId, item -> item));
}
}
/**
* @author:songx * @author:songx
* @date:2024/2/4,10:35 * @date:2024/2/4,10:35
*/ */
......
package com.baosight.hggp.hg.xs.utils; package com.baosight.hggp.hg.xs.utils;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.xs.domain.HGXS007;
import com.baosight.hggp.hg.xs.domain.Org; import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.domain.UserGroup; import com.baosight.hggp.hg.xs.domain.UserGroup;
...@@ -98,4 +99,51 @@ public class HGXSUtils { ...@@ -98,4 +99,51 @@ public class HGXSUtils {
} }
} }
/**
* 客户回访
*
* @author:songx
* @date:2024/8/27,9:25
*/
public static class HgXs007 {
/**
* 锁并获取数据
*
* @param id
* @return
*/
public static HGXS007 lockAndGet(Long id) {
// 锁
HGXSTools.HgXs007.lock(id);
// 查询数据
return HGXSTools.HgXs007.get(id);
}
/**
* 锁并获取数据
*
* @param fXs007
* @return
*/
public static HGXS007 lockAndGet(HGXS007 fXs007) {
return lockAndGet(fXs007.getId());
}
/**
* 锁并获取数据
*
* @param fXs007s
* @return
*/
public static Map<Long, HGXS007> lockAndGet(List<HGXS007> fXs007s) {
List<Long> ids = ObjectUtils.listEpKey(fXs007s, HGXS007.FIELD_ID);
// 锁
HGXSTools.HgXs007.lock(ids);
// 查询数据
return HGXSTools.HgXs007.map(ids);
}
}
} }
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
<!-- 数据权限 --> <!-- 数据权限 -->
<sqlMap resource="com/baosight/hggp/hg/xs/sql/HGXSDataAuth.xml"/> <sqlMap resource="com/baosight/hggp/hg/xs/sql/HGXSDataAuth.xml"/>
<sqlMap resource="com/baosight/hggp/hg/xs/sql/HGXS007.xml"/>
<!-- 工具 -->
<sqlMap resource="com/baosight/hggp/hg/dm/sql/HGDM099.xml"/>
<!--成本--> <!--成本-->
<sqlMap resource="com/baosight/hggp/hg/cb/sql/HGCB001.xml"/> <sqlMap resource="com/baosight/hggp/hg/cb/sql/HGCB001.xml"/>
......
...@@ -10,11 +10,6 @@ $(function () { ...@@ -10,11 +10,6 @@ $(function () {
} }
}], }],
loadComplete: function (grid) { loadComplete: function (grid) {
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
// 删除
$("#BTN_DELETE").on("click", deleteFunc);
}, },
dataBound: function () { dataBound: function () {
} }
...@@ -22,10 +17,12 @@ $(function () { ...@@ -22,10 +17,12 @@ $(function () {
}; };
$("#ef_form_head").hide(); $("#ef_form_head").hide();
// 查询 // 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
// 删除
$("#REMOVE").on("click", remove);
}); });
/** /**
...@@ -86,7 +83,7 @@ function uploadFileCallback(e) { ...@@ -86,7 +83,7 @@ function uploadFileCallback(e) {
/** /**
* 删除 * 删除
*/ */
function deleteFunc() { function remove() {
var rows = resultGrid.getCheckedRows(); var rows = resultGrid.getCheckedRows();
if (rows.length == 0) { if (rows.length == 0) {
message("请先勾选数据!"); message("请先勾选数据!");
...@@ -94,7 +91,7 @@ function deleteFunc() { ...@@ -94,7 +91,7 @@ function deleteFunc() {
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGDM099", "delete", true); JSUtils.submitGridsData("result", "HGDM099", "remove", true);
} }
}) })
} }
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 20,
pageSizes: [20, 50, 100, 200],
},
columns: [{
field: "operator",
template: function (item) {
let auditStatus = item.folStatus;
let template = '';
if (auditStatus && auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+ 'onclick="modify(' + item.id + ')" >修改</a>&nbsp;&nbsp;';
}
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>';
return template;
}
}],
loadComplete: function (grid) {
},
onSuccess: function (e) {
},
onRowClick: function (e) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 新增
$("#ADD").on("click", add);
// 删除
$("#REMOVE").on("click", remove);
// 审核
$("#CHECK").on("click", check);
// 键盘按键
downKeyUp();
});
/**
* 页面加载完成
*/
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 新增
*/
let add = function () {
addOrUpdate("");
}
/**
* 修改
*/
let modify = function (id) {
let params = "inqu_status-0-id=" + id;
addOrUpdate(params);
}
/**
* 新增
*/
let addOrUpdate = function (params) {
JSColorbox.open({
href: "HGXS007B?" + params,
title: "<div style='text-align: center;'>" + (isBlank(params) ? "新增回访单" : "修改回访单") + "</div>",
width: "60%",
height: "70%",
callbackName: addOrUpdateCallback
});
}
/**
* 新增成功后回调
*/
let addOrUpdateCallback = function (res) {
// 消息
message(res.msg);
// 刷新列表
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 删除
*/
function remove() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGXS007", "remove",
false, function (res) {
message(res.msg);
if (res.status > -1) {
resultGrid.dataSource.page(1);
}
}
);
}
})
}
/**
* 审核
*
* @param id
* @param auditStatus
*/
function check(id) {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGXS007", "check",
false, function (res) {
message(res.msg);
if (res.status > -1) {
resultGrid.dataSource.page(1);
}
}
);
}
})
}
/**
* 附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HGXS007A?inqu_status-0-bizId=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ 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="查询条件">
<div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDatePicker cname="回访日期" ename="folDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect cname="回访方式" ename="folType" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.xs.folType"/>
</EF:EFSelect>
<EF:EFSelect cname="回访状态" ename="folStatus" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.xs.folStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="id" cname="回访单ID" enable="false" width="80" align="center"/>
<EF:EFColumn ename="folDate" cname="回访日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="companyCode" cname="公司编码" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="220" align="left"/>
<EF:EFComboColumn ename="folType" cname="回访方式" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.xs.folType"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="folStatus" cname="回访状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.xs.folStatus"/>
</EF:EFComboColumn>
<EF:EFColumn cname="创建人" ename="createdName" enable="false" width="100" align="center"/>
<EF:EFColumn cname="创建时间" ename="createdTime" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn cname="修改人" ename="updatedName" enable="false" width="100" align="center"/>
<EF:EFColumn cname="修改时间" ename="updatedTime" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFSelect = {
"inqu_status-0-bizType": {
change: function (e) {
query();
}
}
}
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;
}
}],
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
// 删除
$("#REMOVE").on("click", remove);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
// 隐藏按钮
showButton();
});
/**
* 查询
*/
let query = function (e) {
resultGrid.dataSource.page(1);
}
/**
* 显示按钮
*/
let showButton = function () {
var folStatus = $("#detail-0-folStatus").val();
//如果提交了,则不能修改
if (folStatus && folStatus === "0") {
$('#UPLOAD_FILE').show();
$('#REMOVE').show();
} else {
$('#UPLOAD_FILE').hide();
$('#REMOVE').hide();
}
}
/**
* 文件上传
*
* @param id
*/
function uploadFile() {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-id", $("#inqu_status-0-bizId").val());
EiCommunicator.send('HGXS007', 'checkStatus', inInfo, {
onSuccess(res) {
if (res.status !== -1) {
JSColorbox.open({
href: "HGDM099A?methodName=initLoad",
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
} else {
message(res.msg);
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(e) {
let inInfo = new EiInfo();
inInfo.set("result-0-bizId", $("#inqu_status-0-bizId").val());
inInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val());
inInfo.set("result-0-docId", e.response.docId);
inInfo.set("result-0-docName", e.response.docName);
EiCommunicator.send('HGDM099', 'upload', inInfo, {
onSuccess(res) {
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
* 删除
*/
function remove() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGXS007A", "remove", 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="id" blockId="detail" row="0" type="hidden"/>
<EF:EFInput cname="回访单状态" ename="folStatus" blockId="detail" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="回访单ID" ename="bizId" blockId="inqu_status" row="0" readonly="true"/>
<EF:EFSelect cname="业务类型" ename="bizType" blockId="inqu_status" row="0" colWidth="3" required="true">
<EF:EFOption label="体验调查" value="HGXS007_TY"/>
<EF:EFOption label="满意度调查" value="HGXS007_MY"/>
</EF:EFSelect>
<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.EFSelect = {
"result-0-companyCode": {
select: function (e) { //获取勾选值
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
var textField = dataItem['textField'];
if (valueField) {
textField = textField.indexOf("-") > -1 ? textField.split("-")[1] : textField;
$("#result-0-companyName").val(textField);
} else {
$("#result-0-companyName").val("");
}
}
}
}
IPLATUI.EFGrid = {
"result": {
pageable: false,
exportGrid: false,
toolbarConfig: {
hidden: false,
},
columns: [],
loadComplete: function (grid) {
},
onSuccess: function (e) {
}
}
};
// 确认
$('#SAVE').on('click', save);
// 键盘按键
downKeyUp();
})
/**
* 保存
*/
let save = function () {
let companyCode = $("#result-0-companyCode").val();
if (isBlank(companyCode)) {
message("企业名称不能为空");
return;
}
let folDate = $("#result-0-folDate").val();
if (isBlank(folDate)) {
message("回访日期不能为空");
return;
}
let folType = $("#result-0-folType").val();
if (isBlank(folType)) {
message("回访方式不能为空");
return;
}
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("", "HGXS007B", "save", true, function (res) {
if (res.status > -1) {
parent.JSColorbox.setValueCallback(res);
} else {
message(res.msg);
}
});
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="回访单详情">
<EF:EFRegion id="result" title="数据区域">
<div class="row">
<EF:EFInput cname="ID" blockId="result" ename="id" row="0" colWidth="6" ratio="2:10" required="true"
readonly="true"/>
</div>
<div class="row">
<EF:EFSelect cname="公司" blockId="result" ename="companyCode" row="0" colWidth="6" ratio="2:10"
filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="公司名称" blockId="result" ename="companyName" row="0" colWidth="6" ratio="2:10"
type="hidden"/>
</div>
<div class="row">
<EF:EFDatePicker cname="回访日期" ename="folDate" blockId="result" row="0" colWidth="3" ratio="2:10"
format="yyyy-MM-dd" readonly="true"/>
</div>
<div class="row">
<EF:EFSelect cname="回访方式" ename="folType" blockId="result" row="0" colWidth="3" ratio="2:10"
filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFCodeOption codeName="hggp.xs.folType"/>
</EF:EFSelect>
</div>
<br/>
<span style="color: red; ">说明:ID由系统自动生成</span><br>
</EF:EFRegion>
</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