Search in sources :

Example 1 with HouseVillage

use of com.ruoyi.system.domain.HouseVillage in project Rental-Information-Platform by who1sBruce.

the class HouseRoomController method add.

/**
 * 新增房源详情
 */
@GetMapping("/add")
public String add(ModelMap mmap) {
    List<HouseVillage> list = houseVillageService.selectHouseVillageList(new HouseVillage());
    mmap.put("villageList", list);
    return prefix + "/add";
}
Also used : HouseVillage(com.ruoyi.system.domain.HouseVillage) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 2 with HouseVillage

use of com.ruoyi.system.domain.HouseVillage in project Rental-Information-Platform by who1sBruce.

the class HouseRoomController method edit.

/**
 * 修改房源详情
 */
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap) {
    HouseRoom houseRoom = houseRoomService.selectHouseRoomById(id);
    mmap.put("houseRoom", houseRoom);
    List<HouseVillage> list = houseVillageService.selectHouseVillageList(new HouseVillage());
    mmap.put("villageList", list);
    return prefix + "/edit";
}
Also used : HouseVillage(com.ruoyi.system.domain.HouseVillage) HouseRoom(com.ruoyi.system.domain.HouseRoom) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 3 with HouseVillage

use of com.ruoyi.system.domain.HouseVillage in project Rental-Information-Platform by who1sBruce.

the class HouseVillageController method edit.

/**
 * 修改房源小区
 */
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap) {
    HouseVillage houseVillage = houseVillageService.selectHouseVillageById(id);
    mmap.put("houseVillage", houseVillage);
    return prefix + "/edit";
}
Also used : HouseVillage(com.ruoyi.system.domain.HouseVillage) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 4 with HouseVillage

use of com.ruoyi.system.domain.HouseVillage in project Rental-Information-Platform by who1sBruce.

the class ApiHouseController method findVillageList.

/**
 * @Description: 获取小區信息
 * @date: 0714
 * @Return: AjaxResult
 */
@GetMapping("/findVillageList")
@ResponseBody
public AjaxResult findVillageList(HouseVillage houseVillage) {
    startPage();
    String msg = "小區列表";
    List<HouseVillage> list = houseVillageService.selectHouseVillageList(houseVillage);
    AjaxResult ajaxResult = new AjaxResult(AjaxResult.Type.SUCCESS, msg, list);
    return ajaxResult;
}
Also used : AjaxResult(com.ruoyi.common.core.domain.AjaxResult) HouseVillage(com.ruoyi.system.domain.HouseVillage)

Example 5 with HouseVillage

use of com.ruoyi.system.domain.HouseVillage in project Rental-Information-Platform by who1sBruce.

the class HouseRoomServiceImpl method insertHouseRoom.

/**
 * 新增房源详情
 *
 * @param houseRoom 房源详情
 * @return 结果
 */
@Override
public int insertHouseRoom(HouseRoom houseRoom) {
    houseRoom.setCreateTime(DateUtils.getNowDate());
    houseRoom.setCreateName(ShiroUtils.getSysUser().getUserName());
    houseRoom.setPublishId(ShiroUtils.getUserId());
    if (StringUtils.isEmpty(houseRoom.getVillageName())) {
        HouseVillage houseVillage = houseVillageService.selectHouseVillageById(houseRoom.getVillageId());
        houseRoom.setVillageName(houseVillage.getName());
    }
    if (StringUtils.isNull(houseRoom.getVillageId())) {
        HouseVillage houseVillage = new HouseVillage();
        houseVillage.setName(houseRoom.getVillageName());
        houseVillage = houseVillageService.selectHouseVillage(houseVillage);
        houseRoom.setVillageId(houseVillage.getId());
    }
    houseRoom.setCode(CodeUtil.getCodeByUUId());
    return houseRoomMapper.insertHouseRoom(houseRoom);
}
Also used : HouseVillage(com.ruoyi.system.domain.HouseVillage)

Aggregations

HouseVillage (com.ruoyi.system.domain.HouseVillage)6 GetMapping (org.springframework.web.bind.annotation.GetMapping)3 AjaxResult (com.ruoyi.common.core.domain.AjaxResult)1 HouseRoom (com.ruoyi.system.domain.HouseRoom)1 Date (java.util.Date)1