1:修改同步接口BUG

2:将方程式进行先删除后保存
master
yangzhe123 2025-11-18 17:57:22 +08:00
parent 747e7c5143
commit a06b269f36
5 changed files with 20 additions and 4 deletions

View File

@ -106,9 +106,9 @@ public interface JcskSyRMapper extends BaseMapper<JcskSyR> {
@Select(""" @Select("""
<script> <script>
select to_char((t.tm - INTERVAL '5 minutes'),'YYYY-MM-DD HH24:MI:SS') as tm,t.rz select to_char(t.tm,'YYYY-MM-DD HH24:MI:SS') as tm,t.rz
from public.st_rsvr_r t from public.st_rsvr_r t
where t.stcd = #{stcd} and to_char(t.tm, 'MI:SS') = '05:00' where t.stcd = #{stcd} and to_char(t.tm, 'MI:SS') = '00:00'
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.start != null"> <if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.start != null">
and t.tm <![CDATA[>=]]> #{obj.dateTimeRangeSo.start} and t.tm <![CDATA[>=]]> #{obj.dateTimeRangeSo.start}
</if> </if>

View File

@ -109,6 +109,7 @@ public class SyncRiverWaterLevelService implements SyncTableRService<JcskStRsvrR
if (existingTarget == null) { if (existingTarget == null) {
StRiverR targetEntity = new StRiverR(); StRiverR targetEntity = new StRiverR();
BeanUtils.copyProperties(sourceEntity, targetEntity); BeanUtils.copyProperties(sourceEntity, targetEntity);
targetEntity.setTm(LocalDateTimeConverter.toDate(sourceEntity.getTm()));
targetEntity.setZ(sourceEntity.getRz()); targetEntity.setZ(sourceEntity.getRz());
targetEntity.setWptn(sourceEntity.getRwptn()); targetEntity.setWptn(sourceEntity.getRwptn());
targetMapper.insert(targetEntity); targetMapper.insert(targetEntity);

View File

@ -104,6 +104,7 @@ public class SyncRsvrWaterLevelService implements SyncTableRService<JcskStRsvrR,
if (existingTarget == null) { if (existingTarget == null) {
StRsvrR targetEntity = new StRsvrR(); StRsvrR targetEntity = new StRsvrR();
BeanUtils.copyProperties(sourceEntity, targetEntity); BeanUtils.copyProperties(sourceEntity, targetEntity);
targetEntity.setTm(LocalDateTimeConverter.toDate(sourceEntity.getTm()));
targetMapper.insert(targetEntity); targetMapper.insert(targetEntity);
} }
count++; count++;

View File

@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gunshi.project.hsz.entity.vo.ProfilePressTreeVo; import com.gunshi.project.hsz.entity.vo.ProfilePressTreeVo;
import com.gunshi.project.hsz.mapper.AttDamProfileMapper; import com.gunshi.project.hsz.mapper.AttDamProfileMapper;
import com.gunshi.project.hsz.model.AttDamProfile; import com.gunshi.project.hsz.model.AttDamProfile;
import com.gunshi.project.hsz.model.OsmoticPressDevice;
import com.gunshi.project.hsz.model.OsmoticPressDeviceAutoDao;
import com.gunshi.project.hsz.util.MyBeanUtil; import com.gunshi.project.hsz.util.MyBeanUtil;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;

View File

@ -862,6 +862,10 @@ public class JcskSyRService extends ServiceImpl<JcskSyRMapper, JcskSyR> {
RegressionEquation first = RegressionAnalysis.calculateLinear(data); RegressionEquation first = RegressionAnalysis.calculateLinear(data);
LocalDateTime createTime = LocalDateTime.now(); LocalDateTime createTime = LocalDateTime.now();
if(first != null){ if(first != null){
LambdaQueryWrapper<SyRegressionData> query = new LambdaQueryWrapper<>();
query.eq(SyRegressionData::getDvcd, dto.getDvcd());
query.eq(SyRegressionData::getOrder,1);
syRegressionDataService.remove(query);
res.setOne(first.toString()); res.setOne(first.toString());
SyRegressionData syRegressionData = new SyRegressionData(); SyRegressionData syRegressionData = new SyRegressionData();
syRegressionData.setOrder(1); syRegressionData.setOrder(1);
@ -874,6 +878,10 @@ public class JcskSyRService extends ServiceImpl<JcskSyRMapper, JcskSyR> {
} }
RegressionEquation second = RegressionAnalysis.calculateQuadratic(data); RegressionEquation second = RegressionAnalysis.calculateQuadratic(data);
if(second != null){ if(second != null){
LambdaQueryWrapper<SyRegressionData> query = new LambdaQueryWrapper<>();
query.eq(SyRegressionData::getDvcd, dto.getDvcd());
query.eq(SyRegressionData::getOrder,2);
syRegressionDataService.remove(query);
res.setTwo(second.toString()); res.setTwo(second.toString());
SyRegressionData syRegressionData = new SyRegressionData(); SyRegressionData syRegressionData = new SyRegressionData();
syRegressionData.setOrder(2); syRegressionData.setOrder(2);
@ -886,6 +894,10 @@ public class JcskSyRService extends ServiceImpl<JcskSyRMapper, JcskSyR> {
} }
RegressionEquation three = RegressionAnalysis.calculateCubic(data); RegressionEquation three = RegressionAnalysis.calculateCubic(data);
if(three != null){ if(three != null){
LambdaQueryWrapper<SyRegressionData> query = new LambdaQueryWrapper<>();
query.eq(SyRegressionData::getDvcd, dto.getDvcd());
query.eq(SyRegressionData::getOrder,3);
syRegressionDataService.remove(query);
res.setThree(three.toString()); res.setThree(three.toString());
SyRegressionData syRegressionData = new SyRegressionData(); SyRegressionData syRegressionData = new SyRegressionData();
syRegressionData.setOrder(3); syRegressionData.setOrder(3);
@ -898,6 +910,10 @@ public class JcskSyRService extends ServiceImpl<JcskSyRMapper, JcskSyR> {
} }
RegressionEquation four = RegressionAnalysis.calculateQuartic(data); RegressionEquation four = RegressionAnalysis.calculateQuartic(data);
if(four != null){ if(four != null){
LambdaQueryWrapper<SyRegressionData> query = new LambdaQueryWrapper<>();
query.eq(SyRegressionData::getDvcd, dto.getDvcd());
query.eq(SyRegressionData::getOrder,4);
syRegressionDataService.remove(query);
res.setFour(four.toString()); res.setFour(four.toString());
SyRegressionData syRegressionData = new SyRegressionData(); SyRegressionData syRegressionData = new SyRegressionData();
syRegressionData.setOrder(4); syRegressionData.setOrder(4);