fix: 垂向水温优化

This commit is contained in:
tangwei 2026-08-20 12:26:38 +08:00
parent dd48776d91
commit bb7ec04a38

View File

@ -252,7 +252,7 @@ public class SdWtvtRServiceImpl extends ServiceImpl<SdWtvtRMapper, SdWtvtYearVo>
} }
batchUpdateWtvtRData(dataList); batchUpdateWtvtRData(dataList);
if (CollUtil.isNotEmpty(logDetails)) { if (CollUtil.isNotEmpty(logDetails)) {
MsOperationLog mainLog = buildWtvtMainLog( stcd,"修改垂向水温数据", source); MsOperationLog mainLog = buildWtvtMainLog( stcd,"修改垂向水温数据", source,"02");
msOperationLogMapper.insert(mainLog); msOperationLogMapper.insert(mainLog);
for (MsOperationLogDetail detail : logDetails) { for (MsOperationLogDetail detail : logDetails) {
detail.setMainId(mainLog.getId()); detail.setMainId(mainLog.getId());
@ -438,12 +438,12 @@ public class SdWtvtRServiceImpl extends ServiceImpl<SdWtvtRMapper, SdWtvtYearVo>
List<Object> params = new ArrayList<>(); List<Object> params = new ArrayList<>();
List<String> conditions = new ArrayList<>(); List<String> conditions = new ArrayList<>();
for (DataParam item : dataParamList) { for (DataParam item : dataParamList) {
if (item == null || StringUtils.isBlank(item.getId()) || StringUtils.isBlank(item.getDt())) { if (item == null || StringUtils.isBlank(item.getId()) || StringUtils.isBlank(item.getTm())) {
continue; continue;
} }
conditions.add("(STCD = ? AND TM = TO_DATE(SUBSTR(?, 1, 19), 'YYYY-MM-DD HH24:MI:SS'))"); conditions.add("(STCD = ? AND TM = TO_DATE(SUBSTR(?, 1, 19), 'YYYY-MM-DD HH24:MI:SS'))");
params.add(item.getId()); params.add(item.getId());
params.add(item.getDt()); params.add(item.getTm());
} }
if (conditions.isEmpty()) { if (conditions.isEmpty()) {
return new ArrayList<>(); return new ArrayList<>();
@ -487,12 +487,13 @@ public class SdWtvtRServiceImpl extends ServiceImpl<SdWtvtRMapper, SdWtvtYearVo>
if (CollUtil.isEmpty(rows)) { if (CollUtil.isEmpty(rows)) {
return; return;
} }
MsOperationLog mainLog = buildWtvtMainLog(null,remark, source);
msOperationLogMapper.insert(mainLog);
List<MsOperationLogDetail> details = new ArrayList<>(); List<MsOperationLogDetail> details = new ArrayList<>();
for (Map<String, Object> row : rows) { for (Map<String, Object> row : rows) {
String stcd = asString(row.get("STCD")); String stcd = asString(row.get("STCD"));
// String recordId = asString(row.get("ID"));
Object depth = row.get("WTHG"); Object depth = row.get("WTHG");
MsOperationLog mainLog = buildWtvtMainLog(stcd, remark, source, "03");
msOperationLogMapper.insert(mainLog);
for (Map.Entry<String, Object> entry : row.entrySet()) { for (Map.Entry<String, Object> entry : row.entrySet()) {
String fieldCode = entry.getKey(); String fieldCode = entry.getKey();
Object oldValue = entry.getValue(); Object oldValue = entry.getValue();
@ -507,11 +508,12 @@ public class SdWtvtRServiceImpl extends ServiceImpl<SdWtvtRMapper, SdWtvtYearVo>
batchInsertWtvtLogDetails(details); batchInsertWtvtLogDetails(details);
} }
private MsOperationLog buildWtvtMainLog(String recordId,String remark, String source) { private MsOperationLog buildWtvtMainLog(String recordId,String remark, String source,String operationType) {
MsOperationLog log = new MsOperationLog(); MsOperationLog log = new MsOperationLog();
log.setOperator(resolveWtvtLogOperator()); log.setOperator(resolveWtvtLogOperator());
log.setOperateTime(new Date()); log.setOperateTime(new Date());
log.setTableName(WT_CX_TABLE_NAME); log.setTableName(WT_CX_TABLE_NAME);
log.setOperationType(operationType);
log.setRecordId(recordId); log.setRecordId(recordId);
log.setSource(StringUtils.trimToNull(source)); log.setSource(StringUtils.trimToNull(source));
log.setRemark(remark); log.setRemark(remark);