|  | @@ -1,6 +1,8 @@
 | 
											
												
													
														|  |  package com.onemap.apply.service.impl.tdgy;
 |  |  package com.onemap.apply.service.impl.tdgy;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +import com.baomidou.mybatisplus.core.conditions.Wrapper;
 | 
											
												
													
														|  |  import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 |  |  import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 | 
											
												
													
														|  | 
 |  | +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 | 
											
												
													
														|  |  import com.onemap.apply.domain.tdgy.dto.LandIdleConfirmDTO;
 |  |  import com.onemap.apply.domain.tdgy.dto.LandIdleConfirmDTO;
 | 
											
												
													
														|  |  import com.onemap.apply.domain.tdgy.dto.LandIdleDisposalDTO;
 |  |  import com.onemap.apply.domain.tdgy.dto.LandIdleDisposalDTO;
 | 
											
												
													
														|  |  import com.onemap.apply.domain.tdgy.vo.IdleLandListVo;
 |  |  import com.onemap.apply.domain.tdgy.vo.IdleLandListVo;
 | 
											
										
											
												
													
														|  | @@ -21,6 +23,7 @@ import com.onemap.common.core.web.domain.RequestResult;
 | 
											
												
													
														|  |  import com.onemap.common.datasource.annotation.Slave;
 |  |  import com.onemap.common.datasource.annotation.Slave;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  import org.springframework.stereotype.Service;
 |  |  import org.springframework.stereotype.Service;
 | 
											
												
													
														|  | 
 |  | +import org.springframework.transaction.annotation.Transactional;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  import javax.annotation.Resource;
 |  |  import javax.annotation.Resource;
 | 
											
												
													
														|  |  import java.util.HashMap;
 |  |  import java.util.HashMap;
 | 
											
										
											
												
													
														|  | @@ -163,20 +166,26 @@ public class TdgyServiceImp implements TdgyService {
 | 
											
												
													
														|  |       * @return
 |  |       * @return
 | 
											
												
													
														|  |       */
 |  |       */
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  | 
 |  | +    @Transactional
 | 
											
												
													
														|  |      public RequestResult addIdleLandDisposal(LandIdleDisposalVo landIdleDisposalVo) {
 |  |      public RequestResult addIdleLandDisposal(LandIdleDisposalVo landIdleDisposalVo) {
 | 
											
												
													
														|  |          String landId = landIdleDisposalVo.getLandId();
 |  |          String landId = landIdleDisposalVo.getLandId();
 | 
											
												
													
														|  | -        // 查询处置信息是否存在
 |  | 
 | 
											
												
													
														|  | -        LandIdleDisposalDTO landIdleDisposalDTO = landIdleDisposalMapper.selectById(landId);
 |  | 
 | 
											
												
													
														|  | -        if (landIdleDisposalDTO != null) {
 |  | 
 | 
											
												
													
														|  | -            return RequestResult.error("认定信息已存在");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        // 添加处置信息
 |  | 
 | 
											
												
													
														|  | -        landIdleDisposalDTO = new LandIdleDisposalDTO();
 |  | 
 | 
											
												
													
														|  | -        DozerUtils.map(landIdleDisposalVo, landIdleDisposalDTO);
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +        // 根据landId删除处置信息
 | 
											
												
													
														|  | 
 |  | +        Wrapper<LandIdleDisposalDTO> wrapper = new UpdateWrapper<LandIdleDisposalDTO>().eq("land_id", landId);
 | 
											
												
													
														|  | 
 |  | +        landIdleDisposalMapper.delete(wrapper);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        // 存储处置信息
 | 
											
												
													
														|  | 
 |  | +        LandIdleDisposalDTO landIdleDisposalDTO = new LandIdleDisposalDTO();
 | 
											
												
													
														|  | 
 |  | +        DozerUtils.map(landIdleDisposalVo, landIdleDisposalDTO);
 | 
											
												
													
														|  |          String uuid = IdUtils.simpleUUID();
 |  |          String uuid = IdUtils.simpleUUID();
 | 
											
												
													
														|  |          landIdleDisposalDTO.setId(uuid);
 |  |          landIdleDisposalDTO.setId(uuid);
 | 
											
												
													
														|  |          landIdleDisposalMapper.insert(landIdleDisposalDTO);
 |  |          landIdleDisposalMapper.insert(landIdleDisposalDTO);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        // 根据landId更新表t_land_idle_confirm的is_disposal字段
 | 
											
												
													
														|  | 
 |  | +        LandIdleConfirmDTO landIdleConfirmDTO = landIdleConfirmMapper.selectById(landId);
 | 
											
												
													
														|  | 
 |  | +        landIdleConfirmDTO.setIsDisposal(true);
 | 
											
												
													
														|  | 
 |  | +        landIdleConfirmMapper.updateById(landIdleConfirmDTO);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |          return RequestResult.success();
 |  |          return RequestResult.success();
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 |