|
@@ -1,13 +1,22 @@
|
|
|
package org.jeecg.modules.rooms.controller;
|
|
package org.jeecg.modules.rooms.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.jeecg.common.Enum.ResultCode;
|
|
import org.jeecg.common.Enum.ResultCode;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
|
|
+import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
|
|
+import org.jeecg.common.exception.JeecgBootException;
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
|
|
+import org.jeecg.common.system.vo.LoginUser;
|
|
|
|
|
+import org.jeecg.common.util.TokenUtils;
|
|
|
|
|
+import org.jeecg.common.util.UUIDGenerator;
|
|
|
|
|
+import org.jeecg.modules.business.entity.BusMemberCard;
|
|
|
import org.jeecg.modules.rooms.DTO.CesGoodsDelDto;
|
|
import org.jeecg.modules.rooms.DTO.CesGoodsDelDto;
|
|
|
import org.jeecg.modules.rooms.DTO.CesGoodsDto;
|
|
import org.jeecg.modules.rooms.DTO.CesGoodsDto;
|
|
|
import org.jeecg.modules.rooms.DTO.CesGoodsSearchDto;
|
|
import org.jeecg.modules.rooms.DTO.CesGoodsSearchDto;
|
|
@@ -19,6 +28,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
import java.util.stream.Stream;
|
|
import java.util.stream.Stream;
|
|
@@ -152,5 +163,30 @@ public class CesGoodsController extends JeecgController<CesGoods,CesGoodsService
|
|
|
return Result.error(e.getMessage());
|
|
return Result.error(e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 添加临时菜品
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param cesGoods
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @AutoLog(value = "添加临时菜品")
|
|
|
|
|
+ @ApiOperation(value="添加临时菜品", notes="添加临时菜品")
|
|
|
|
|
+ @PostMapping(value = "/addTemp")
|
|
|
|
|
+ public Result<CesGoods> addTemp(@RequestBody CesGoods cesGoods) {
|
|
|
|
|
+ //临时
|
|
|
|
|
+ cesGoods.setIsTemp(true);
|
|
|
|
|
+ cesGoods.setInvalid(false);
|
|
|
|
|
+ cesGoods.setBarCode("");
|
|
|
|
|
+ cesGoods.setBid(BigDecimal.ZERO);
|
|
|
|
|
+ cesGoods.setPurchases(99999);
|
|
|
|
|
+ cesGoods.setInventory(99999);
|
|
|
|
|
+ cesGoods.setSalesVolume(0);
|
|
|
|
|
+ cesGoods.setCreatAt(LocalDateTime.now());
|
|
|
|
|
+ cesGoods.setUpdateAt(LocalDateTime.now());
|
|
|
|
|
+ cesGoods.setId(UUIDGenerator.generate());
|
|
|
|
|
+ goodsService.save(cesGoods);
|
|
|
|
|
+ return Result.OK(cesGoods);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|