Commit 28f87ae7 by liuyang

2024-08-16 安全记录APP附件上传调整

parent 7cadec6f
...@@ -4,6 +4,7 @@ import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation; ...@@ -4,6 +4,7 @@ import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant; 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.utils.Iplat4jUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.sb.domain.HPSB003; import com.baosight.hpjx.hp.sb.domain.HPSB003;
import com.baosight.hpjx.hp.sb.domain.HPSB008; import com.baosight.hpjx.hp.sb.domain.HPSB008;
...@@ -103,9 +104,21 @@ public class ServiceHPSB008 extends ServiceEPBase { ...@@ -103,9 +104,21 @@ public class ServiceHPSB008 extends ServiceEPBase {
public EiInfo appSave(EiInfo inInfo) { public EiInfo appSave(EiInfo inInfo) {
try{ try{
Map resultMap = EiInfoUtils.getFirstRow(inInfo, EiConstant.resultBlock); Map resultMap = EiInfoUtils.getFirstRow(inInfo, EiConstant.resultBlock);
HPSB008 hpsb008 = HPSBTools.Hpsb008.add(resultMap);
String docId = MapUtils.getString(resultMap, HPSB099.FIELD_DOC_ID); String docId = MapUtils.getString(resultMap, HPSB099.FIELD_DOC_ID);
String docVideoId = MapUtils.getString(resultMap, HPSB099.FIELD_DOC_VIDEO_ID); String docVideoId = MapUtils.getString(resultMap, HPSB099.FIELD_DOC_VIDEO_ID);
HPSB008 hpsb008 = new HPSB008();
hpsb008.fromMap(resultMap);
if (hpsb008.getId() == null || hpsb008.getId() == 0) {
this.add(hpsb008);
}else {
this.modify(hpsb008);
List<HPSB099> hpsb099List = HPSBTools.Hpsb099.getMatId(hpsb008.getId());
if (hpsb099List.size() > 0) {
for (HPSB099 hpsb099 : hpsb099List) {
Iplat4jUtils.deleteFileByDocId(hpsb099.getDocId());
}
}
}
if (StringUtils.isNotEmpty(docId)) { if (StringUtils.isNotEmpty(docId)) {
String [] docIds = docId.split(","); String [] docIds = docId.split(",");
for (String docIdStr : docIds){ for (String docIdStr : docIds){
......
...@@ -164,4 +164,25 @@ public class HPSBTools { ...@@ -164,4 +164,25 @@ public class HPSBTools {
return hpsb008; return hpsb008;
} }
} }
public static class Hpsb099{
public static HPSB099 getId(Long id) {
AssertUtils.isNull(id, "附件清单不能为空");
Map queryMap = new HashMap();
queryMap.put(HPSB099.FIELD_DOC_ID, id);
List<HPSB099> results = DaoBase.getInstance().query(HPSB099.QUERY, queryMap);
AssertUtils.isEmpty(results, "附件清单不存在");
return results.get(0);
}
public static List<HPSB099> getMatId(Long matId) {
AssertUtils.isNull(matId, "附件清单上级ID不能为空");
Map queryMap = new HashMap();
queryMap.put(HPSB099.FIELD_MAT_ID, matId);
List<HPSB099> results = DaoBase.getInstance().query(HPSB099.QUERY, queryMap);
AssertUtils.isEmpty(results, "附件清单不存在");
return results;
}
}
} }
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