Commit 2eb2ec26 by 宋祥

1.增加确认公共方法

parent b2f97e6b
...@@ -4,9 +4,11 @@ import com.baosight.hggp.core.dao.DaoUtils; ...@@ -4,9 +4,11 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.ct.constant.HgCtConst; import com.baosight.hggp.hg.ct.constant.HgCtConst;
import com.baosight.hggp.hg.ct.constant.HgCtSqlConst; import com.baosight.hggp.hg.ct.constant.HgCtSqlConst;
import com.baosight.hggp.hg.ct.domain.HGCT01; import com.baosight.hggp.hg.ct.domain.HGCT01;
import com.baosight.hggp.hg.ct.tools.HgCtTools;
import com.baosight.hggp.util.DateUtils; import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils; import com.baosight.hggp.util.ObjectUtils;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
...@@ -129,14 +131,10 @@ public class ServiceHGCT01 extends ServiceEPBase { ...@@ -129,14 +131,10 @@ public class ServiceHGCT01 extends ServiceEPBase {
public EiInfo batchConfirm(EiInfo inInfo) { public EiInfo batchConfirm(EiInfo inInfo) {
try { try {
int successCount = 0; int successCount = 0;
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<HGCT01> fCt01s = MapUtils.toDaoEPBases(inInfo, HGCT01.class);
for (Map resultRow : resultRows) { for (HGCT01 fCt01 : fCt01s) {
resultRow.put(HGCT01.FIELD_STATUS, HgCtConst.HgCt01.Status.CLOSE); int result = HgCtTools.HgCt01.confirm(fCt01.getInternalCode());
resultRow.put(HGCT01.FIELD_CLOSE_TIME, DateUtils.shortDateTime()); successCount += result;
int result = DaoUtils.update(HgCtSqlConst.HgCt01.CONFIRM, resultRow);
if (result > 0) {
successCount++;
}
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + successCount + "]条数据确认已办成功!"); inInfo.setMsg("操作成功!本次对[" + successCount + "]条数据确认已办成功!");
......
...@@ -2,7 +2,13 @@ package com.baosight.hggp.hg.ct.tools; ...@@ -2,7 +2,13 @@ package com.baosight.hggp.hg.ct.tools;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.ct.constant.HgCtConst; import com.baosight.hggp.hg.ct.constant.HgCtConst;
import com.baosight.hggp.hg.ct.constant.HgCtSqlConst;
import com.baosight.hggp.hg.ct.domain.HGCT01; import com.baosight.hggp.hg.ct.domain.HGCT01;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/** /**
* @author:songx * @author:songx
...@@ -16,17 +22,33 @@ public class HgCtTools { ...@@ -16,17 +22,33 @@ public class HgCtTools {
* @author:songx * @author:songx
* @date:2024/3/25,21:04 * @date:2024/3/25,21:04
*/ */
public static class JaCt00 { public static class HgCt01 {
/** /**
* 写入数据库 * 写入数据库
*NotifyTools *
* @param ct00 * @param ct00
*/ */
public static void insertDb(HGCT01 ct00) { public static void insertDb(HGCT01 ct00) {
ct00.setStatus(HgCtConst.HgCt01.Status.OPEN); ct00.setStatus(HgCtConst.HgCt01.Status.OPEN);
DaoUtils.insert(HGCT01.INSERT, ct00); DaoUtils.insert(HGCT01.INSERT, ct00);
} }
/**
* 确认已办
*
* @param internalCode
*/
public static int confirm(String internalCode) {
if (StringUtils.isBlank(internalCode)) {
return 0;
}
Map paramMap = new HashMap();
paramMap.put(HGCT01.FIELD_INTERNAL_CODE, internalCode);
paramMap.put(HGCT01.FIELD_STATUS, HgCtConst.HgCt01.Status.CLOSE);
paramMap.put(HGCT01.FIELD_CLOSE_TIME, DateUtils.shortDateTime());
return DaoUtils.update(HgCtSqlConst.HgCt01.CONFIRM, paramMap);
}
} }
} }
...@@ -36,7 +36,7 @@ public class HgCtUtils { ...@@ -36,7 +36,7 @@ public class HgCtUtils {
// 设置通知对象名称 // 设置通知对象名称
User user = HGXSTools.XsUser.getByLogin(ct00.getUserEname()); User user = HGXSTools.XsUser.getByLogin(ct00.getUserEname());
ct00.setUserCname(user.getUserName()); ct00.setUserCname(user.getUserName());
HgCtTools.JaCt00.insertDb(ct00); HgCtTools.HgCt01.insertDb(ct00);
} }
/** /**
...@@ -55,7 +55,7 @@ public class HgCtUtils { ...@@ -55,7 +55,7 @@ public class HgCtUtils {
User user = HGXSTools.XsUser.getByLogin(loginName); User user = HGXSTools.XsUser.getByLogin(loginName);
ct00.setUserCname(user.getUserName()); ct00.setUserCname(user.getUserName());
ct00.setUserEname(user.getLoginName()); ct00.setUserEname(user.getLoginName());
HgCtTools.JaCt00.insertDb(ct00); HgCtTools.HgCt01.insertDb(ct00);
} }
} catch (Exception e) { } catch (Exception e) {
log.error("发送通知消息失败:{}", e.getMessage(), e); log.error("发送通知消息失败:{}", e.getMessage(), e);
......
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