|
@@ -15,6 +15,7 @@ import com.management.platform.service.SysFunctionService;
|
|
|
import com.management.platform.service.WxCorpInfoService;
|
|
|
import com.management.platform.service.impl.ExcelExportServiceImpl;
|
|
|
import com.management.platform.util.HttpRespMsg;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
@@ -261,6 +262,15 @@ public class BusinessOpportunityController {
|
|
|
bo.setUserId(user.getId());
|
|
|
bo.setCreateTime(new Date());
|
|
|
bo.setIsDelete(0);
|
|
|
+ if(StringUtils.isNotBlank(bo.getBusinessItemProductList())){
|
|
|
+ List<BusinessItemProduct> businessItemProducts = JSONArray.parseArray(bo.getBusinessItemProductList(), BusinessItemProduct.class);
|
|
|
+ for (BusinessItemProduct businessItemProduct : businessItemProducts) {
|
|
|
+ if(businessItemProduct.getQuantity() > businessItemProduct.getInventory()){
|
|
|
+ msg.setError("["+businessItemProduct.getProductName()+"]产品数量不能大于库存");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
QueryWrapper<BusinessOpportunity> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("stage_id", bo.getStageId()).eq("is_delete",0).orderByDesc("seq").last("limit 1");
|
|
|
List<BusinessOpportunity> list = bOservice.list(queryWrapper);
|