| | |
| | | package com.dy.pipIrrBase.district; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.mybatis.envm.Deleted; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | |
| | | BaDistrict po = DistrictVoMapper.INSTANCT.convert(vo); |
| | | int count; |
| | | try { |
| | | BaDistrict supperPo = this.sv.selectById(po.supperId) ; |
| | | if(supperPo == null){ |
| | | return BaseResponseUtils.buildFail("出错,未得到上级行政区") ; |
| | | }else{ |
| | | po.level = DistrictLevel.get((byte)(supperPo.level.code + 1)) ; |
| | | } |
| | | po.deleted = Deleted.NO ; |
| | | count = this.sv.save(po); |
| | | } catch (Exception e) { |
| | | log.error("保存行政区异常", e); |