Commit 16fc0eac by 宋祥

Merge branch 'dev-sx' of http://129.211.46.84:8800/platform/hp-smart into dev

parents 0de4ee7c 76ab87da
......@@ -105,6 +105,10 @@ public class HPConstant {
public static final String FOL_NO = "FOL_NO";
// 投诉单号
public static final String COMPLAINT_NO = "COMPLAINT_NO";
// 建议单号
public static final String SUGGEST_NO = "SUGGEST_NO";
// 公告号
public static final String NOTICE_NO = "NOTICE_NO";
}
/**
......@@ -150,4 +154,19 @@ public class HPConstant {
// 已处理
public static final Integer S1 = 1;
}
/**
* 提交状态
*
* @author:songx
* @date:2024/2/22,13:57
*/
public static class submitStatus {
// 未提交
public static final Integer S0 = 0;
// 已提交
public static final Integer S1 = 1;
}
}
......@@ -4,7 +4,7 @@ package com.baosight.hpjx.hp.fw.constant;
* @author:songx
* @date:2024/9/24,17:53
*/
public class HpFwConstant {
public class HpFwConst {
/**
* HPFW001 定义
......
......@@ -4,7 +4,7 @@ package com.baosight.hpjx.hp.fw.constant;
* @author:songx
* @date:2024/9/24,18:09
*/
public class HpFwSqlConstant {
public class HpFwSqlConst {
/**
* @author:songx
......@@ -46,6 +46,18 @@ public class HpFwSqlConstant {
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HpFw004 {
// 锁
public static final String LOCK = "HPFW004.lock";
// 修改
public static final String UPDATE_DEAL = "HPFW004.updateDeal";
}
/**
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HpFw007 {
// 锁
......
......@@ -5,7 +5,7 @@ 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.fw.constant.HpFwSqlConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConst;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
......@@ -184,7 +184,7 @@ public class ServiceHPFW001 extends ServiceBase {
fFw001.setStatus(HPConstant.dealStatus.S1);
fFw001.setDealUserId(UserSessionUtils.getLoginName());
fFw001.setDealUserName(UserSessionUtils.getLoginCName());
DaoUtils.update(HpFwSqlConstant.HpFw001.UPDATE_DEAL, fFw001.toMap());
DaoUtils.update(HpFwSqlConst.HpFw001.UPDATE_DEAL, fFw001.toMap());
}
}
......
......@@ -5,7 +5,6 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.utils.Iplat4jUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.dm.domain.HPDM099;
import com.baosight.hpjx.hp.fw.constant.HpFwConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
......
......@@ -5,7 +5,7 @@ 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.fw.constant.HpFwSqlConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConst;
import com.baosight.hpjx.hp.fw.domain.HPFW002;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
......@@ -184,7 +184,7 @@ public class ServiceHPFW002 extends ServiceBase {
fFw002.setDealUserId(UserSessionUtils.getLoginName());
fFw002.setDealUserName(UserSessionUtils.getLoginCName());
fFw002.setDealContent(content);
DaoUtils.update(HpFwSqlConstant.HpFw002.UPDATE_DEAL, fFw002.toMap());
DaoUtils.update(HpFwSqlConst.HpFw002.UPDATE_DEAL, fFw002.toMap());
}
}
......
......@@ -4,7 +4,7 @@ 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.fw.constant.HpFwSqlConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConst;
import com.baosight.hpjx.hp.fw.domain.HPFW003;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
......@@ -180,7 +180,7 @@ public class ServiceHPFW003 extends ServiceBase {
fFw003.setDealUserId(UserSessionUtils.getLoginName());
fFw003.setDealUserName(UserSessionUtils.getLoginCName());
fFw003.setDealContent(content);
DaoUtils.update(HpFwSqlConstant.HpFw003.UPDATE_DEAL, fFw003.toMap());
DaoUtils.update(HpFwSqlConst.HpFw003.UPDATE_DEAL, fFw003.toMap());
}
}
......
......@@ -120,14 +120,14 @@ public class ServiceHPFW003B extends ServiceEPBase {
* 数据校验
*
* @param fFw003
* @param dbFw002
* @param dbFw003
*/
private void checkData(HPFW003 fFw003, HPFW003 dbFw002) {
private void checkData(HPFW003 fFw003, HPFW003 dbFw003) {
String complaintNo = fFw003.getComplaintNo();
AssertUtils.isNull(dbFw002, String.format("投诉单【%s】不存在", complaintNo));
AssertUtils.isNotEquals(dbFw002.getDeleteFlag(), CommonConstant.YesNo.NO_0,
AssertUtils.isNull(dbFw003, String.format("投诉单【%s】不存在", complaintNo));
AssertUtils.isNotEquals(dbFw003.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("投诉单【%s】不是\"未删除\"状态,不允许操作", complaintNo));
AssertUtils.isNotEquals(dbFw002.getStatus(), HPConstant.dealStatus.S0,
AssertUtils.isNotEquals(dbFw003.getStatus(), HPConstant.dealStatus.S0,
String.format("投诉单【%s】不是\"未处理\"状态,不允许操作", complaintNo));
}
......
package com.baosight.hpjx.hp.fw.service;
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.fw.constant.HpFwSqlConst;
import com.baosight.hpjx.hp.fw.domain.HPFW004;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.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.List;
import java.util.Map;
/**
* 客户建议
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHPFW004 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPFW004().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HPFW004.FIELD_SUGGEST_DATE,
DateUtils.formatShort(queryMap.get(HPFW004.FIELD_SUGGEST_DATE)));
inInfo = super.query(inInfo, HPFW004.QUERY, new HPFW004());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
List<HPFW004> fFw004s = MapUtils.toDaoEPBases(inInfo, HPFW004.class);
// db数据
Map<String, HPFW004> dbFw004Map = HpFwUtils.HpFw004.lockAndGet(fFw004s);
// 数据校验
this.checkRemoveData(fFw004s, dbFw004Map);
// 保存数据
this.removeData(fFw004s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw004s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw004s
* @param dbFw004Map
*/
private void checkRemoveData(List<HPFW004> fFw004s, Map<String, HPFW004> dbFw004Map) {
for (HPFW004 fFw004 : fFw004s) {
String suggestNo = fFw004.getSuggestNo();
HPFW004 dbFw004 = dbFw004Map.get(suggestNo);
this.checkData(suggestNo, dbFw004);
}
}
/**
* 数据保存
*
* @param fFw004s
*/
private void removeData(List<HPFW004> fFw004s) {
for (HPFW004 fFw004 : fFw004s) {
fFw004.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPFW004.DELETE, fFw004.toMap());
}
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String suggestNo = MapUtils.getString(queryMap, HPFW004.FIELD_SUGGEST_NO);
HPFW004 dbFw004 = HpFwUtils.HpFw004.lockAndGet(suggestNo);
this.checkData(suggestNo, dbFw004);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 处理
*
* @param inInfo
* @return
*/
public EiInfo deal(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String content = MapUtils.getString(queryMap, "content");
List<HPFW004> fFw004s = MapUtils.toDaoEPBases(inInfo, HPFW004.class);
// db数据
Map<String, HPFW004> dbFw004Map = HpFwUtils.HpFw004.lockAndGet(fFw004s);
// 数据校验
this.checkDealData(fFw004s, dbFw004Map);
// 保存数据
this.dealData(fFw004s, content);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw004s.size() + "]条数据处理成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw004s
* @param dbFw004Map
*/
private void checkDealData(List<HPFW004> fFw004s, Map<String, HPFW004> dbFw004Map) {
for (HPFW004 fFw004 : fFw004s) {
String suggestNo = fFw004.getSuggestNo();
HPFW004 dbFw004 = dbFw004Map.get(suggestNo);
this.checkData(suggestNo, dbFw004);
}
}
/**
* 数据保存
*
* @param fFw004s
* @param content
*/
private void dealData(List<HPFW004> fFw004s, String content) {
for (HPFW004 fFw004 : fFw004s) {
fFw004.setStatus(HPConstant.dealStatus.S1);
fFw004.setDealUserId(UserSessionUtils.getLoginName());
fFw004.setDealUserName(UserSessionUtils.getLoginCName());
fFw004.setDealContent(content);
DaoUtils.update(HpFwSqlConst.HpFw004.UPDATE_DEAL, fFw004.toMap());
}
}
/**
* 数据校验
*
* @param suggestNo
* @param dbFw004
*/
private void checkData(String suggestNo, HPFW004 dbFw004) {
AssertUtils.isNull(dbFw004, String.format("建议单[%s]不存在", suggestNo));
AssertUtils.isNotEquals(dbFw004.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("建议单【%s】不是\"未删除\"状态,不允许操作", suggestNo));
AssertUtils.isNotEquals(dbFw004.getStatus(), HPConstant.dealStatus.S0,
String.format("建议单【%s】不是\"待处理\"状态,不允许操作", suggestNo));
}
}
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.utils.Iplat4jUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.dm.domain.HPDM099;
import com.baosight.hpjx.hp.fw.domain.HPFW004;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.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.List;
import java.util.Map;
/**
* 附件清单
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHPFW004A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPDM099.QUERY, new HPDM099());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryMap, HPDM099.FIELD_BIZ_ID);
HPFW004 dbFw004 = HpFwUtils.HpFw004.lockAndGet(bizId);
this.checkData(bizId, dbFw004);
List<HPDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HPDM099.class);
for (HPDM099 fDm099 : fDm099s) {
DaoUtils.update(HPDM099.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 complaintNo
* @param dbFw004
*/
private void checkData(String complaintNo, HPFW004 dbFw004) {
AssertUtils.isNull(dbFw004, String.format("建议单[%s]不存在", complaintNo));
AssertUtils.isNotEquals(dbFw004.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("建议单【%s】不是\"未删除\"状态,不允许操作", complaintNo));
AssertUtils.isNotEquals(dbFw004.getStatus(), HPConstant.dealStatus.S0,
String.format("建议单【%s】不是\"未处理\"状态,不允许操作", complaintNo));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HPDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HpFwTools.HpFw004.get(bizId));
block.addBlockMeta(new HPFW004().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW004;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.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 ServiceHPFW004B extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), null);
this.setBaseInfo(inInfo);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
public EiInfo save(EiInfo inInfo) {
try {
HPFW004 fFw004 = MapUtils.toDaoEPBase(inInfo, HPFW004.class);
fFw004.setSuggestDate(DateUtils.formatShort(fFw004.getSuggestDate()));
if (StringUtils.isBlank(fFw004.getSuggestNo())) {
this.add(fFw004);
} else {
this.modify(fFw004);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fFw004
*/
private void add(HPFW004 fFw004) {
fFw004.setSuggestNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.SUGGEST_NO));
fFw004.setStatus(HPConstant.dealStatus.S0);
fFw004.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPFW004.INSERT, fFw004);
}
/**
* 修改数据
*
* @param fFw004
*/
private void modify(HPFW004 fFw004) {
HPFW004 dbFw004 = HpFwUtils.HpFw004.lockAndGet(fFw004);
this.checkData(fFw004, dbFw004);
DaoUtils.update(HPFW004.UPDATE, fFw004);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String suggestNo = MapUtils.getString(queryRow, HPFW004.FIELD_SUGGEST_NO);
if (StringUtils.isBlank(suggestNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HpFwTools.HpFw004.get(suggestNo));
resultBlock.addBlockMeta(new HPFW004().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fFw004
* @param dbFw004
*/
private void checkData(HPFW004 fFw004, HPFW004 dbFw004) {
String suggestNo = fFw004.getSuggestNo();
AssertUtils.isNull(dbFw004, String.format("建议单【%s】不存在", suggestNo));
AssertUtils.isNotEquals(dbFw004.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("建议单【%s】不是\"未删除\"状态,不允许操作", suggestNo));
AssertUtils.isNotEquals(dbFw004.getStatus(), HPConstant.dealStatus.S0,
String.format("建议单【%s】不是\"未处理\"状态,不允许操作", suggestNo));
}
}
......@@ -5,7 +5,7 @@ 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.fw.constant.HpFwSqlConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConst;
import com.baosight.hpjx.hp.fw.domain.HPFW007;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
......@@ -183,7 +183,7 @@ public class ServiceHPFW007 extends ServiceBase {
fFw007.setDealUserId(UserSessionUtils.getLoginName());
fFw007.setDealUserName(UserSessionUtils.getLoginCName());
fFw007.setDealContent(content);
DaoUtils.update(HpFwSqlConstant.HpFw007.UPDATE_DEAL, fFw007.toMap());
DaoUtils.update(HpFwSqlConst.HpFw007.UPDATE_DEAL, fFw007.toMap());
}
}
......
......@@ -66,7 +66,7 @@
CUSTOM_ID = #customId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="customName">
CUSTOM_NAME = #customName#
CUSTOM_NAME LIKE CONCAT('%', #customName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="suggestWay">
SUGGEST_WAY = #suggestWay#
......@@ -139,48 +139,37 @@
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
COMPLAINT_DATE, <!-- 投诉日期 -->
COMPLAINT_NO, <!-- 投诉单号 -->
STATUS, <!-- 状态 -->
SUGGEST_DATE, <!-- 建议日期 -->
SUGGEST_NO, <!-- 建议单号 -->
CUSTOM_ID, <!-- 客户ID -->
CUSTOM_NAME, <!-- 客户名称 -->
COMPLAINT_WAY, <!-- 投诉方式 -->
COMPLAINT_TYPE, <!-- 投诉类型 -->
COMPLAINT_CONTENT, <!-- 投诉内容 -->
COMPLAINT_USER_ID, <!-- 被投诉人ID -->
COMPLAINT_USER_NAME, <!-- 被投诉人名称 -->
ACCEPT_USER_ID, <!-- 受理人ID -->
ACCEPT_USER_NAME, <!-- 受理人名称 -->
LAST_DATE, <!-- 最后期限 -->
SUGGEST_WAY, <!-- 建议方式 -->
SUGGEST_TYPE, <!-- 建议类型 -->
SUGGEST_CONTENT, <!-- 建议内容 -->
DEAL_CONTENT, <!-- 处理结果 -->
DEAL_USER_ID, <!-- 处理人ID -->
DEAL_USER_NAME <!-- 处理人名称 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #complaintDate#, #complaintNo#, #status#,
#customId#, #customName#, #complaintWay#, #complaintType#, #complaintContent#,
#complaintUserId#, #complaintUserName#, #acceptUserId#, #acceptUserName#,
#lastDate#, #dealContent#, #dealUserId#, #dealUserName#)
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #status#, #suggestDate#, #suggestNo#, #customId#, #customName#,
#suggestWay#, #suggestType#, #suggestContent#, #dealContent#, #dealUserId#, #dealUserName#
)
</insert>
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPFW004 SET DELETE_FLAG = 1 WHERE COMPLAINT_NO = #complaintNo#
UPDATE ${hpjxSchema}.T_HPFW004 SET DELETE_FLAG = 1 WHERE SUGGEST_NO = #suggestNo#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPFW004
SET
COMPLAINT_DATE = #complaintDate#, <!-- 投诉日期 -->
SUGGEST_DATE = #suggestDate#, <!-- 建议日期 -->
CUSTOM_ID = #customId#, <!-- 客户ID -->
CUSTOM_NAME = #customName#, <!-- 客户名称 -->
COMPLAINT_WAY = #complaintWay#, <!-- 投诉方式 -->
COMPLAINT_TYPE = #complaintType#, <!-- 投诉类型 -->
COMPLAINT_CONTENT = #complaintContent#, <!-- 投诉内容 -->
COMPLAINT_USER_ID = #complaintUserId#, <!-- 被投诉人ID -->
COMPLAINT_USER_NAME = #complaintUserName#, <!-- 被投诉人名称 -->
ACCEPT_USER_ID = #acceptUserId#, <!-- 受理人ID -->
ACCEPT_USER_NAME = #acceptUserName#, <!-- 受理人名称 -->
LAST_DATE = #lastDate#, <!-- 最后期限 -->
SUGGEST_WAY = #suggestWay#, <!-- 建议方式 -->
SUGGEST_TYPE = #suggestType#, <!-- 建议类型 -->
SUGGEST_CONTENT = #suggestContent#, <!-- 建议内容 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
......@@ -202,7 +191,7 @@
DEAL_USER_NAME = #dealUserName#, <!-- 处理人名称 -->
DEAL_CONTENT = #dealContent#, <!-- 处理内容 -->
<include refid="SqlBase.updateRevise"/>
WHERE COMPLAINT_NO = #complaintNo#
WHERE SUGGEST_NO = #suggestNo#
</update>
</sqlMap>
package com.baosight.hpjx.hp.fw.tools;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConst;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.domain.HPFW002;
import com.baosight.hpjx.hp.fw.domain.HPFW003;
import com.baosight.hpjx.hp.fw.domain.HPFW004;
import com.baosight.hpjx.hp.fw.domain.HPFW007;
import com.baosight.hpjx.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
......@@ -35,7 +36,7 @@ public class HpFwTools {
AssertUtils.isEmpty(afterSaleNo, "售后单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW001.FIELD_AFTER_SALE_NO, afterSaleNo);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw001.LOCK, paramMap);
DaoBase.getInstance().update(HpFwSqlConst.HpFw001.LOCK, paramMap);
}
/**
......@@ -47,7 +48,7 @@ public class HpFwTools {
AssertUtils.isEmpty(afterSaleNos, "售后单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("afterSaleNos", afterSaleNos);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw001.LOCK, paramMap);
DaoBase.getInstance().update(HpFwSqlConst.HpFw001.LOCK, paramMap);
}
/**
......@@ -105,7 +106,7 @@ public class HpFwTools {
AssertUtils.isEmpty(careNo, "关怀单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW002.FIELD_CARE_NO, careNo);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw002.LOCK, paramMap);
DaoBase.getInstance().update(HpFwSqlConst.HpFw002.LOCK, paramMap);
}
/**
......@@ -117,7 +118,7 @@ public class HpFwTools {
AssertUtils.isEmpty(careNos, "关怀单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("careNos", careNos);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw002.LOCK, paramMap);
DaoBase.getInstance().update(HpFwSqlConst.HpFw002.LOCK, paramMap);
}
/**
......@@ -175,7 +176,7 @@ public class HpFwTools {
AssertUtils.isEmpty(complaintNo, "投诉单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW003.FIELD_COMPLAINT_NO, complaintNo);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw003.LOCK, paramMap);
DaoBase.getInstance().update(HpFwSqlConst.HpFw003.LOCK, paramMap);
}
/**
......@@ -187,7 +188,7 @@ public class HpFwTools {
AssertUtils.isEmpty(complaintNos, "投诉单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("complaintNos", complaintNos);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw003.LOCK, paramMap);
DaoBase.getInstance().update(HpFwSqlConst.HpFw003.LOCK, paramMap);
}
/**
......@@ -234,6 +235,76 @@ public class HpFwTools {
* @author:songx
* @date:2024/9/24,18:08
*/
public static class HpFw004 {
/**
* 锁.
*
* @param suggestNo
*/
public static void lock(String suggestNo) {
AssertUtils.isEmpty(suggestNo, "建议单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW004.FIELD_SUGGEST_NO, suggestNo);
DaoBase.getInstance().update(HpFwSqlConst.HpFw004.LOCK, paramMap);
}
/**
* 锁.
*
* @param suggestNos
*/
public static void lock(List<String> suggestNos) {
AssertUtils.isEmpty(suggestNos, "建议号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("suggestNos", suggestNos);
DaoBase.getInstance().update(HpFwSqlConst.HpFw004.LOCK, paramMap);
}
/**
* 查询
*
* @param suggestNo
* @return
*/
public static HPFW004 get(String suggestNo) {
AssertUtils.isEmpty(suggestNo, "建议单号不能为空!");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HPFW004.FIELD_SUGGEST_NO, suggestNo);
List<HPFW004> results = DaoBase.getInstance().query(HPFW004.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param suggestNos
* @return
*/
public static List<HPFW004> list(List<String> suggestNos) {
AssertUtils.isEmpty(suggestNos, "建议单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("suggestNos", suggestNos);
return DaoBase.getInstance().query(HPFW004.QUERY, paramMap);
}
/**
* 查询
*
* @param suggestNos
* @return
*/
public static Map<String, HPFW004> map(List<String> suggestNos) {
List<HPFW004> results = list(suggestNos);
return results.stream().collect(Collectors.toMap(HPFW004::getSuggestNo, item -> item));
}
}
/**
* @author:songx
* @date:2024/9/24,18:08
*/
public static class HpFw007 {
/**
......@@ -245,7 +316,7 @@ public class HpFwTools {
AssertUtils.isEmpty(folNo, "关怀单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW007.FIELD_FOL_NO, folNo);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw007.LOCK, paramMap);
DaoBase.getInstance().update(HpFwSqlConst.HpFw007.LOCK, paramMap);
}
/**
......@@ -257,7 +328,7 @@ public class HpFwTools {
AssertUtils.isEmpty(folNos, "回访单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("folNos", folNos);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw007.LOCK, paramMap);
DaoBase.getInstance().update(HpFwSqlConst.HpFw007.LOCK, paramMap);
}
/**
......
......@@ -3,6 +3,7 @@ package com.baosight.hpjx.hp.fw.utils;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.domain.HPFW002;
import com.baosight.hpjx.hp.fw.domain.HPFW003;
import com.baosight.hpjx.hp.fw.domain.HPFW004;
import com.baosight.hpjx.hp.fw.domain.HPFW007;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.util.ObjectUtils;
......@@ -137,14 +138,58 @@ public class HpFwUtils {
/**
* 锁并获取数据
*
* @param complaintNos
* @param complaintNo
* @return
*/
public static HPFW003 lockAndGet(String complaintNos) {
public static HPFW003 lockAndGet(String complaintNo) {
// 锁
HpFwTools.HpFw003.lock(complaintNos);
HpFwTools.HpFw003.lock(complaintNo);
// 查询数据
return HpFwTools.HpFw003.get(complaintNo);
}
}
/**
* @author:songx
* @date:2024/9/24,18:07
*/
public static class HpFw004 {
/**
* 锁并获取数据
*
* @param fFw004s
* @return
*/
public static Map<String, HPFW004> lockAndGet(List<HPFW004> fFw004s) {
List<String> suggests = ObjectUtils.listEpKey(fFw004s, HPFW004.FIELD_SUGGEST_NO);
// 锁
HpFwTools.HpFw004.lock(suggests);
// 查询数据
return HpFwTools.HpFw004.map(suggests);
}
/**
* 锁并获取数据
*
* @param fFw004
* @return
*/
public static HPFW004 lockAndGet(HPFW004 fFw004) {
return lockAndGet(fFw004.getSuggestNo());
}
/**
* 锁并获取数据
*
* @param suggestNo
* @return
*/
public static HPFW004 lockAndGet(String suggestNo) {
// 锁
HpFwTools.HpFw004.lock(suggestNo);
// 查询数据
return HpFwTools.HpFw003.get(complaintNos);
return HpFwTools.HpFw004.get(suggestNo);
}
}
......
package com.baosight.hpjx.hp.xt.constant;
/**
* @author:songx
* @date:2024/9/24,17:53
*/
public class HpXtConst {
/**
* HPFW001 定义
*
* @author:songx
* @date:2024/9/24,17:54
*/
public static class HpFw001 {
}
/**
* HPFW001 定义
*
* @author:songx
* @date:2024/9/24,17:54
*/
public static class HpFw002 {
}
}
package com.baosight.hpjx.hp.xt.constant;
/**
* @author:songx
* @date:2024/9/24,18:09
*/
public class HpXtSqlConst {
/**
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HpXt011 {
// 锁
public static final String LOCK = "HPXT011.lock";
// 发布
public static final String UPDATE_SUBMIT = "HPXT011.updateSubmit";
}
}
package com.baosight.hpjx.hp.xt.service;
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.xt.constant.HpXtSqlConst;
import com.baosight.hpjx.hp.xt.domain.HPXT011;
import com.baosight.hpjx.hp.xt.utils.HpXtUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.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.List;
import java.util.Map;
/**
* 公告管理
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHPXT011 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPXT011().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HPXT011.FIELD_NOTICE_DATE, DateUtils.formatShort(queryMap.get(HPXT011.FIELD_NOTICE_DATE)));
inInfo = super.query(inInfo, HPXT011.QUERY, new HPXT011());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
List<HPXT011> fXt011s = MapUtils.toDaoEPBases(inInfo, HPXT011.class);
// db数据
Map<String, HPXT011> dbXt011Map = HpXtUtils.HpXt011.lockAndGet(fXt011s);
// 数据校验
this.checkRemoveData(fXt011s, dbXt011Map);
// 保存数据
this.removeData(fXt011s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fXt011s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fXt011s
* @param dbXt011Map
*/
private void checkRemoveData(List<HPXT011> fXt011s, Map<String, HPXT011> dbXt011Map) {
for (HPXT011 fXt011 : fXt011s) {
String noticeNo = fXt011.getNoticeNo();
HPXT011 dbXt011 = dbXt011Map.get(noticeNo);
this.checkData(noticeNo, dbXt011);
}
}
/**
* 数据保存
*
* @param fXt011s
*/
private void removeData(List<HPXT011> fXt011s) {
for (HPXT011 fXt011 : fXt011s) {
fXt011.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPXT011.DELETE, fXt011.toMap());
}
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String noticeNo = MapUtils.getString(queryMap, HPXT011.FIELD_NOTICE_NO);
HPXT011 dbXt011 = HpXtUtils.HpXt011.lockAndGet(noticeNo);
this.checkData(noticeNo, dbXt011);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 提交
*
* @param inInfo
* @return
*/
public EiInfo submit(EiInfo inInfo) {
try {
List<HPXT011> fXt011s = MapUtils.toDaoEPBases(inInfo, HPXT011.class);
// db数据
Map<String, HPXT011> dbXt011Map = HpXtUtils.HpXt011.lockAndGet(fXt011s);
// 数据校验
this.checkSubmitData(fXt011s, dbXt011Map);
// 保存数据
this.submitData(fXt011s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fXt011s.size() + "]条数据提交成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fXt011s
* @param dbXt011Map
*/
private void checkSubmitData(List<HPXT011> fXt011s, Map<String, HPXT011> dbXt011Map) {
for (HPXT011 fXt011 : fXt011s) {
String noticeNo = fXt011.getNoticeNo();
HPXT011 dbXt011 = dbXt011Map.get(noticeNo);
this.checkData(noticeNo, dbXt011);
}
}
/**
* 数据保存
*
* @param fXt011s
*/
private void submitData(List<HPXT011> fXt011s) {
for (HPXT011 fXt011 : fXt011s) {
fXt011.setStatus(HPConstant.submitStatus.S1);
fXt011.setSubmitUserId(UserSessionUtils.getLoginName());
fXt011.setSubmitUserName(UserSessionUtils.getLoginCName());
fXt011.setSubmitTime(DateUtils.shortDateTime());
DaoUtils.update(HpXtSqlConst.HpXt011.UPDATE_SUBMIT, fXt011.toMap());
}
}
/**
* 数据校验
*
* @param noticeNo
* @param dbXt011
*/
private void checkData(String noticeNo, HPXT011 dbXt011) {
AssertUtils.isNull(dbXt011, String.format("公告[%s]不存在", noticeNo));
AssertUtils.isNotEquals(dbXt011.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("公告【%s】不是\"未删除\"状态,不允许操作", noticeNo));
AssertUtils.isNotEquals(dbXt011.getStatus(), HPConstant.dealStatus.S0,
String.format("公告【%s】不是\"未提交\"状态,不允许操作", noticeNo));
}
}
package com.baosight.hpjx.hp.xt.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.utils.Iplat4jUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.dm.domain.HPDM099;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.xt.domain.HPXT011;
import com.baosight.hpjx.hp.xt.tools.HpXtTools;
import com.baosight.hpjx.hp.xt.utils.HpXtUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.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.List;
import java.util.Map;
/**
* 附件清单
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHPXT011A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPDM099.QUERY, new HPDM099());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryMap, HPDM099.FIELD_BIZ_ID);
HPXT011 dbXt001 = HpXtUtils.HpXt011.lockAndGet(bizId);
this.checkData(bizId, dbXt001);
List<HPDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HPDM099.class);
for (HPDM099 fDm099 : fDm099s) {
DaoUtils.update(HPDM099.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 noticeNo
* @param dbXt001
*/
private void checkData(String noticeNo, HPXT011 dbXt001) {
AssertUtils.isNull(dbXt001, String.format("公告[%s]不存在", noticeNo));
AssertUtils.isNotEquals(dbXt001.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("公告【%s】不是\"未删除\"状态,不允许操作", noticeNo));
AssertUtils.isNotEquals(dbXt001.getStatus(), HPConstant.dealStatus.S0,
String.format("公告【%s】不是\"未提交\"状态,不允许操作", noticeNo));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HPDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HpXtTools.HpXt011.get(bizId));
block.addBlockMeta(new HPFW001().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hpjx.hp.xt.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.xt.domain.HPXT011;
import com.baosight.hpjx.hp.xt.tools.HpXtTools;
import com.baosight.hpjx.hp.xt.utils.HpXtUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.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 ServiceHPXT011B extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), null);
this.setBaseInfo(inInfo);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
public EiInfo save(EiInfo inInfo) {
try {
HPXT011 fXt001 = MapUtils.toDaoEPBase(inInfo, HPXT011.class);
fXt001.setNoticeDate(DateUtils.formatShort(fXt001.getNoticeDate()));
fXt001.setExpireDate(DateUtils.formatShort(fXt001.getExpireDate()));
if (StringUtils.isBlank(fXt001.getNoticeNo())) {
this.add(fXt001);
} else {
this.modify(fXt001);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fXt001
*/
private void add(HPXT011 fXt001) {
fXt001.setNoticeNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.NOTICE_NO));
fXt001.setStatus(HPConstant.submitStatus.S0);
fXt001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPXT011.INSERT, fXt001);
}
/**
* 修改数据
*
* @param fXt001
*/
private void modify(HPXT011 fXt001) {
HPXT011 dbXt001 = HpXtUtils.HpXt011.lockAndGet(fXt001);
this.checkData(fXt001, dbXt001);
DaoUtils.update(HPXT011.UPDATE, fXt001);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String noticeNo = MapUtils.getString(queryRow, HPXT011.FIELD_NOTICE_NO);
if (StringUtils.isBlank(noticeNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HpXtTools.HpXt011.get(noticeNo));
resultBlock.addBlockMeta(new HPXT011().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fXt001
* @param dbXt001
*/
private void checkData(HPXT011 fXt001, HPXT011 dbXt001) {
String noticeNo = fXt001.getNoticeNo();
AssertUtils.isNull(dbXt001, String.format("公告【%s】不存在", noticeNo));
AssertUtils.isNotEquals(dbXt001.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("公告【%s】不是\"未删除\"状态,不允许操作", noticeNo));
AssertUtils.isNotEquals(dbXt001.getStatus(), HPConstant.dealStatus.S0,
String.format("公告【%s】不是\"未提交\"状态,不允许操作", noticeNo));
}
}
<?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="HPXT011">
<sql id="column">
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
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-是 -->
STATUS as "status", <!-- 状态 -->
NOTICE_DATE as "noticeDate", <!-- 公告日期 -->
NOTICE_NO as "noticeNo", <!-- 公告号 -->
NOTICE_TYPE as "noticeType", <!-- 公告类型 -->
NOTICE_TITLE as "noticeTitle", <!-- 公告主题 -->
NOTICE_CONTENT as "noticeContent", <!-- 公告内容 -->
EXPIRE_DATE as "expireDate", <!-- 公告有效期 -->
SUBMIT_USER_ID as "submitUserId", <!-- 发布人ID -->
SUBMIT_USER_NAME as "submitUserName", <!-- 发布人名称 -->
SUBMIT_TIME as "submitTime" <!-- 发布时间 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<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="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="noticeDate">
NOTICE_DATE = #noticeDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="noticeType">
NOTICE_TYPE = #noticeType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="noticeTitle">
NOTICE_TITLE = #noticeTitle#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="noticeContent">
NOTICE_CONTENT = #noticeContent#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="expireDate">
EXPIRE_DATE = #expireDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitUserId">
SUBMIT_USER_ID = #submitUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitUserName">
SUBMIT_USER_NAME LIKE CONCAT('%', #submitUserName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitTime">
SUBMIT_TIME = #submitTime#
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="noticeNo">
NOTICE_NO = #noticeNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="noticeNos">
NOTICE_NO IN <iterate close=")" open="(" conjunction="," property="noticeNos">#noticeNos[]#</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.hpjx.hp.xt.domain.HPXT011">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPXT011
WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPXT011 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPXT011 (
COMPANY_CODE, <!-- 公司编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
STATUS, <!-- 状态 -->
NOTICE_DATE, <!-- 公告日期 -->
NOTICE_NO, <!-- 公告号 -->
NOTICE_TYPE, <!-- 公告类型 -->
NOTICE_TITLE, <!-- 公告主题 -->
NOTICE_CONTENT, <!-- 公告内容 -->
EXPIRE_DATE, <!-- 公告有效期 -->
SUBMIT_USER_ID, <!-- 发布人ID -->
SUBMIT_USER_NAME, <!-- 发布人名称 -->
SUBMIT_TIME <!-- 发布时间 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #status#, #noticeDate#, #noticeNo#,
#noticeType#, #noticeTitle#, #noticeContent#, #expireDate#, #submitUserId#,
#submitUserName#, #submitTime#
)
</insert>
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPXT011 SET DELETE_FLAG = 1 WHERE NOTICE_NO = #noticeNo#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPXT011
SET
NOTICE_DATE = #noticeDate#, <!-- 公告日期 -->
NOTICE_TYPE = #noticeType#, <!-- 公告类型 -->
NOTICE_TITLE = #noticeTitle#, <!-- 公告主题 -->
NOTICE_CONTENT = #noticeContent#, <!-- 公告内容 -->
EXPIRE_DATE = #expireDate#, <!-- 公告有效期 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hpjxSchema}.T_HPXT011
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 提交 -->
<update id="updateSubmit">
UPDATE ${hpjxSchema}.T_HPXT011
SET
STATUS = #status#,
SUBMIT_USER_ID = #submitUserId#,
SUBMIT_USER_NAME = #submitUserName#,
SUBMIT_TIME = #submitTime#,
<include refid="SqlBase.updateRevise"/>
WHERE NOTICE_NO = #noticeNo#
</update>
</sqlMap>
package com.baosight.hpjx.hp.xt.tools;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.xt.constant.HpXtSqlConst;
import com.baosight.hpjx.hp.xt.domain.HPXT011;
import com.baosight.hpjx.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:songx
* @date:2024/9/24,18:08
*/
public class HpXtTools {
/**
* @author:songx
* @date:2024/9/24,18:08
*/
public static class HpXt011 {
/**
* 锁.
*
* @param noticeNo
*/
public static void lock(String noticeNo) {
AssertUtils.isEmpty(noticeNo, "公告号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPXT011.FIELD_NOTICE_NO, noticeNo);
DaoBase.getInstance().update(HpXtSqlConst.HpXt011.LOCK, paramMap);
}
/**
* 锁.
*
* @param noticeNos
*/
public static void lock(List<String> noticeNos) {
AssertUtils.isEmpty(noticeNos, "公告号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("noticeNos", noticeNos);
DaoBase.getInstance().update(HpXtSqlConst.HpXt011.LOCK, paramMap);
}
/**
* 查询
*
* @param noticeNo
* @return
*/
public static HPXT011 get(String noticeNo) {
AssertUtils.isEmpty(noticeNo, "公告号不能为空!");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HPXT011.FIELD_NOTICE_NO, noticeNo);
List<HPXT011> results = DaoBase.getInstance().query(HPXT011.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param noticeNos
* @return
*/
public static List<HPXT011> list(List<String> noticeNos) {
AssertUtils.isEmpty(noticeNos, "售后服务单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("noticeNos", noticeNos);
return DaoBase.getInstance().query(HPXT011.QUERY, paramMap);
}
/**
* 查询
*
* @param noticeNos
* @return
*/
public static Map<String, HPXT011> map(List<String> noticeNos) {
List<HPXT011> results = list(noticeNos);
return results.stream().collect(Collectors.toMap(HPXT011::getNoticeNo, item -> item));
}
}
}
package com.baosight.hpjx.hp.xt.utils;
import com.baosight.hpjx.hp.xt.domain.HPXT011;
import com.baosight.hpjx.hp.xt.tools.HpXtTools;
import com.baosight.hpjx.util.ObjectUtils;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/9/24,18:06
*/
public class HpXtUtils {
/**
* @author:songx
* @date:2024/9/24,18:07
*/
public static class HpXt011 {
/**
* 锁并获取数据
*
* @param fXt001s
* @return
*/
public static Map<String, HPXT011> lockAndGet(List<HPXT011> fXt001s) {
List<String> noticeNos = ObjectUtils.listEpKey(fXt001s, HPXT011.FIELD_NOTICE_NO);
// 锁
HpXtTools.HpXt011.lock(noticeNos);
// 查询数据
return HpXtTools.HpXt011.map(noticeNos);
}
/**
* 锁并获取数据
*
* @param fXt001
* @return
*/
public static HPXT011 lockAndGet(HPXT011 fXt001) {
return lockAndGet(fXt001.getNoticeNo());
}
/**
* 锁并获取数据
*
* @param noticeNo
* @return
*/
public static HPXT011 lockAndGet(String noticeNo) {
// 锁
HpXtTools.HpXt011.lock(noticeNo);
// 查询数据
return HpXtTools.HpXt011.get(noticeNo);
}
}
}
......@@ -19,8 +19,12 @@
<sqlMap resource="com/baosight/hpjx/hp/fw/sql/HPFW001.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/fw/sql/HPFW002.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/fw/sql/HPFW003.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/fw/sql/HPFW004.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/fw/sql/HPFW007.xml"/>
<!-- 协同办公 -->
<sqlMap resource="com/baosight/hpjx/hp/xt/sql/HPXT011.xml"/>
<!--财务服务-->
<sqlMap resource="com/baosight/hpjx/hp/cw/sql/HPCW001.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/cw/sql/HPCW002.xml"/>
......
......@@ -6,13 +6,13 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="附件清单">
<EF:EFInput cname="客户关怀ID" ename="id" blockId="detail" row="0" type="hidden"/>
<EF:EFInput cname="客户投诉ID" ename="id" blockId="detail" row="0" type="hidden"/>
<EF:EFInput cname="状态" ename="status" blockId="detail" row="0" type="hidden"/>
<EF:EFRegion id="inqu" title="查询区域" type="query">
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"
value="COMPLAINT"/>
<div class="row">
<EF:EFInput cname="客户关怀单号" ename="bizId" blockId="inqu_status" row="0" readonly="true"/>
<EF:EFInput cname="客户投诉单号" ename="bizId" blockId="inqu_status" row="0" readonly="true"/>
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
......
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 20,
pageSizes: [20, 50, 100, 200],
},
columns: [{
field: "operator",
template: function (item) {
let status = item.status;
let template = '';
if (status && status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+ 'onclick="modify(\'' + item.suggestNo + '\')" >修改</a>&nbsp;&nbsp;';
}
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(\'' + item.suggestNo + '\')" >附件清单</a>';
return template;
}
}],
loadComplete: function (grid) {
},
onRowClick: function (e) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 新增
$("#ADD").on("click", add);
// 删除
$("#REMOVE").on("click", remove);
// 处理
$("#DEAL").on("click", deal);
// 确认处理
$("#DEAL_CONFIRM").on("click", dealConfirm);
// 键盘按键
downKeyUp();
});
/**
* 页面加载完成
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 新增
*/
let add = function () {
addOrUpdate("");
}
/**
* 修改
*/
let modify = function (suggestNo) {
let params = "inqu_status-0-suggestNo=" + suggestNo;
addOrUpdate(params);
}
/**
* 新增
*/
let addOrUpdate = function (params) {
JSColorbox.open({
href: "HPFW004B?" + 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", "HPFW004", "remove", true);
}
})
}
/**
* 处理
*
* @param id
* @param auditStatus
*/
function deal(id) {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的" + rows.length + "条数据做\"处理\"操作?", {
ok: function () {
$("#dealWindow").data("kendoWindow").center();
$("#dealWindow").data("kendoWindow").open();
}
})
}
/**
* 确认处理
*/
function dealConfirm() {
let content = $("#deal-0-content").val();
if (isBlank(content)) {
message("请输入处理内容");
return;
}
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-content", content);
JSUtils.submitGridsData("result", "HPFW004", "deal", true,
function (res) {
if (res.status > -1) {
$("#dealWindow").data("kendoWindow").close();
}
}, inInfo
);
}
/**
* 附件清单
*
* @param bizId
*/
function showUploadFile(bizId) {
JSColorbox.open({
href: "HPFW004A?inqu_status-0-bizId=" + bizId,
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:EFDatePicker ename="suggestDate" cname="建议日期" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect ename="suggestWay" cname="建议方式" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.hpfw.suggestWay"/>
</EF:EFSelect>
<EF:EFSelect ename="suggestType" cname="建议类型" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.hpfw.suggestType"/>
</EF:EFSelect>
<EF:EFSelect ename="status" cname="状态" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.comm.dealStatus"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput ename="customName" cname="客户名称" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput ename="dealUserName" cname="处理人" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="ID" enable="false" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="suggestNo" cname="建议单号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="suggestDate" cname="建议日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.comm.dealStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="suggestWay" cname="建议方式" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.hpfw.suggestWay"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="suggestType" cname="建议类型" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.hpfw.suggestType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="suggestContent" cname="建议内容" enable="false" width="160" align="left"/>
<EF:EFColumn ename="customId" cname="客户ID" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="customName" cname="客户名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="dealContent" cname="处理内容" enable="false" width="120" align="left"/>
<EF:EFColumn ename="dealUserId" cname="处理人ID" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="dealUserName" cname="处理人名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="updatedName" cname="修改人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="updatedTime" cname="修改时间" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<EF:EFWindow id="dealWindow" title="处理内容" width="50%" height="30%">
<EF:EFRegion id="deal" title="">
<div class="row">
<EF:EFInput blockId="deal" row="0" ename="content" cname="处理内容" colWidth="12" ratio="2:10"
type="textarea" rows="4" required="true"/>
</div>
</EF:EFRegion>
</EF:EFWindow>
$(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;
}
}]
}
};
$("#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 () {
let status = $("#detail-0-status").val();
if (!isBlank(status) && status === "0") {
$('#UPLOAD_FILE').show();
$('#REMOVE').show();
} else {
$('#UPLOAD_FILE').hide();
$('#REMOVE').hide();
}
}
/**
* 文件上传
*
* @param id
*/
function uploadFile() {
let bizId = $("#inqu_status-0-bizId").val();
let bizType = $("#inqu_status-0-bizType").val();
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-suggestNo", bizId);
EiCommunicator.send('HPFW004', 'checkStatus', inInfo, {
onSuccess(res) {
if (res.status !== -1) {
CommonUtils.uploadFile(bizType, bizId, function (res) {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
});
} else {
message(res.msg);
}
},
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", "HPFW004A", "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:EFInput cname="客户建议ID" ename="id" blockId="detail" row="0" type="hidden"/>
<EF:EFInput cname="状态" ename="status" blockId="detail" row="0" type="hidden"/>
<EF:EFRegion id="inqu" title="查询区域" type="query">
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"
value="SUGGEST"/>
<div class="row">
<EF:EFInput cname="客户建议单号" ename="bizId" blockId="inqu_status" row="0" readonly="true"/>
<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="160"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="docType" cname="文件类型" enable="false" width="100"/>
<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="100" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFSelect = {
"result-0-customId": {
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-customName").val(textField);
} else {
$("#result-0-customName").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 msg = checkParam();
if (!isBlank(msg)) {
message(msg);
return;
}
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("", "HPFW004B", "save", true, function (res) {
if (res.status > -1) {
parent.JSColorbox.setValueCallback(res);
} else {
message(res.msg);
}
});
}
});
}
/**
* 参数校验
*/
let checkParam = function () {
let suggestDate = $("#result-0-suggestDate").val();
if (isBlank(suggestDate)) {
return "建议日期不能为空";
}
let suggestWay = $("#result-0-suggestWay").val();
if (isBlank(suggestWay)) {
return "建议方式不能为空";
}
let suggestType = $("#result-0-suggestType").val();
if (isBlank(suggestType)) {
return "建议类型不能为空";
}
let customId = $("#result-0-customId").val();
if (isBlank(customId)) {
message("客户名称不能为空");
return;
}
let suggestContent = $("#result-0-suggestContent").val();
if (isBlank(suggestContent)) {
return "建议内容不能为空";
}
return "";
}
<!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="数据区域">
<EF:EFInput ename="id" cname="ID" blockId="result" row="0" type="hidden"/>
<div class="row">
<EF:EFInput ename="suggestNo" cname="建议单号" blockId="result" row="0" colWidth="6" ratio="2:10"
required="true" readonly="true"/>
</div>
<div class="row">
<EF:EFDatePicker ename="suggestDate" cname="建议日期" blockId="result" row="0" colWidth="6" ratio="2:10"
format="yyyy-MM-dd" readonly="true"/>
</div>
<div class="row">
<EF:EFSelect ename="suggestWay" cname="建议方式" blockId="result" row="0" colWidth="6" ratio="2:10">
<EF:EFOption label="请选择" value=""/>
<EF:EFCodeOption codeName="app.hpfw.suggestWay"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect ename="suggestType" cname="建议类型" blockId="result" row="0" colWidth="6" ratio="2:10">
<EF:EFOption label="请选择" value=""/>
<EF:EFCodeOption codeName="app.hpfw.suggestType"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect ename="customId" cname="客户名称" blockId="result" row="0" colWidth="6" ratio="2:10"
filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="customer_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput ename="customName" cname="客户名称" blockId="result" row="0" colWidth="6" ratio="2:10"
type="hidden"/>
</div>
<div class="row">
<EF:EFInput ename="suggestContent" cname="建议内容" blockId="result" row="0" colWidth="6" ratio="2:10"
type="textarea" rows="3"/>
</div>
<br/>
<span style="color: red; ">说明:客户建议单号由系统自动生成</span><br>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 20,
pageSizes: [20, 50, 100, 200],
},
columns: [{
field: "operator",
template: function (item) {
let status = item.status;
let template = '';
if (status && status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+ 'onclick="modify(\'' + item.noticeNo + '\')" >详情</a>&nbsp;&nbsp;';
}
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(\'' + item.noticeNo + '\')" >附件清单</a>';
return template;
}
}],
loadComplete: function (grid) {
},
onRowClick: function (e) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 新增
$("#ADD").on("click", add);
// 删除
$("#REMOVE").on("click", remove);
// 提交
$("#SUBMIT").on("click", submit);
// 键盘按键
downKeyUp();
});
/**
* 页面加载完成
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 新增
*/
let add = function () {
addOrUpdate("");
}
/**
* 修改
*/
let modify = function (noticeNo) {
let params = "inqu_status-0-noticeNo=" + noticeNo;
addOrUpdate(params);
}
/**
* 新增
*/
let addOrUpdate = function (params) {
JSColorbox.open({
href: "HPXT011B?" + 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", "HPXT011", "remove", true);
}
})
}
/**
* 发布
*
* @param auditStatus
*/
function submit() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的" + rows.length + "条数据做\"提交\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPXT011", "submit", true);
}
})
}
/**
* 附件清单
*
* @param bizId
*/
function showUploadFile(bizId) {
JSColorbox.open({
href: "HPXT011A?inqu_status-0-bizId=" + bizId,
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:EFDatePicker ename="noticeDate" cname="公告日期" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect ename="noticeType" cname="公告类型" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.hpfw.noticeType"/>
</EF:EFSelect>
<EF:EFSelect ename="status" cname="状态" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.comm.submitStatus"/>
</EF:EFSelect>
<EF:EFInput ename="submitUserName" cname="发布人" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="ID" enable="false" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="noticeNo" cname="公告单号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="noticeDate" cname="公告日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.comm.submitStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="noticeType" cname="公告类型" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.hpfw.noticeType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="noticeTitle" cname="公告主题" enable="false" width="160" align="left"/>
<EF:EFColumn ename="noticeContent" cname="公告内容" enable="false" width="360" align="left"/>
<EF:EFColumn ename="expireDate" cname="公告有效期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="submitUserId" cname="发布人ID" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="submitUserName" cname="发布人" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="updatedName" cname="修改人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="updatedTime" cname="修改时间" 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.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;
}
}]
}
};
$("#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 () {
let status = $("#detail-0-status").val();
if (!isBlank(status) && status === "0") {
$('#UPLOAD_FILE').show();
$('#REMOVE').show();
} else {
$('#UPLOAD_FILE').hide();
$('#REMOVE').hide();
}
}
/**
* 文件上传
*
* @param id
*/
function uploadFile() {
let bizId = $("#inqu_status-0-bizId").val();
let bizType = $("#inqu_status-0-bizType").val();
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-noticeNo", bizId);
EiCommunicator.send('HPXT011', 'checkStatus', inInfo, {
onSuccess(res) {
if (res.status !== -1) {
CommonUtils.uploadFile(bizType, bizId, function (res) {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
});
} else {
message(res.msg);
}
},
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", "HPXT011A", "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:EFInput cname="公告ID" ename="id" blockId="detail" row="0" type="hidden"/>
<EF:EFInput cname="状态" ename="status" blockId="detail" row="0" type="hidden"/>
<EF:EFRegion id="inqu" title="查询区域" type="query">
<EF:EFInput ename="bizType" cname="业务类型" blockId="inqu_status" row="0" type="hidden"
value="NOTICE"/>
<div class="row">
<EF:EFInput ename="bizId" cname="公告号" blockId="inqu_status" row="0" readonly="true"/>
<EF:EFInput ename="docName" cname="文件名称" 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="160"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="docType" cname="文件类型" enable="false" width="100"/>
<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="100" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
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 msg = checkParam();
if (!isBlank(msg)) {
message(msg);
return;
}
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("", "HPXT011B", "save", true, function (res) {
if (res.status > -1) {
parent.JSColorbox.setValueCallback(res);
} else {
message(res.msg);
}
});
}
});
}
/**
* 参数校验
*/
let checkParam = function () {
let noticeDate = $("#result-0-noticeDate").val();
if (isBlank(noticeDate)) {
return "公告日期不能为空";
}
let noticeType = $("#result-0-noticeType").val();
if (isBlank(noticeType)) {
return "公告类型不能为空";
}
let noticeTitle = $("#result-0-noticeTitle").val();
if (isBlank(noticeTitle)) {
message("公告主题不能为空");
return;
}
let noticeContent = $("#result-0-noticeContent").val();
if (isBlank(noticeContent)) {
return "公告内容不能为空";
}
let expireDate = $("#result-0-expireDate").val();
if (isBlank(expireDate)) {
return "公告有效期不能为空";
}
return "";
}
<!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="数据区域">
<EF:EFInput ename="id" cname="ID" blockId="result" row="0" type="hidden"/>
<div class="row">
<EF:EFInput ename="noticeNo" cname="公告单号" blockId="result" row="0" colWidth="6" ratio="2:10"
required="true" readonly="true"/>
</div>
<div class="row">
<EF:EFDatePicker ename="noticeDate" cname="公告日期" blockId="result" row="0" colWidth="6" ratio="2:10"
format="yyyy-MM-dd" readonly="true"/>
</div>
<div class="row">
<EF:EFSelect ename="noticeType" cname="公告类型" blockId="result" row="0" colWidth="6" ratio="2:10">
<EF:EFOption label="请选择" value=""/>
<EF:EFCodeOption codeName="app.hpfw.noticeType"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput ename="noticeTitle" cname="公告主题" blockId="result" row="0" colWidth="6" ratio="2:10"/>
</div>
<div class="row">
<EF:EFInput ename="noticeContent" cname="公告内容" blockId="result" row="0" colWidth="6" ratio="2:10"
type="textarea" rows="3"/>
</div>
<div class="row">
<EF:EFDatePicker ename="expireDate" cname="公告有效期" blockId="result" row="0" colWidth="6" ratio="2:10"
format="yyyy-MM-dd" readonly="true"/>
</div>
<br/>
<span style="color: red; ">说明:公告号由系统自动生成</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