|
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
@@ -129,6 +130,34 @@ public class CesRoomLayoutPriceDateController extends JeecgController<CesRoomLay
|
|
|
cesRoomLayoutPriceDateService.updateById(cesRoomLayoutPriceDate);
|
|
cesRoomLayoutPriceDateService.updateById(cesRoomLayoutPriceDate);
|
|
|
return Result.OK("编辑成功!");
|
|
return Result.OK("编辑成功!");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 编辑价格
|
|
|
|
|
+ * @param cesRoomLayoutPriceDate
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @AutoLog(value = "ces_room_layout_price_date-编辑")
|
|
|
|
|
+ @ApiOperation(value="ces_room_layout_price_date-编辑", notes="ces_room_layout_price_date-编辑")
|
|
|
|
|
+ //@RequiresPermissions("rooms:ces_room_layout_price_date:edit")
|
|
|
|
|
+ @RequestMapping(value = "/editPrice", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
|
|
+ public Result<String> editPrice(@RequestBody CesRoomLayoutPriceDate cesRoomLayoutPriceDate) {
|
|
|
|
|
+ LambdaQueryWrapper<CesRoomLayoutPriceDate> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ lambdaQueryWrapper.eq(CesRoomLayoutPriceDate::getRoomLayoutPriceId, cesRoomLayoutPriceDate.getRoomLayoutPriceId());
|
|
|
|
|
+ lambdaQueryWrapper.eq(CesRoomLayoutPriceDate::getDate, cesRoomLayoutPriceDate.getDate());
|
|
|
|
|
+ CesRoomLayoutPriceDate roomLayoutPriceDate = cesRoomLayoutPriceDateService.getOne(lambdaQueryWrapper);
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(roomLayoutPriceDate)) {
|
|
|
|
|
+ roomLayoutPriceDate.setPrice(cesRoomLayoutPriceDate.getPrice());
|
|
|
|
|
+ cesRoomLayoutPriceDateService.updateById(roomLayoutPriceDate);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ roomLayoutPriceDate=new CesRoomLayoutPriceDate();
|
|
|
|
|
+ roomLayoutPriceDate.setRoomLayoutPriceId(cesRoomLayoutPriceDate.getRoomLayoutPriceId());
|
|
|
|
|
+ roomLayoutPriceDate.setDate(cesRoomLayoutPriceDate.getDate());
|
|
|
|
|
+ roomLayoutPriceDate.setPrice(cesRoomLayoutPriceDate.getPrice());
|
|
|
|
|
+ roomLayoutPriceDate.setCreateDate(new Date());
|
|
|
|
|
+ cesRoomLayoutPriceDateService.save(roomLayoutPriceDate);
|
|
|
|
|
+ }
|
|
|
|
|
+ return Result.OK("编辑成功!");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 通过id删除
|
|
* 通过id删除
|