Commit 76ab87da by 宋祥

1.公告管理开发

parent 4df8214f
...@@ -105,6 +105,8 @@ public class HPConstant { ...@@ -105,6 +105,8 @@ public class HPConstant {
public static final String COMPLAINT_NO = "COMPLAINT_NO"; public static final String COMPLAINT_NO = "COMPLAINT_NO";
// 建议单号 // 建议单号
public static final String SUGGEST_NO = "SUGGEST_NO"; public static final String SUGGEST_NO = "SUGGEST_NO";
// 公告号
public static final String NOTICE_NO = "NOTICE_NO";
} }
/** /**
...@@ -150,4 +152,19 @@ public class HPConstant { ...@@ -150,4 +152,19 @@ public class HPConstant {
// 已处理 // 已处理
public static final Integer S1 = 1; 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; ...@@ -4,7 +4,7 @@ package com.baosight.hpjx.hp.fw.constant;
* @author:songx * @author:songx
* @date:2024/9/24,17:53 * @date:2024/9/24,17:53
*/ */
public class HpFwConstant { public class HpFwConst {
/** /**
* HPFW001 定义 * HPFW001 定义
......
...@@ -4,7 +4,7 @@ package com.baosight.hpjx.hp.fw.constant; ...@@ -4,7 +4,7 @@ package com.baosight.hpjx.hp.fw.constant;
* @author:songx * @author:songx
* @date:2024/9/24,18:09 * @date:2024/9/24,18:09
*/ */
public class HpFwSqlConstant { public class HpFwSqlConst {
/** /**
* @author:songx * @author:songx
......
...@@ -5,7 +5,7 @@ import com.baosight.hpjx.core.constant.CommonConstant; ...@@ -5,7 +5,7 @@ import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant; 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.domain.HPFW001;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils; import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
...@@ -184,7 +184,7 @@ public class ServiceHPFW001 extends ServiceBase { ...@@ -184,7 +184,7 @@ public class ServiceHPFW001 extends ServiceBase {
fFw001.setStatus(HPConstant.dealStatus.S1); fFw001.setStatus(HPConstant.dealStatus.S1);
fFw001.setDealUserId(UserSessionUtils.getLoginName()); fFw001.setDealUserId(UserSessionUtils.getLoginName());
fFw001.setDealUserName(UserSessionUtils.getLoginCName()); 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; ...@@ -5,7 +5,6 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.utils.Iplat4jUtils; import com.baosight.hpjx.core.utils.Iplat4jUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.dm.domain.HPDM099; 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.domain.HPFW001;
import com.baosight.hpjx.hp.fw.tools.HpFwTools; import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils; import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
......
...@@ -5,7 +5,7 @@ import com.baosight.hpjx.core.constant.CommonConstant; ...@@ -5,7 +5,7 @@ import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant; 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.domain.HPFW002;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils; import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
...@@ -184,7 +184,7 @@ public class ServiceHPFW002 extends ServiceBase { ...@@ -184,7 +184,7 @@ public class ServiceHPFW002 extends ServiceBase {
fFw002.setDealUserId(UserSessionUtils.getLoginName()); fFw002.setDealUserId(UserSessionUtils.getLoginName());
fFw002.setDealUserName(UserSessionUtils.getLoginCName()); fFw002.setDealUserName(UserSessionUtils.getLoginCName());
fFw002.setDealContent(content); 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; ...@@ -4,7 +4,7 @@ import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant; 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.domain.HPFW003;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils; import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
...@@ -180,7 +180,7 @@ public class ServiceHPFW003 extends ServiceBase { ...@@ -180,7 +180,7 @@ public class ServiceHPFW003 extends ServiceBase {
fFw003.setDealUserId(UserSessionUtils.getLoginName()); fFw003.setDealUserId(UserSessionUtils.getLoginName());
fFw003.setDealUserName(UserSessionUtils.getLoginCName()); fFw003.setDealUserName(UserSessionUtils.getLoginCName());
fFw003.setDealContent(content); fFw003.setDealContent(content);
DaoUtils.update(HpFwSqlConstant.HpFw003.UPDATE_DEAL, fFw003.toMap()); DaoUtils.update(HpFwSqlConst.HpFw003.UPDATE_DEAL, fFw003.toMap());
} }
} }
......
...@@ -4,7 +4,7 @@ import com.baosight.hpjx.core.constant.CommonConstant; ...@@ -4,7 +4,7 @@ import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant; 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.HPFW004; import com.baosight.hpjx.hp.fw.domain.HPFW004;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils; import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
...@@ -180,21 +180,21 @@ public class ServiceHPFW004 extends ServiceBase { ...@@ -180,21 +180,21 @@ public class ServiceHPFW004 extends ServiceBase {
fFw004.setDealUserId(UserSessionUtils.getLoginName()); fFw004.setDealUserId(UserSessionUtils.getLoginName());
fFw004.setDealUserName(UserSessionUtils.getLoginCName()); fFw004.setDealUserName(UserSessionUtils.getLoginCName());
fFw004.setDealContent(content); fFw004.setDealContent(content);
DaoUtils.update(HpFwSqlConstant.HpFw004.UPDATE_DEAL, fFw004.toMap()); DaoUtils.update(HpFwSqlConst.HpFw004.UPDATE_DEAL, fFw004.toMap());
} }
} }
/** /**
* 数据校验 * 数据校验
* *
* @param careNo * @param suggestNo
* @param dbFw004 * @param dbFw004
*/ */
private void checkData(String careNo, HPFW004 dbFw004) { private void checkData(String suggestNo, HPFW004 dbFw004) {
AssertUtils.isNull(dbFw004, String.format("建议单[%s]不存在", careNo)); AssertUtils.isNull(dbFw004, String.format("建议单[%s]不存在", suggestNo));
AssertUtils.isNotEquals(dbFw004.getDeleteFlag(), CommonConstant.YesNo.NO_0, AssertUtils.isNotEquals(dbFw004.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("建议单【%s】不是\"未删除\"状态,不允许操作", careNo)); String.format("建议单【%s】不是\"未删除\"状态,不允许操作", suggestNo));
AssertUtils.isNotEquals(dbFw004.getStatus(), HPConstant.dealStatus.S0, AssertUtils.isNotEquals(dbFw004.getStatus(), HPConstant.dealStatus.S0,
String.format("建议单【%s】不是\"待处理\"状态,不允许操作", careNo)); String.format("建议单【%s】不是\"待处理\"状态,不允许操作", suggestNo));
} }
} }
...@@ -5,7 +5,7 @@ import com.baosight.hpjx.core.constant.CommonConstant; ...@@ -5,7 +5,7 @@ import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant; 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.domain.HPFW007;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils; import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
...@@ -183,7 +183,7 @@ public class ServiceHPFW007 extends ServiceBase { ...@@ -183,7 +183,7 @@ public class ServiceHPFW007 extends ServiceBase {
fFw007.setDealUserId(UserSessionUtils.getLoginName()); fFw007.setDealUserId(UserSessionUtils.getLoginName());
fFw007.setDealUserName(UserSessionUtils.getLoginCName()); fFw007.setDealUserName(UserSessionUtils.getLoginCName());
fFw007.setDealContent(content); fFw007.setDealContent(content);
DaoUtils.update(HpFwSqlConstant.HpFw007.UPDATE_DEAL, fFw007.toMap()); DaoUtils.update(HpFwSqlConst.HpFw007.UPDATE_DEAL, fFw007.toMap());
} }
} }
......
package com.baosight.hpjx.hp.fw.tools; package com.baosight.hpjx.hp.fw.tools;
import com.baosight.hpjx.core.dao.DaoBase; 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.HPFW001;
import com.baosight.hpjx.hp.fw.domain.HPFW002; import com.baosight.hpjx.hp.fw.domain.HPFW002;
import com.baosight.hpjx.hp.fw.domain.HPFW003; import com.baosight.hpjx.hp.fw.domain.HPFW003;
...@@ -36,7 +36,7 @@ public class HpFwTools { ...@@ -36,7 +36,7 @@ public class HpFwTools {
AssertUtils.isEmpty(afterSaleNo, "售后单号不能为空!"); AssertUtils.isEmpty(afterSaleNo, "售后单号不能为空!");
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW001.FIELD_AFTER_SALE_NO, afterSaleNo); paramMap.put(HPFW001.FIELD_AFTER_SALE_NO, afterSaleNo);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw001.LOCK, paramMap); DaoBase.getInstance().update(HpFwSqlConst.HpFw001.LOCK, paramMap);
} }
/** /**
...@@ -48,7 +48,7 @@ public class HpFwTools { ...@@ -48,7 +48,7 @@ public class HpFwTools {
AssertUtils.isEmpty(afterSaleNos, "售后单号不能为空!"); AssertUtils.isEmpty(afterSaleNos, "售后单号不能为空!");
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("afterSaleNos", afterSaleNos); paramMap.put("afterSaleNos", afterSaleNos);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw001.LOCK, paramMap); DaoBase.getInstance().update(HpFwSqlConst.HpFw001.LOCK, paramMap);
} }
/** /**
...@@ -106,7 +106,7 @@ public class HpFwTools { ...@@ -106,7 +106,7 @@ public class HpFwTools {
AssertUtils.isEmpty(careNo, "关怀单号不能为空!"); AssertUtils.isEmpty(careNo, "关怀单号不能为空!");
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW002.FIELD_CARE_NO, careNo); paramMap.put(HPFW002.FIELD_CARE_NO, careNo);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw002.LOCK, paramMap); DaoBase.getInstance().update(HpFwSqlConst.HpFw002.LOCK, paramMap);
} }
/** /**
...@@ -118,7 +118,7 @@ public class HpFwTools { ...@@ -118,7 +118,7 @@ public class HpFwTools {
AssertUtils.isEmpty(careNos, "关怀单号不能为空!"); AssertUtils.isEmpty(careNos, "关怀单号不能为空!");
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("careNos", careNos); paramMap.put("careNos", careNos);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw002.LOCK, paramMap); DaoBase.getInstance().update(HpFwSqlConst.HpFw002.LOCK, paramMap);
} }
/** /**
...@@ -176,7 +176,7 @@ public class HpFwTools { ...@@ -176,7 +176,7 @@ public class HpFwTools {
AssertUtils.isEmpty(complaintNo, "投诉单号不能为空!"); AssertUtils.isEmpty(complaintNo, "投诉单号不能为空!");
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW003.FIELD_COMPLAINT_NO, complaintNo); paramMap.put(HPFW003.FIELD_COMPLAINT_NO, complaintNo);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw003.LOCK, paramMap); DaoBase.getInstance().update(HpFwSqlConst.HpFw003.LOCK, paramMap);
} }
/** /**
...@@ -188,7 +188,7 @@ public class HpFwTools { ...@@ -188,7 +188,7 @@ public class HpFwTools {
AssertUtils.isEmpty(complaintNos, "投诉单号不能为空!"); AssertUtils.isEmpty(complaintNos, "投诉单号不能为空!");
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("complaintNos", complaintNos); paramMap.put("complaintNos", complaintNos);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw003.LOCK, paramMap); DaoBase.getInstance().update(HpFwSqlConst.HpFw003.LOCK, paramMap);
} }
/** /**
...@@ -246,7 +246,7 @@ public class HpFwTools { ...@@ -246,7 +246,7 @@ public class HpFwTools {
AssertUtils.isEmpty(suggestNo, "建议单号不能为空!"); AssertUtils.isEmpty(suggestNo, "建议单号不能为空!");
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW004.FIELD_SUGGEST_NO, suggestNo); paramMap.put(HPFW004.FIELD_SUGGEST_NO, suggestNo);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw004.LOCK, paramMap); DaoBase.getInstance().update(HpFwSqlConst.HpFw004.LOCK, paramMap);
} }
/** /**
...@@ -258,7 +258,7 @@ public class HpFwTools { ...@@ -258,7 +258,7 @@ public class HpFwTools {
AssertUtils.isEmpty(suggestNos, "建议号不能为空!"); AssertUtils.isEmpty(suggestNos, "建议号不能为空!");
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("suggestNos", suggestNos); paramMap.put("suggestNos", suggestNos);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw004.LOCK, paramMap); DaoBase.getInstance().update(HpFwSqlConst.HpFw004.LOCK, paramMap);
} }
/** /**
...@@ -316,7 +316,7 @@ public class HpFwTools { ...@@ -316,7 +316,7 @@ public class HpFwTools {
AssertUtils.isEmpty(folNo, "关怀单号不能为空!"); AssertUtils.isEmpty(folNo, "关怀单号不能为空!");
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW007.FIELD_FOL_NO, folNo); paramMap.put(HPFW007.FIELD_FOL_NO, folNo);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw007.LOCK, paramMap); DaoBase.getInstance().update(HpFwSqlConst.HpFw007.LOCK, paramMap);
} }
/** /**
...@@ -328,7 +328,7 @@ public class HpFwTools { ...@@ -328,7 +328,7 @@ public class HpFwTools {
AssertUtils.isEmpty(folNos, "回访单号不能为空!"); AssertUtils.isEmpty(folNos, "回访单号不能为空!");
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("folNos", folNos); paramMap.put("folNos", folNos);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw007.LOCK, paramMap); DaoBase.getInstance().update(HpFwSqlConst.HpFw007.LOCK, paramMap);
} }
/** /**
......
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);
}
}
}
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
<sqlMap resource="com/baosight/hpjx/hp/fw/sql/HPFW004.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/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/HPCW001.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/cw/sql/HPCW002.xml"/> <sqlMap resource="com/baosight/hpjx/hp/cw/sql/HPCW002.xml"/>
......
$(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