| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.AttResDangerManageSpecial; |
| | | import cn.gistack.sm.sjztmd.entity.AttResFlseLim; |
| | | import cn.gistack.sm.sjztmd.entity.AttResStagChar; |
| | | import cn.gistack.sm.sjztmd.entity.AttResWaterBlock; |
| | | import cn.gistack.sm.sjztmd.mapper.AttResFlseLimMapper; |
| | | import cn.gistack.sm.sjztmd.service.IAttResDangerManageSpecialService; |
| | | import cn.gistack.sm.sjztmd.service.IAttResFlseLimService; |
| | | import cn.gistack.sm.sjztmd.service.IAttResStagCharService; |
| | | import cn.gistack.sm.sjztmd.service.IAttResWaterBlockService; |
| | | import cn.gistack.sm.sjztmd.vo.EditResInfoVO; |
| | | import cn.gistack.system.user.feign.IUserClient; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | |
| | | private IAttResWaterBlockService attResWaterBlockService; |
| | | |
| | | @Autowired |
| | | private IAttResDangerManageSpecialService attResDangerManageSpecialService; |
| | | |
| | | @Autowired |
| | | private IUserClient userClient; |
| | | |
| | | @Override |
| | |
| | | editResInfoVO.setUpdateTime(DateUtil.now()); |
| | | |
| | | // 修改汛期水位 |
| | | if (null != editResInfoVO.getXqswObjQ()) { |
| | | if (null != editResInfoVO.getXqswObjQ() && StringUtil.isNotBlank(String.valueOf(editResInfoVO.getXqswObjQ().getTbFlseLimStag()))) { |
| | | AttResFlseLim attResFlseLimQ = editResInfoVO.getXqswObjQ(); |
| | | attResFlseLimQ.setResGuid(editResInfoVO.getResGuid()); |
| | | attResFlseLimQ.setUpdateTime(DateUtil.now()); |
| | | attResFlseLimQ.setUpdateBy(AuthUtil.getUserName() + "-" + userClient.userInfoById(AuthUtil.getUserId()).getData().getPhone()); |
| | | baseMapper.updateAttResFlseLimByGuid(attResFlseLimQ,"前汛期"); |
| | | |
| | | JSONObject paramJson = new JSONObject(); |
| | | paramJson.put("time", DateUtil.format(new Date(),"yyyy-MM-dd")); |
| | | String editPar = "tb_flse_lim_stag:修改值为" + editResInfoVO.getXqswObjQ().getTbFlseLimStag(); |
| | | if (StringUtil.isNotBlank(editResInfoVO.getXqswObjQ().getTbFloodSeasonStart())) |
| | | editPar += ",tb_flood_season_start:修改值为" + editResInfoVO.getXqswObjQ().getTbFloodSeasonStart(); |
| | | if (StringUtil.isNotBlank(editResInfoVO.getXqswObjQ().getTbFloodSeasonEnd())) |
| | | editPar += ",tb_flood_season_end:修改值为" + editResInfoVO.getXqswObjQ().getTbFloodSeasonEnd(); |
| | | paramJson.put("editPar", editPar); |
| | | paramJson.put("ly", "ywxt"); |
| | | paramJson.put("user_id", AuthUtil.getUserId()); |
| | | paramJson.put("user_name", AuthUtil.getUserName()); |
| | | paramJson.put("phone", userClient.userInfoById(AuthUtil.getUserId()).getData().getPhone()); |
| | | attResFlseLimQ.setUpdateBy(paramJson.toJSONString()); |
| | | |
| | | Integer ret = baseMapper.updateAttResFlseLimByGuid(attResFlseLimQ,"前汛期"); |
| | | if (ret == 0) { |
| | | baseMapper.addAttResFlseLim(attResFlseLimQ,"前汛期"); |
| | | } |
| | | } |
| | | if (null != editResInfoVO.getXqswObjZ()) { |
| | | if (null != editResInfoVO.getXqswObjZ() && StringUtil.isNotBlank(String.valueOf(editResInfoVO.getXqswObjZ().getTbFlseLimStag()))) { |
| | | AttResFlseLim attResFlseLimZ = editResInfoVO.getXqswObjZ(); |
| | | attResFlseLimZ.setResGuid(editResInfoVO.getResGuid()); |
| | | attResFlseLimZ.setUpdateTime(DateUtil.now()); |
| | | attResFlseLimZ.setUpdateBy(AuthUtil.getUserName() + "-" + userClient.userInfoById(AuthUtil.getUserId()).getData().getPhone()); |
| | | baseMapper.updateAttResFlseLimByGuid(attResFlseLimZ,"中汛期"); |
| | | |
| | | JSONObject paramJson = new JSONObject(); |
| | | paramJson.put("time", DateUtil.format(new Date(),"yyyy-MM-dd")); |
| | | String editPar = "tb_flse_lim_stag:修改值为" + editResInfoVO.getXqswObjZ().getTbFlseLimStag(); |
| | | if (StringUtil.isNotBlank(editResInfoVO.getXqswObjQ().getTbFloodSeasonStart())) |
| | | editPar += ",tb_flood_season_start:修改值为" + editResInfoVO.getXqswObjQ().getTbFloodSeasonStart(); |
| | | if (StringUtil.isNotBlank(editResInfoVO.getXqswObjQ().getTbFloodSeasonEnd())) |
| | | editPar += ",tb_flood_season_end:修改值为" + editResInfoVO.getXqswObjQ().getTbFloodSeasonEnd(); |
| | | paramJson.put("editPar", editPar); |
| | | paramJson.put("ly", "ywxt"); |
| | | paramJson.put("user_id", AuthUtil.getUserId()); |
| | | paramJson.put("user_name", AuthUtil.getUserName()); |
| | | paramJson.put("phone", userClient.userInfoById(AuthUtil.getUserId()).getData().getPhone()); |
| | | attResFlseLimZ.setUpdateBy(paramJson.toJSONString()); |
| | | |
| | | Integer ret = baseMapper.updateAttResFlseLimByGuid(attResFlseLimZ,"中汛期"); |
| | | |
| | | if (ret == 0) { |
| | | baseMapper.addAttResFlseLim(attResFlseLimZ,"中汛期"); |
| | | } |
| | | } |
| | | if (null != editResInfoVO.getXqswObjH()) { |
| | | if (null != editResInfoVO.getXqswObjH() && StringUtil.isNotBlank(String.valueOf(editResInfoVO.getXqswObjH().getTbFlseLimStag()))) { |
| | | AttResFlseLim attResFlseLimH = editResInfoVO.getXqswObjH(); |
| | | attResFlseLimH.setResGuid(editResInfoVO.getResGuid()); |
| | | attResFlseLimH.setUpdateTime(DateUtil.now()); |
| | | attResFlseLimH.setUpdateBy(AuthUtil.getUserName() + "-" + userClient.userInfoById(AuthUtil.getUserId()).getData().getPhone()); |
| | | baseMapper.updateAttResFlseLimByGuid(attResFlseLimH,"后汛期"); |
| | | |
| | | JSONObject paramJson = new JSONObject(); |
| | | paramJson.put("time", DateUtil.format(new Date(),"yyyy-MM-dd")); |
| | | String editPar = "tb_flse_lim_stag:修改值为" + editResInfoVO.getXqswObjH().getTbFlseLimStag(); |
| | | if (StringUtil.isNotBlank(editResInfoVO.getXqswObjQ().getTbFloodSeasonStart())) |
| | | editPar += ",tb_flood_season_start:修改值为" + editResInfoVO.getXqswObjQ().getTbFloodSeasonStart(); |
| | | if (StringUtil.isNotBlank(editResInfoVO.getXqswObjQ().getTbFloodSeasonEnd())) |
| | | editPar += ",tb_flood_season_end:修改值为" + editResInfoVO.getXqswObjQ().getTbFloodSeasonEnd(); |
| | | paramJson.put("editPar", editPar); |
| | | paramJson.put("ly", "ywxt"); |
| | | paramJson.put("user_id", AuthUtil.getUserId()); |
| | | paramJson.put("user_name", AuthUtil.getUserName()); |
| | | paramJson.put("phone", userClient.userInfoById(AuthUtil.getUserId()).getData().getPhone()); |
| | | attResFlseLimH.setUpdateBy(paramJson.toJSONString()); |
| | | |
| | | Integer ret = baseMapper.updateAttResFlseLimByGuid(attResFlseLimH,"后汛期"); |
| | | if (ret == 0) { |
| | | baseMapper.addAttResFlseLim(attResFlseLimH,"后汛期"); |
| | | } |
| | | } |
| | | |
| | | // 修改水位特征参数 |
| | |
| | | attResStagChar.setWatShedArea(editResInfoVO.getWatShedArea()); |
| | | |
| | | // 修改坝顶高程 |
| | | if (StringUtil.isNotBlank(editResInfoVO.getTopDamTopElevation())) { |
| | | if (StringUtil.isNotBlank(editResInfoVO.getTbDamTopElevation())) { |
| | | AttResWaterBlock resWaterBlock = new AttResWaterBlock(); |
| | | resWaterBlock.setResGuid(editResInfoVO.getResGuid()); |
| | | resWaterBlock.setTopDamTopElevation(editResInfoVO.getTopDamTopElevation()); |
| | | resWaterBlock.setTbDamTopElevation(editResInfoVO.getTbDamTopElevation()); |
| | | attResWaterBlockService.updateAttResWaterBlockByResId(resWaterBlock); |
| | | } |
| | | |
| | | // 修改控制运行水位 |
| | | if (StringUtil.isNotBlank(editResInfoVO.getTbControlZ())) { |
| | | AttResDangerManageSpecial attResDangerManageSpecial = new AttResDangerManageSpecial(); |
| | | attResDangerManageSpecial.setResGuid(editResInfoVO.getResGuid()); |
| | | attResDangerManageSpecial.setTbControlZ(editResInfoVO.getTbControlZ()); |
| | | attResDangerManageSpecialService.updateAttResDangerManageSpecialByResId(attResDangerManageSpecial); |
| | | } |
| | | |
| | | return attResStagCharService.customizeUpdateByGuid(attResStagChar); |
| | | } |
| | | } |