|
|
@@ -15,7 +15,10 @@ import com.uas.platform.b2c.prod.commodity.type.ProductConstant;
|
|
|
import com.uas.platform.b2c.prod.product.brand.dao.BrandDao;
|
|
|
import com.uas.platform.b2c.prod.product.brand.modal.Brand;
|
|
|
import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
|
|
|
+import com.uas.platform.b2c.prod.product.component.dao.ComponentSubmitDao;
|
|
|
import com.uas.platform.b2c.prod.product.component.modal.Component;
|
|
|
+import com.uas.platform.b2c.prod.product.component.modal.ComponentSubmit;
|
|
|
+import com.uas.platform.b2c.prod.product.kind.model.Kind;
|
|
|
import com.uas.platform.b2c.trade.order.dao.OrderDetailDao;
|
|
|
import com.uas.platform.b2c.trade.order.model.Order;
|
|
|
import com.uas.platform.b2c.trade.order.model.Purchase;
|
|
|
@@ -118,6 +121,9 @@ public class ProductServiceImpl implements ProductService {
|
|
|
@Autowired
|
|
|
private OrderDetailDao orderDetailDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ComponentSubmitDao componentSubmitDao;
|
|
|
+
|
|
|
private ConcurrentHashMap<String, Field> sortFields = new ConcurrentHashMap<String, Field>();
|
|
|
|
|
|
@Override
|
|
|
@@ -624,5 +630,39 @@ public class ProductServiceImpl implements ProductService {
|
|
|
|
|
|
return productDetail;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Component validitonStandard(JSONObject jsonObject) {
|
|
|
+ Component component = (Component)jsonObject.get("component");
|
|
|
+ if (component == null || component.getCode() == null)
|
|
|
+ throw new IllegalOperatorException("请填写器件原厂型号");
|
|
|
+ Brand brand = (Brand)jsonObject.get("brand");
|
|
|
+ if (brand == null || brand.getNameEn() == null)
|
|
|
+ throw new IllegalOperatorException("请填写品牌英文名");
|
|
|
+ List<Brand> brands = brandDao.findByNameEn(brand.getNameEn());
|
|
|
+ if (CollectionUtils.isEmpty(brands))
|
|
|
+ throw new IllegalOperatorException(("商城不存在:" + brand.getNameEn() + " 品牌,请选择商城品牌或申请该品牌"));
|
|
|
+ List<Component> componentMatched = componentDao.findByCodeAndBrandid(component.getCode(), brands.get(0).getId());
|
|
|
+ if (CollectionUtils.isEmpty(componentMatched)) {// 提交申请为非标准器件则转成器件申请
|
|
|
+ Kind kind = (Kind)jsonObject.get("kind");
|
|
|
+ if (kind == null || kind.getId() == null)
|
|
|
+ throw new IllegalOperatorException("请选择商城类目");
|
|
|
+ String attach = jsonObject.getString("attach");
|
|
|
+ if (attach == null)
|
|
|
+ throw new IllegalOperatorException("请上传规格书");
|
|
|
+ ComponentSubmit submit = new ComponentSubmit();
|
|
|
+ submit.setAttach(attach);
|
|
|
+ submit.setBrandid(brands.get(0).getId());
|
|
|
+ submit.setCode(component.getCode());
|
|
|
+ submit.setDefineentuu(SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ submit.setDefineuu(SystemSession.getUser().getUserUU());
|
|
|
+ submit.setDefinetime(new Date());
|
|
|
+ submit.setIsUpdate(0);
|
|
|
+ submit.setKindid(kind.getId());
|
|
|
+
|
|
|
+ componentSubmitDao.save(submit);
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
|