| | |
| | | import com.gkhy.assess.system.domain.SysRegion; |
| | | import com.gkhy.assess.system.mapper.SysRegionMapper; |
| | | import com.gkhy.assess.system.service.SysRegionService; |
| | | import com.gkhy.assess.system.utils.ShiroUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | throw new ApiException("已存在相同地区名称"); |
| | | } |
| | | region.setRegionType(RegionTypeEnum.INSIDE.getCode()); |
| | | region.setCreateBy(ShiroUtils.getSysUser().getUsername()); |
| | | boolean b=save(region); |
| | | if(!b){ |
| | | throw new ApiException("新增地区失败"); |
| | |
| | | if(!checkRegionUnique(region)){ |
| | | throw new ApiException("已存在相同地区名称"); |
| | | } |
| | | region.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | boolean b=updateById(region); |
| | | if(!b){ |
| | | throw new ApiException("修改地区失败"); |