This commit is contained in:
2024-01-20 18:30:34 +08:00
parent 643c8796cd
commit 4cfbaf6367
2 changed files with 5 additions and 0 deletions

View File

@@ -63,6 +63,9 @@ public class VegeCellarReserveDetailsService extends MybatisBaseService<VegeCell
.eq("goodsSid",goods1.getGoodsSid()).eq("affiliation",dto.getAffiliation())).get(0);
double d=Double.valueOf(vegetableCellar.getGoodsNumber());
double c=Double.valueOf(goods1.getSelect());
if(c>d){
return rb.setMsg("预约数量大于库存数量");
}
if(Double.compare(d,c)==0){
vegetableCellarService.deleteBySid(vegetableCellar.getSid());
}else{

View File

@@ -34,6 +34,7 @@ import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
@@ -66,6 +67,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
// @Autowired
// private HttpServletResponse response;
//
@Transactional(rollbackFor = Exception.class)
public ResultBean submission(VegeCellarReserveOrderDto dto) {
ResultBean rb = new ResultBean().fail();
boolean b=isSatAndSun(dto.getReserveDate());