| | |
| | | return R.status(routeinService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据区域id删除巡逻路线信息 |
| | | * @param regionId 区域id |
| | | * @return |
| | | */ |
| | | @PostMapping("/removeByRegionId") |
| | | public R removeByRegionId(@ApiParam(value = "主键集合", required = true) @RequestParam String regionId,HttpServletResponse response) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | return R.status(routeinService.removeByRegionId(regionId)); |
| | | } |
| | | |
| | | /** |
| | | * 巡逻路线新增 |
| | | * |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.routeIn.entity.Routein; |
| | | import org.springblade.modules.routeIn.vo.RouteinVO; |
| | | |
| | |
| | | void insertlx(Routein routein); |
| | | void updatelx(Integer id, String routeName, String regionId, String a, String rTime, String creatName, String remarks); |
| | | List<RouteinVO> selectList(String routeName,String id); |
| | | |
| | | /** |
| | | * 根据区域id删除巡逻路线信息 |
| | | * @param regionId 区域id |
| | | * @return |
| | | */ |
| | | int removeByRegionId(@Param("regionId") String regionId); |
| | | } |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <!--根据区域id删除巡逻路线信息--> |
| | | <delete id="removeByRegionId"> |
| | | delete from sys_routein where regionId = #{regionId} |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | void insertlx(Routein routein); |
| | | void updatelx(Integer id, String routeName, String regionId, String a, String rTime, String creatName, String remarks); |
| | | List<RouteinVO> selectList(String routeName,String id); |
| | | |
| | | /** |
| | | * 根据区域id删除巡逻路线信息 |
| | | * @param regionId 区域id |
| | | * @return |
| | | */ |
| | | Boolean removeByRegionId(String regionId); |
| | | } |
| | |
| | | import org.springblade.modules.routeIn.service.IRouteinService; |
| | | import org.springblade.modules.routeIn.vo.RouteinVO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | return baseMapper.selectList(routeName,id); |
| | | } |
| | | |
| | | /** |
| | | * 根据区域id删除巡逻路线信息 |
| | | * @param regionId 区域id |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean removeByRegionId(String regionId) { |
| | | int i = baseMapper.removeByRegionId(regionId); |
| | | if(i>0){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | |
| | | }) |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "懒加载列表", notes = "传入menu") |
| | | public R<List<RegionVO>> lazyTree(String parentCode, @ApiIgnore @RequestParam Map<String, Object> menu) { |
| | | public R<List<RegionVO>> lazyTree(String parentCode, @ApiIgnore @RequestParam Map<String, Object> menu,HttpServletResponse response) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | List<RegionVO> list = regionService.lazyTree(parentCode, menu); |
| | | return R.data(RegionWrapper.build().listNodeLazyVO(list)); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 自定义新增 行政区划表 |
| | | */ |
| | | @PostMapping("/saves") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "新增", notes = "传入region") |
| | | public R saves(@Valid @RequestBody Region region) { |
| | | int count = regionService.getByParentCodeCount(region.getParentCode()); |
| | | region.setCode(region.getParentCode()+count); |
| | | return R.status(regionService.save(region)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 行政区划表 |
| | | */ |
| | | @PostMapping("/update") |
| | |
| | | * @return |
| | | */ |
| | | Region selRegionDetail(@Param("districtName")String districtName,@Param("cityName") String cityName); |
| | | |
| | | /** |
| | | * 查询为当前父编码的个数 |
| | | * @param parentCode |
| | | * @return |
| | | */ |
| | | int getByParentCodeCount(@Param("parentCode") String parentCode); |
| | | } |
| | |
| | | <select id="selRegionDetail" resultType="org.springblade.modules.system.entity.Region"> |
| | | SELECT * FROM blade_region where district_name = #{districtName} and city_name = #{cityName} |
| | | </select> |
| | | |
| | | <!--查询为当前父编码的个数--> |
| | | <select id="getByParentCodeCount" resultType="java.lang.Integer"> |
| | | select ifnull(count(*),0) num from blade_region |
| | | where parent_code = #{parentCode} |
| | | </select> |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | Region selRegionDetail(@Param("districtName")String districtName, @Param("cityName") String cityName); |
| | | |
| | | /** |
| | | * 查询为当前父编码的个数 |
| | | * @param parentCode |
| | | * @return |
| | | */ |
| | | int getByParentCodeCount(String parentCode); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询为当前父编码的个数 |
| | | * @param parentCode |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int getByParentCodeCount(String parentCode) { |
| | | return baseMapper.getByParentCodeCount(parentCode); |
| | | } |
| | | } |