| | |
| | | import cn.gistack.sm.sjztdw.entity.DwsResPressDi; |
| | | import cn.gistack.sm.sjztdw.mapper.DwsResPressDiMapper; |
| | | import cn.gistack.sm.sjztdw.service.IDwsResPressDiService; |
| | | import cn.gistack.sm.sjztdw.vo.DbExcelVO; |
| | | import cn.gistack.sm.sjztods.entity.DsmSpgSpprmp; |
| | | import cn.gistack.sm.sjztods.service.IDsmSpgSpprmpService; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @DS("ztdw") |
| | | @AllArgsConstructor |
| | | public class DwsResPressDiServiceImpl extends ServiceImpl<DwsResPressDiMapper, DwsResPressDi> implements IDwsResPressDiService { |
| | | |
| | | private final IDsmSpgSpprmpService dsmSpgSpprmpService; |
| | | |
| | | @Override |
| | | public Integer updateCustomize(DwsResPressDi dwsResPressDi) { |
| | | return baseMapper.updateCustomize(dwsResPressDi); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateByBasic(DbExcelVO dbExcel) { |
| | | DsmSpgSpprmp paramSy = new DsmSpgSpprmp(); |
| | | paramSy.setCh(dbExcel.getCh()); |
| | | paramSy.setRscd(dbExcel.getResRegCode()); |
| | | |
| | | //根据水库注册登记码,断面获取渗压站列表,并按测点编号从小到大排序 |
| | | List<DsmSpgSpprmp> list = dsmSpgSpprmpService.getList(paramSy); |
| | | |
| | | //excel数据应是按测压管从小到大 |
| | | List<String> avgValueList = Arrays.asList(dbExcel.getAvgValue().split(",")); |
| | | |
| | | //更新渗压站数据 |
| | | if (list !=null && list.size()>0){ |
| | | for (int i = 0; i < avgValueList.size(); i++) { |
| | | String avgValue = avgValueList.get(i); |
| | | DsmSpgSpprmp dsmSpgSpprmp = list.get(i); |
| | | |
| | | DbExcelVO updateParams = new DbExcelVO(); |
| | | |
| | | updateParams.setResCd(dbExcel.getResCd()); |
| | | updateParams.setCd(dsmSpgSpprmp.getMpcd()); |
| | | updateParams.setMonitorDate(dbExcel.getMonitorDate()); |
| | | updateParams.setAvgValue(avgValue); |
| | | |
| | | baseMapper.updateByBasic(updateParams); |
| | | |
| | | } |
| | | } |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | @Override |
| | | public Integer removeByBasic(DbExcelVO dbExcelVO) { |
| | | return baseMapper.removeByBasic(dbExcelVO); |
| | | } |
| | | } |