|
@@ -4,13 +4,14 @@ import com.uas.api.b2c_erp.baisc.model.*;
|
|
|
import com.uas.api.b2c_erp.operation.model.OperationInfoUas;
|
|
import com.uas.api.b2c_erp.operation.model.OperationInfoUas;
|
|
|
import com.uas.api.b2c_erp.seller.model.GoodsSimpleUas;
|
|
import com.uas.api.b2c_erp.seller.model.GoodsSimpleUas;
|
|
|
import com.uas.api.b2c_erp.seller.model.Prod;
|
|
import com.uas.api.b2c_erp.seller.model.Prod;
|
|
|
|
|
+import com.uas.api.b2c_erp.seller.model.ProductReplaceErp;
|
|
|
import com.uas.api.domain.IPage;
|
|
import com.uas.api.domain.IPage;
|
|
|
import com.uas.platform.b2c.common.account.model.Enterprise;
|
|
import com.uas.platform.b2c.common.account.model.Enterprise;
|
|
|
import com.uas.platform.b2c.core.constant.Status;
|
|
import com.uas.platform.b2c.core.constant.Status;
|
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
import com.uas.platform.b2c.external.erp.product.model.OperationInfo;
|
|
import com.uas.platform.b2c.external.erp.product.model.OperationInfo;
|
|
|
import com.uas.platform.b2c.prod.commodity.model.Product;
|
|
import com.uas.platform.b2c.prod.commodity.model.Product;
|
|
|
-import com.uas.platform.b2c.prod.commodity.model.ProductPrivate;
|
|
|
|
|
|
|
+import com.uas.platform.b2c.prod.commodity.model.ProductReplace;
|
|
|
import com.uas.platform.b2c.prod.product.brand.modal.Brand;
|
|
import com.uas.platform.b2c.prod.product.brand.modal.Brand;
|
|
|
import com.uas.platform.b2c.prod.product.brand.modal.BrandInfo;
|
|
import com.uas.platform.b2c.prod.product.brand.modal.BrandInfo;
|
|
|
import com.uas.platform.b2c.prod.product.brand.modal.BrandSubmit;
|
|
import com.uas.platform.b2c.prod.product.brand.modal.BrandSubmit;
|
|
@@ -30,511 +31,556 @@ import java.util.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* erp<==>商城对象转换类
|
|
* erp<==>商城对象转换类
|
|
|
|
|
+ *
|
|
|
* @author suntg
|
|
* @author suntg
|
|
|
* @version 2017年8月2日19:48:50 wangyc 完善注释
|
|
* @version 2017年8月2日19:48:50 wangyc 完善注释
|
|
|
*/
|
|
*/
|
|
|
public class ModelConverter {
|
|
public class ModelConverter {
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 将UAS品牌申请转换成brandSubmit
|
|
|
|
|
- *
|
|
|
|
|
- * @param uas UAS品牌申请
|
|
|
|
|
- * @return 商城品牌申请
|
|
|
|
|
- */
|
|
|
|
|
- public static BrandSubmit getBrandSubmit(BrandSubmitUas uas) {
|
|
|
|
|
- BrandSubmit brandSubmit = new BrandSubmit();
|
|
|
|
|
- brandSubmit.setId(uas.getId());
|
|
|
|
|
- brandSubmit.setApplication(uas.getApplication());
|
|
|
|
|
- brandSubmit.setAchievement(uas.getAchievement());
|
|
|
|
|
- brandSubmit.setArea(uas.getArea());
|
|
|
|
|
- brandSubmit.setBrief(uas.getBrief());
|
|
|
|
|
- brandSubmit.setUrl(uas.getUrl());
|
|
|
|
|
- brandSubmit.setLogoUrl(uas.getLogoUrl());
|
|
|
|
|
- brandSubmit.setNameCn(uas.getNameCn());
|
|
|
|
|
- brandSubmit.setNameEn(uas.getNameEn());
|
|
|
|
|
- brandSubmit.setSeries(uas.getSeries());
|
|
|
|
|
- brandSubmit.setVendor(uas.getVendor());
|
|
|
|
|
- brandSubmit.setSource("来自接口");
|
|
|
|
|
- brandSubmit.setImid(uas.getImid());
|
|
|
|
|
- brandSubmit.setUuid(uas.getUuid());
|
|
|
|
|
- brandSubmit.setVersion(uas.getVersion());
|
|
|
|
|
- brandSubmit.setModifyenuu(uas.getModifyenuu());
|
|
|
|
|
- brandSubmit.setModifyuu(uas.getModifyuu());
|
|
|
|
|
- return brandSubmit;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 将UAS品牌申请转换成brandSubmit
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param uas UAS品牌申请
|
|
|
|
|
+ * @return 商城品牌申请
|
|
|
|
|
+ */
|
|
|
|
|
+ public static BrandSubmit getBrandSubmit(BrandSubmitUas uas) {
|
|
|
|
|
+ BrandSubmit brandSubmit = new BrandSubmit();
|
|
|
|
|
+ brandSubmit.setId(uas.getId());
|
|
|
|
|
+ brandSubmit.setApplication(uas.getApplication());
|
|
|
|
|
+ brandSubmit.setAchievement(uas.getAchievement());
|
|
|
|
|
+ brandSubmit.setArea(uas.getArea());
|
|
|
|
|
+ brandSubmit.setBrief(uas.getBrief());
|
|
|
|
|
+ brandSubmit.setUrl(uas.getUrl());
|
|
|
|
|
+ brandSubmit.setLogoUrl(uas.getLogoUrl());
|
|
|
|
|
+ brandSubmit.setNameCn(uas.getNameCn());
|
|
|
|
|
+ brandSubmit.setNameEn(uas.getNameEn());
|
|
|
|
|
+ brandSubmit.setSeries(uas.getSeries());
|
|
|
|
|
+ brandSubmit.setVendor(uas.getVendor());
|
|
|
|
|
+ brandSubmit.setSource("来自接口");
|
|
|
|
|
+ brandSubmit.setImid(uas.getImid());
|
|
|
|
|
+ brandSubmit.setUuid(uas.getUuid());
|
|
|
|
|
+ brandSubmit.setVersion(uas.getVersion());
|
|
|
|
|
+ brandSubmit.setModifyenuu(uas.getModifyenuu());
|
|
|
|
|
+ brandSubmit.setModifyuu(uas.getModifyuu());
|
|
|
|
|
+ return brandSubmit;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 属性值转换为uas属性申请
|
|
|
|
|
- * @param property 属性值
|
|
|
|
|
- * @return uas属性申请
|
|
|
|
|
- */
|
|
|
|
|
- public static PropertySubmitUas convertUas(PropertyValue property) {
|
|
|
|
|
- PropertySubmitUas uas = new PropertySubmitUas();
|
|
|
|
|
- uas.setPropertyId(property.getPropertyid());
|
|
|
|
|
- uas.setStringValue(property.getValue());
|
|
|
|
|
- uas.setMax(property.getMax());
|
|
|
|
|
- uas.setMin(property.getMin());
|
|
|
|
|
- uas.setNumberic(property.getNumberic());
|
|
|
|
|
- uas.setDetno(property.getDetno());
|
|
|
|
|
- return uas;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 属性值转换为uas属性申请
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param property 属性值
|
|
|
|
|
+ * @return uas属性申请
|
|
|
|
|
+ */
|
|
|
|
|
+ public static PropertySubmitUas convertUas(PropertyValue property) {
|
|
|
|
|
+ PropertySubmitUas uas = new PropertySubmitUas();
|
|
|
|
|
+ uas.setPropertyId(property.getPropertyid());
|
|
|
|
|
+ uas.setStringValue(property.getValue());
|
|
|
|
|
+ uas.setMax(property.getMax());
|
|
|
|
|
+ uas.setMin(property.getMin());
|
|
|
|
|
+ uas.setNumberic(property.getNumberic());
|
|
|
|
|
+ uas.setDetno(property.getDetno());
|
|
|
|
|
+ return uas;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 品牌转换为uas品牌申请
|
|
|
|
|
- * @param brand 品牌
|
|
|
|
|
- * @return uas品牌申请
|
|
|
|
|
- */
|
|
|
|
|
- public static BrandSubmitUas convertUas(Brand brand) {
|
|
|
|
|
- BrandSubmitUas uas = new BrandSubmitUas();
|
|
|
|
|
- uas.setId(brand.getId());
|
|
|
|
|
- uas.setApplication(brand.getApplication());
|
|
|
|
|
- uas.setAchievement(brand.getAchievement());
|
|
|
|
|
- uas.setArea(brand.getArea());
|
|
|
|
|
- uas.setBrief(brand.getBrief());
|
|
|
|
|
- uas.setUrl(brand.getUrl());
|
|
|
|
|
- uas.setLogoUrl(brand.getLogoUrl());
|
|
|
|
|
- uas.setNameCn(brand.getNameCn());
|
|
|
|
|
- uas.setNameEn(brand.getNameEn());
|
|
|
|
|
- uas.setSeries(brand.getSeries());
|
|
|
|
|
- uas.setUuid(brand.getUuid());
|
|
|
|
|
- uas.setVendor(brand.getVendor());
|
|
|
|
|
- uas.setVersion(brand.getVersion());
|
|
|
|
|
- return uas;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 品牌转换为uas品牌申请
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param brand 品牌
|
|
|
|
|
+ * @return uas品牌申请
|
|
|
|
|
+ */
|
|
|
|
|
+ public static BrandSubmitUas convertUas(Brand brand) {
|
|
|
|
|
+ BrandSubmitUas uas = new BrandSubmitUas();
|
|
|
|
|
+ uas.setId(brand.getId());
|
|
|
|
|
+ uas.setApplication(brand.getApplication());
|
|
|
|
|
+ uas.setAchievement(brand.getAchievement());
|
|
|
|
|
+ uas.setArea(brand.getArea());
|
|
|
|
|
+ uas.setBrief(brand.getBrief());
|
|
|
|
|
+ uas.setUrl(brand.getUrl());
|
|
|
|
|
+ uas.setLogoUrl(brand.getLogoUrl());
|
|
|
|
|
+ uas.setNameCn(brand.getNameCn());
|
|
|
|
|
+ uas.setNameEn(brand.getNameEn());
|
|
|
|
|
+ uas.setSeries(brand.getSeries());
|
|
|
|
|
+ uas.setUuid(brand.getUuid());
|
|
|
|
|
+ uas.setVendor(brand.getVendor());
|
|
|
|
|
+ uas.setVersion(brand.getVersion());
|
|
|
|
|
+ return uas;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 器件信息转换为uas器件申请
|
|
|
|
|
- * @param component 器件信息
|
|
|
|
|
- * @return uas器件申请
|
|
|
|
|
- */
|
|
|
|
|
- public static ComponentSubmitUas convertUas(Component component) {
|
|
|
|
|
- ComponentSubmitUas uas = new ComponentSubmitUas();
|
|
|
|
|
- uas.setUuid(component.getUuid());
|
|
|
|
|
- uas.setAttach(component.getAttach());
|
|
|
|
|
- uas.setUnit(component.getUnit());
|
|
|
|
|
- uas.setWeight(component.getWeight());
|
|
|
|
|
- uas.setCode(component.getCode());
|
|
|
|
|
- uas.setBrandid(component.getBrandid());
|
|
|
|
|
- uas.setKindid(component.getKindid());
|
|
|
|
|
- uas.setDescription(component.getDescription());
|
|
|
|
|
- uas.setImg(component.getImg());
|
|
|
|
|
- uas.setPackaging(component.getEncapsulation());
|
|
|
|
|
- uas.setVersion(component.getVersion());
|
|
|
|
|
- uas.setBrandName(component.getBrand().getNameCn());
|
|
|
|
|
- uas.setKindNameCn(component.getKind().getNameCn());
|
|
|
|
|
- Set<PropertySubmitUas> uasProperties = new HashSet<PropertySubmitUas>();
|
|
|
|
|
- for (PropertyValue property : component.getProperties()) {
|
|
|
|
|
- PropertySubmitUas uasProperty = ModelConverter.convertUas(property);
|
|
|
|
|
- uasProperties.add(uasProperty);
|
|
|
|
|
- }
|
|
|
|
|
- uas.setProperties(uasProperties);
|
|
|
|
|
- return uas;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 器件信息转换为uas器件申请
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param component 器件信息
|
|
|
|
|
+ * @return uas器件申请
|
|
|
|
|
+ */
|
|
|
|
|
+ public static ComponentSubmitUas convertUas(Component component) {
|
|
|
|
|
+ ComponentSubmitUas uas = new ComponentSubmitUas();
|
|
|
|
|
+ uas.setUuid(component.getUuid());
|
|
|
|
|
+ uas.setAttach(component.getAttach());
|
|
|
|
|
+ uas.setUnit(component.getUnit());
|
|
|
|
|
+ uas.setWeight(component.getWeight());
|
|
|
|
|
+ uas.setCode(component.getCode());
|
|
|
|
|
+ uas.setBrandid(component.getBrandid());
|
|
|
|
|
+ uas.setKindid(component.getKindid());
|
|
|
|
|
+ uas.setDescription(component.getDescription());
|
|
|
|
|
+ uas.setImg(component.getImg());
|
|
|
|
|
+ uas.setPackaging(component.getEncapsulation());
|
|
|
|
|
+ uas.setVersion(component.getVersion());
|
|
|
|
|
+ uas.setBrandName(component.getBrand().getNameCn());
|
|
|
|
|
+ uas.setKindNameCn(component.getKind().getNameCn());
|
|
|
|
|
+ Set<PropertySubmitUas> uasProperties = new HashSet<PropertySubmitUas>();
|
|
|
|
|
+ for (PropertyValue property : component.getProperties()) {
|
|
|
|
|
+ PropertySubmitUas uasProperty = ModelConverter.convertUas(property);
|
|
|
|
|
+ uasProperties.add(uasProperty);
|
|
|
|
|
+ }
|
|
|
|
|
+ uas.setProperties(uasProperties);
|
|
|
|
|
+ return uas;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * uas器件申请转换为商城器件申请
|
|
|
|
|
- * @param uas uas器件申请
|
|
|
|
|
- * @return 商城器件申请
|
|
|
|
|
- */
|
|
|
|
|
- public static ComponentSubmit getComponentSubmit(ComponentSubmitUas uas) {
|
|
|
|
|
- ComponentSubmit componentSubmit = new ComponentSubmit();
|
|
|
|
|
- componentSubmit.setId(uas.getId());
|
|
|
|
|
- componentSubmit.setCode(uas.getCode());
|
|
|
|
|
- componentSubmit.setEncapsulation(uas.getPackaging());
|
|
|
|
|
- componentSubmit.setKindid(uas.getKindid());
|
|
|
|
|
- componentSubmit.setKindName(uas.getKindNameCn());
|
|
|
|
|
- componentSubmit.setBrandid(uas.getBrandid());
|
|
|
|
|
- componentSubmit.setBrandName(uas.getBrandName());
|
|
|
|
|
- componentSubmit.setUuid(uas.getUuid());
|
|
|
|
|
- componentSubmit.setVersion(uas.getVersion());
|
|
|
|
|
- componentSubmit.setImg(uas.getImg());
|
|
|
|
|
- componentSubmit.setDescription(uas.getDescription());
|
|
|
|
|
- componentSubmit.setImid(uas.getImid());
|
|
|
|
|
- componentSubmit.setWeight(uas.getWeight());
|
|
|
|
|
- componentSubmit.setUnit(uas.getUnit());
|
|
|
|
|
- componentSubmit.setAttach(uas.getAttach());
|
|
|
|
|
- componentSubmit.setSource("来自接口");
|
|
|
|
|
- componentSubmit.setModifyenuu(uas.getModifyenuu());
|
|
|
|
|
- componentSubmit.setModifyuu(uas.getModifyuu());
|
|
|
|
|
- Set<PropertySubmitUas> propertiesUas = uas.getProperties();
|
|
|
|
|
- Set<PropertyValueSubmit> properties = new HashSet<PropertyValueSubmit>();
|
|
|
|
|
- for (PropertySubmitUas propertyUas : propertiesUas) {
|
|
|
|
|
- PropertyValueSubmit property = new PropertyValueSubmit();
|
|
|
|
|
- property.setPropertyid(propertyUas.getPropertyId());
|
|
|
|
|
- property.setDetno(propertyUas.getDetno());
|
|
|
|
|
- property.setStringValue(propertyUas.getStringValue());
|
|
|
|
|
- property.setNumberic(propertyUas.getNumberic());
|
|
|
|
|
- property.setUnit(propertyUas.getUnit());
|
|
|
|
|
- property.setMin(propertyUas.getMin());
|
|
|
|
|
- property.setMax(propertyUas.getMax());
|
|
|
|
|
- properties.add(property);
|
|
|
|
|
- }
|
|
|
|
|
- componentSubmit.setProperties(properties);
|
|
|
|
|
- return componentSubmit;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * uas器件申请转换为商城器件申请
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param uas uas器件申请
|
|
|
|
|
+ * @return 商城器件申请
|
|
|
|
|
+ */
|
|
|
|
|
+ public static ComponentSubmit getComponentSubmit(ComponentSubmitUas uas) {
|
|
|
|
|
+ ComponentSubmit componentSubmit = new ComponentSubmit();
|
|
|
|
|
+ componentSubmit.setId(uas.getId());
|
|
|
|
|
+ componentSubmit.setCode(uas.getCode());
|
|
|
|
|
+ componentSubmit.setEncapsulation(uas.getPackaging());
|
|
|
|
|
+ componentSubmit.setKindid(uas.getKindid());
|
|
|
|
|
+ componentSubmit.setKindName(uas.getKindNameCn());
|
|
|
|
|
+ componentSubmit.setBrandid(uas.getBrandid());
|
|
|
|
|
+ componentSubmit.setBrandName(uas.getBrandName());
|
|
|
|
|
+ componentSubmit.setUuid(uas.getUuid());
|
|
|
|
|
+ componentSubmit.setVersion(uas.getVersion());
|
|
|
|
|
+ componentSubmit.setImg(uas.getImg());
|
|
|
|
|
+ componentSubmit.setDescription(uas.getDescription());
|
|
|
|
|
+ componentSubmit.setImid(uas.getImid());
|
|
|
|
|
+ componentSubmit.setWeight(uas.getWeight());
|
|
|
|
|
+ componentSubmit.setUnit(uas.getUnit());
|
|
|
|
|
+ componentSubmit.setAttach(uas.getAttach());
|
|
|
|
|
+ componentSubmit.setSource("来自接口");
|
|
|
|
|
+ componentSubmit.setModifyenuu(uas.getModifyenuu());
|
|
|
|
|
+ componentSubmit.setModifyuu(uas.getModifyuu());
|
|
|
|
|
+ Set<PropertySubmitUas> propertiesUas = uas.getProperties();
|
|
|
|
|
+ Set<PropertyValueSubmit> properties = new HashSet<PropertyValueSubmit>();
|
|
|
|
|
+ for (PropertySubmitUas propertyUas : propertiesUas) {
|
|
|
|
|
+ PropertyValueSubmit property = new PropertyValueSubmit();
|
|
|
|
|
+ property.setPropertyid(propertyUas.getPropertyId());
|
|
|
|
|
+ property.setDetno(propertyUas.getDetno());
|
|
|
|
|
+ property.setStringValue(propertyUas.getStringValue());
|
|
|
|
|
+ property.setNumberic(propertyUas.getNumberic());
|
|
|
|
|
+ property.setUnit(propertyUas.getUnit());
|
|
|
|
|
+ property.setMin(propertyUas.getMin());
|
|
|
|
|
+ property.setMax(propertyUas.getMax());
|
|
|
|
|
+ properties.add(property);
|
|
|
|
|
+ }
|
|
|
|
|
+ componentSubmit.setProperties(properties);
|
|
|
|
|
+ return componentSubmit;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 商城器件申请转换为uas器件申请
|
|
|
|
|
- * @param componentSubmit 商城器件申请
|
|
|
|
|
- * @return uas器件申请
|
|
|
|
|
- */
|
|
|
|
|
- public static ComponentSubmitUasInfo convertUasInfo(ComponentSubmit componentSubmit) {
|
|
|
|
|
- ComponentSubmitUasInfo uas = new ComponentSubmitUasInfo();
|
|
|
|
|
- uas.setId(componentSubmit.getId());
|
|
|
|
|
- uas.setUuid(componentSubmit.getUuid());
|
|
|
|
|
- uas.setCode(componentSubmit.getCode());
|
|
|
|
|
- uas.setKindid(componentSubmit.getKindid());
|
|
|
|
|
- uas.setBrandid(componentSubmit.getBrandid());
|
|
|
|
|
- uas.setImg(componentSubmit.getImg());
|
|
|
|
|
- uas.setStatus(componentSubmit.getStatus());
|
|
|
|
|
- uas.setAuditOpinion(componentSubmit.getAuditOpinion());
|
|
|
|
|
- return uas;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商城器件申请转换为uas器件申请
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param componentSubmit 商城器件申请
|
|
|
|
|
+ * @return uas器件申请
|
|
|
|
|
+ */
|
|
|
|
|
+ public static ComponentSubmitUasInfo convertUasInfo(ComponentSubmit componentSubmit) {
|
|
|
|
|
+ ComponentSubmitUasInfo uas = new ComponentSubmitUasInfo();
|
|
|
|
|
+ uas.setId(componentSubmit.getId());
|
|
|
|
|
+ uas.setUuid(componentSubmit.getUuid());
|
|
|
|
|
+ uas.setCode(componentSubmit.getCode());
|
|
|
|
|
+ uas.setKindid(componentSubmit.getKindid());
|
|
|
|
|
+ uas.setBrandid(componentSubmit.getBrandid());
|
|
|
|
|
+ uas.setImg(componentSubmit.getImg());
|
|
|
|
|
+ uas.setStatus(componentSubmit.getStatus());
|
|
|
|
|
+ uas.setAuditOpinion(componentSubmit.getAuditOpinion());
|
|
|
|
|
+ return uas;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 商城器件申请转换为uas器件申请
|
|
|
|
|
- * @param componentSubmit 商城器件申请
|
|
|
|
|
- * @return uas器件申请
|
|
|
|
|
- */
|
|
|
|
|
- public static ComponentSubmitUas convertUas(ComponentSubmit componentSubmit) {
|
|
|
|
|
- ComponentSubmitUas uas = new ComponentSubmitUas();
|
|
|
|
|
- uas.setId(componentSubmit.getId());
|
|
|
|
|
- uas.setUuid(componentSubmit.getUuid());
|
|
|
|
|
- uas.setStatus(componentSubmit.getStatus());
|
|
|
|
|
- uas.setCode(componentSubmit.getCode());
|
|
|
|
|
- uas.setVersion(componentSubmit.getVersion());
|
|
|
|
|
- uas.setPackaging(componentSubmit.getEncapsulation());
|
|
|
|
|
- uas.setBrandid(componentSubmit.getBrandid());
|
|
|
|
|
- uas.setKindid(componentSubmit.getKindid());
|
|
|
|
|
- uas.setImid(componentSubmit.getImid());
|
|
|
|
|
- uas.setImg(componentSubmit.getImg());
|
|
|
|
|
- uas.setWeight(componentSubmit.getWeight());
|
|
|
|
|
- uas.setUnit(componentSubmit.getUnit());
|
|
|
|
|
- uas.setAttach(componentSubmit.getAttach());
|
|
|
|
|
- uas.setDescription(componentSubmit.getDescription());
|
|
|
|
|
- uas.setModifyenuu(componentSubmit.getModifyenuu());
|
|
|
|
|
- uas.setModifyuu(componentSubmit.getModifyuu());
|
|
|
|
|
- Set<PropertySubmitUas> propertiesUas = new HashSet<PropertySubmitUas>();
|
|
|
|
|
- for (PropertyValueSubmit property : componentSubmit.getProperties()) {
|
|
|
|
|
- PropertySubmitUas propertyUas = new PropertySubmitUas();
|
|
|
|
|
- propertyUas.setPropertyId(property.getPropertyid());
|
|
|
|
|
- propertyUas.setDetno(property.getDetno());
|
|
|
|
|
- propertyUas.setStringValue(property.getStringValue());
|
|
|
|
|
- propertyUas.setPropertyName(property.getProperty().getLabelCn());
|
|
|
|
|
- propertyUas.setNumberic(property.getNumberic());
|
|
|
|
|
- propertyUas.setMin(property.getMin());
|
|
|
|
|
- propertyUas.setMax(property.getMax());
|
|
|
|
|
- propertyUas.setUnit(property.getUnit());
|
|
|
|
|
- propertiesUas.add(propertyUas);
|
|
|
|
|
- }
|
|
|
|
|
- uas.setProperties(propertiesUas);
|
|
|
|
|
- return uas;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商城器件申请转换为uas器件申请
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param componentSubmit 商城器件申请
|
|
|
|
|
+ * @return uas器件申请
|
|
|
|
|
+ */
|
|
|
|
|
+ public static ComponentSubmitUas convertUas(ComponentSubmit componentSubmit) {
|
|
|
|
|
+ ComponentSubmitUas uas = new ComponentSubmitUas();
|
|
|
|
|
+ uas.setId(componentSubmit.getId());
|
|
|
|
|
+ uas.setUuid(componentSubmit.getUuid());
|
|
|
|
|
+ uas.setStatus(componentSubmit.getStatus());
|
|
|
|
|
+ uas.setCode(componentSubmit.getCode());
|
|
|
|
|
+ uas.setVersion(componentSubmit.getVersion());
|
|
|
|
|
+ uas.setPackaging(componentSubmit.getEncapsulation());
|
|
|
|
|
+ uas.setBrandid(componentSubmit.getBrandid());
|
|
|
|
|
+ uas.setKindid(componentSubmit.getKindid());
|
|
|
|
|
+ uas.setImid(componentSubmit.getImid());
|
|
|
|
|
+ uas.setImg(componentSubmit.getImg());
|
|
|
|
|
+ uas.setWeight(componentSubmit.getWeight());
|
|
|
|
|
+ uas.setUnit(componentSubmit.getUnit());
|
|
|
|
|
+ uas.setAttach(componentSubmit.getAttach());
|
|
|
|
|
+ uas.setDescription(componentSubmit.getDescription());
|
|
|
|
|
+ uas.setModifyenuu(componentSubmit.getModifyenuu());
|
|
|
|
|
+ uas.setModifyuu(componentSubmit.getModifyuu());
|
|
|
|
|
+ Set<PropertySubmitUas> propertiesUas = new HashSet<PropertySubmitUas>();
|
|
|
|
|
+ for (PropertyValueSubmit property : componentSubmit.getProperties()) {
|
|
|
|
|
+ PropertySubmitUas propertyUas = new PropertySubmitUas();
|
|
|
|
|
+ propertyUas.setPropertyId(property.getPropertyid());
|
|
|
|
|
+ propertyUas.setDetno(property.getDetno());
|
|
|
|
|
+ propertyUas.setStringValue(property.getStringValue());
|
|
|
|
|
+ propertyUas.setPropertyName(property.getProperty().getLabelCn());
|
|
|
|
|
+ propertyUas.setNumberic(property.getNumberic());
|
|
|
|
|
+ propertyUas.setMin(property.getMin());
|
|
|
|
|
+ propertyUas.setMax(property.getMax());
|
|
|
|
|
+ propertyUas.setUnit(property.getUnit());
|
|
|
|
|
+ propertiesUas.add(propertyUas);
|
|
|
|
|
+ }
|
|
|
|
|
+ uas.setProperties(propertiesUas);
|
|
|
|
|
+ return uas;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 将brandSubmit转换此UAS品牌申请
|
|
|
|
|
- *
|
|
|
|
|
- * @param brandSubmit 商城品牌申请
|
|
|
|
|
- * @return uas品牌申请
|
|
|
|
|
- */
|
|
|
|
|
- public static BrandSubmitUas convertUas(BrandSubmit brandSubmit) {
|
|
|
|
|
- BrandSubmitUas uas = new BrandSubmitUas();
|
|
|
|
|
- uas.setId(brandSubmit.getId());
|
|
|
|
|
- uas.setUuid(brandSubmit.getUuid());
|
|
|
|
|
- uas.setApplication(brandSubmit.getApplication());
|
|
|
|
|
- uas.setAchievement(brandSubmit.getAchievement());
|
|
|
|
|
- uas.setArea(brandSubmit.getArea());
|
|
|
|
|
- uas.setBrief(brandSubmit.getBrief());
|
|
|
|
|
- uas.setUrl(brandSubmit.getUrl());
|
|
|
|
|
- uas.setLogoUrl(brandSubmit.getLogoUrl());
|
|
|
|
|
- uas.setNameCn(brandSubmit.getNameCn());
|
|
|
|
|
- uas.setNameEn(brandSubmit.getNameEn());
|
|
|
|
|
- uas.setSeries(brandSubmit.getSeries());
|
|
|
|
|
- uas.setVendor(brandSubmit.getVendor());
|
|
|
|
|
- uas.setStatus(brandSubmit.getStatus());
|
|
|
|
|
- uas.setAuditOpinion(brandSubmit.getAuditOpinion());
|
|
|
|
|
- uas.setImid(brandSubmit.getImid());
|
|
|
|
|
- uas.setUuid(brandSubmit.getUuid());
|
|
|
|
|
- uas.setVersion(brandSubmit.getVersion());
|
|
|
|
|
- uas.setModifyenuu(brandSubmit.getModifyenuu());
|
|
|
|
|
- uas.setModifyuu(brandSubmit.getModifyuu());
|
|
|
|
|
- return uas;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 将brandSubmit转换此UAS品牌申请
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param brandSubmit 商城品牌申请
|
|
|
|
|
+ * @return uas品牌申请
|
|
|
|
|
+ */
|
|
|
|
|
+ public static BrandSubmitUas convertUas(BrandSubmit brandSubmit) {
|
|
|
|
|
+ BrandSubmitUas uas = new BrandSubmitUas();
|
|
|
|
|
+ uas.setId(brandSubmit.getId());
|
|
|
|
|
+ uas.setUuid(brandSubmit.getUuid());
|
|
|
|
|
+ uas.setApplication(brandSubmit.getApplication());
|
|
|
|
|
+ uas.setAchievement(brandSubmit.getAchievement());
|
|
|
|
|
+ uas.setArea(brandSubmit.getArea());
|
|
|
|
|
+ uas.setBrief(brandSubmit.getBrief());
|
|
|
|
|
+ uas.setUrl(brandSubmit.getUrl());
|
|
|
|
|
+ uas.setLogoUrl(brandSubmit.getLogoUrl());
|
|
|
|
|
+ uas.setNameCn(brandSubmit.getNameCn());
|
|
|
|
|
+ uas.setNameEn(brandSubmit.getNameEn());
|
|
|
|
|
+ uas.setSeries(brandSubmit.getSeries());
|
|
|
|
|
+ uas.setVendor(brandSubmit.getVendor());
|
|
|
|
|
+ uas.setStatus(brandSubmit.getStatus());
|
|
|
|
|
+ uas.setAuditOpinion(brandSubmit.getAuditOpinion());
|
|
|
|
|
+ uas.setImid(brandSubmit.getImid());
|
|
|
|
|
+ uas.setUuid(brandSubmit.getUuid());
|
|
|
|
|
+ uas.setVersion(brandSubmit.getVersion());
|
|
|
|
|
+ uas.setModifyenuu(brandSubmit.getModifyenuu());
|
|
|
|
|
+ uas.setModifyuu(brandSubmit.getModifyuu());
|
|
|
|
|
+ return uas;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 商城品牌申请转换为uas简易品牌申请
|
|
|
|
|
- * @param brandSubmit 商城品牌
|
|
|
|
|
- * @return uas简易品牌申请
|
|
|
|
|
- */
|
|
|
|
|
- public static BrandSubmitUasInfo covertUas(BrandSubmit brandSubmit) {
|
|
|
|
|
- BrandSubmitUasInfo info = new BrandSubmitUasInfo();
|
|
|
|
|
- info.setId(brandSubmit.getId());
|
|
|
|
|
- info.setArea(brandSubmit.getArea());
|
|
|
|
|
- info.setAuditOpinion(brandSubmit.getAuditOpinion());
|
|
|
|
|
- info.setImid(brandSubmit.getImid());
|
|
|
|
|
- info.setLogoUrl(brandSubmit.getLogoUrl());
|
|
|
|
|
- info.setNameCn(brandSubmit.getNameCn());
|
|
|
|
|
- info.setNameEn(brandSubmit.getNameEn());
|
|
|
|
|
- info.setStatus(brandSubmit.getStatus());
|
|
|
|
|
- info.setUuid(brandSubmit.getUuid());
|
|
|
|
|
- info.setVendor(brandSubmit.getVendor());
|
|
|
|
|
- return info;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商城品牌申请转换为uas简易品牌申请
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param brandSubmit 商城品牌
|
|
|
|
|
+ * @return uas简易品牌申请
|
|
|
|
|
+ */
|
|
|
|
|
+ public static BrandSubmitUasInfo covertUas(BrandSubmit brandSubmit) {
|
|
|
|
|
+ BrandSubmitUasInfo info = new BrandSubmitUasInfo();
|
|
|
|
|
+ info.setId(brandSubmit.getId());
|
|
|
|
|
+ info.setArea(brandSubmit.getArea());
|
|
|
|
|
+ info.setAuditOpinion(brandSubmit.getAuditOpinion());
|
|
|
|
|
+ info.setImid(brandSubmit.getImid());
|
|
|
|
|
+ info.setLogoUrl(brandSubmit.getLogoUrl());
|
|
|
|
|
+ info.setNameCn(brandSubmit.getNameCn());
|
|
|
|
|
+ info.setNameEn(brandSubmit.getNameEn());
|
|
|
|
|
+ info.setStatus(brandSubmit.getStatus());
|
|
|
|
|
+ info.setUuid(brandSubmit.getUuid());
|
|
|
|
|
+ info.setVendor(brandSubmit.getVendor());
|
|
|
|
|
+ return info;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 商城产品批次信息转换为uas批次简易信息
|
|
|
|
|
- * @param simle 商城产品批次信息
|
|
|
|
|
- * @return uas批次简易信息
|
|
|
|
|
- */
|
|
|
|
|
- public static GoodsSimpleUas convertUas(ComponentGoods simle) {
|
|
|
|
|
- GoodsSimpleUas uas = new GoodsSimpleUas();
|
|
|
|
|
- uas.setCode(simle.getCode());
|
|
|
|
|
- uas.setUnit(simle.getUnit());
|
|
|
|
|
- uas.setBatchCode(simle.getBatchCode());
|
|
|
|
|
- uas.setMinBuyQty(simle.getMinBuyQty());
|
|
|
|
|
- uas.setMinPackQty(simle.getMinPackQty());
|
|
|
|
|
- uas.setOriginal(simle.getOriginal());
|
|
|
|
|
- uas.setCurrencyName(simle.getCurrencyName());
|
|
|
|
|
- uas.setQtyPrice(simle.getQtyPrice());
|
|
|
|
|
- uas.setPackaging(simle.getPackaging());
|
|
|
|
|
- uas.setProduceDate(simle.getProduceDate());
|
|
|
|
|
- uas.setReserve(simle.getReserve());
|
|
|
|
|
- uas.setB2cDeliveryHKMaxTime(simle.getB2cMaxDelivery());
|
|
|
|
|
- uas.setB2cDeliveryHKMinTime(simle.getB2cMinDelivery());
|
|
|
|
|
- uas.setB2cDeliveryDemMaxTime(simle.getB2cMaxDelivery());
|
|
|
|
|
- uas.setB2cDeliveryDemMinTime(simle.getB2cMinDelivery());
|
|
|
|
|
- uas.setSampleQty(simle.getSampleQty());
|
|
|
|
|
- uas.setUuid(simle.getUuid());
|
|
|
|
|
- return uas;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商城产品批次信息转换为uas批次简易信息
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param simle 商城产品批次信息
|
|
|
|
|
+ * @return uas批次简易信息
|
|
|
|
|
+ */
|
|
|
|
|
+ public static GoodsSimpleUas convertUas(ComponentGoods simle) {
|
|
|
|
|
+ GoodsSimpleUas uas = new GoodsSimpleUas();
|
|
|
|
|
+ uas.setCode(simle.getCode());
|
|
|
|
|
+ uas.setUnit(simle.getUnit());
|
|
|
|
|
+ uas.setBatchCode(simle.getBatchCode());
|
|
|
|
|
+ uas.setMinBuyQty(simle.getMinBuyQty());
|
|
|
|
|
+ uas.setMinPackQty(simle.getMinPackQty());
|
|
|
|
|
+ uas.setOriginal(simle.getOriginal());
|
|
|
|
|
+ uas.setCurrencyName(simle.getCurrencyName());
|
|
|
|
|
+ uas.setQtyPrice(simle.getQtyPrice());
|
|
|
|
|
+ uas.setPackaging(simle.getPackaging());
|
|
|
|
|
+ uas.setProduceDate(simle.getProduceDate());
|
|
|
|
|
+ uas.setReserve(simle.getReserve());
|
|
|
|
|
+ uas.setB2cDeliveryHKMaxTime(simle.getB2cMaxDelivery());
|
|
|
|
|
+ uas.setB2cDeliveryHKMinTime(simle.getB2cMinDelivery());
|
|
|
|
|
+ uas.setB2cDeliveryDemMaxTime(simle.getB2cMaxDelivery());
|
|
|
|
|
+ uas.setB2cDeliveryDemMinTime(simle.getB2cMinDelivery());
|
|
|
|
|
+ uas.setSampleQty(simle.getSampleQty());
|
|
|
|
|
+ uas.setUuid(simle.getUuid());
|
|
|
|
|
+ return uas;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 商城类目转换为uas类目信息
|
|
|
|
|
- * @param kind 商城类目
|
|
|
|
|
- * @return uas类目信息
|
|
|
|
|
- */
|
|
|
|
|
- public static KindUas convertUas(Kind kind) {
|
|
|
|
|
- KindUas uas = new KindUas();
|
|
|
|
|
- uas.setComponentPrefix(kind.getComponentPrefix());
|
|
|
|
|
- uas.setComponentsuffix(kind.getComponentsuffix());
|
|
|
|
|
- uas.setCount(kind.getCount());
|
|
|
|
|
- uas.setDetno(kind.getDetno());
|
|
|
|
|
- uas.setId(kind.getId());
|
|
|
|
|
- uas.setIsLeaf(kind.getIsLeaf());
|
|
|
|
|
- uas.setLevel(kind.getLevel());
|
|
|
|
|
- uas.setNameCn(kind.getNameCn());
|
|
|
|
|
- uas.setNameEn(kind.getNameEn());
|
|
|
|
|
- uas.setParentid(kind.getParentid());
|
|
|
|
|
- return uas;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商城类目转换为uas类目信息
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param kind 商城类目
|
|
|
|
|
+ * @return uas类目信息
|
|
|
|
|
+ */
|
|
|
|
|
+ public static KindUas convertUas(Kind kind) {
|
|
|
|
|
+ KindUas uas = new KindUas();
|
|
|
|
|
+ uas.setComponentPrefix(kind.getComponentPrefix());
|
|
|
|
|
+ uas.setComponentsuffix(kind.getComponentsuffix());
|
|
|
|
|
+ uas.setCount(kind.getCount());
|
|
|
|
|
+ uas.setDetno(kind.getDetno());
|
|
|
|
|
+ uas.setId(kind.getId());
|
|
|
|
|
+ uas.setIsLeaf(kind.getIsLeaf());
|
|
|
|
|
+ uas.setLevel(kind.getLevel());
|
|
|
|
|
+ uas.setNameCn(kind.getNameCn());
|
|
|
|
|
+ uas.setNameEn(kind.getNameEn());
|
|
|
|
|
+ uas.setParentid(kind.getParentid());
|
|
|
|
|
+ return uas;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 商城器件简易信息转换为uas器件简易信息
|
|
|
|
|
- * @param info 商城器件简易信息
|
|
|
|
|
- * @return uas器件简易信息
|
|
|
|
|
- */
|
|
|
|
|
- public static ComponentInfoUas convertUas(ComponentInfo info) {
|
|
|
|
|
- ComponentInfoUas uas = new ComponentInfoUas();
|
|
|
|
|
- uas.setAttach(info.getAttach());
|
|
|
|
|
- uas.setBrandid(info.getBrandid());
|
|
|
|
|
- uas.setCode(info.getCode());
|
|
|
|
|
- uas.setInactionStockQty(info.getInactionStockQty());
|
|
|
|
|
- // uas.setWastageQty(info.getWastageQty());
|
|
|
|
|
- uas.setId(info.getId());
|
|
|
|
|
- uas.setImg(info.getImg());
|
|
|
|
|
- uas.setKindid(info.getKindid());
|
|
|
|
|
- uas.setMaxDelivery(info.getMaxDelivery());
|
|
|
|
|
- uas.setMinBuyQty(info.getMinBuyQty());
|
|
|
|
|
- uas.setMinDelivery(info.getMinDelivery());
|
|
|
|
|
- uas.setMinPrice(info.getMinPrice());
|
|
|
|
|
- uas.setMaxPrice(info.getMaxPrice());
|
|
|
|
|
- uas.setOrderNumber(info.getOrderNumber());
|
|
|
|
|
- uas.setOrderQty(info.getOrderQty());
|
|
|
|
|
- uas.setOriginalQty(info.getOriginalQty());
|
|
|
|
|
- uas.setPackaging(info.getEncapsulation());
|
|
|
|
|
- uas.setReserve(info.getReserve());
|
|
|
|
|
- uas.setReserveType(info.getReserveType());
|
|
|
|
|
- uas.setSampleQty(info.getSampleQty());
|
|
|
|
|
- uas.setSpec(info.getEncapsulation());
|
|
|
|
|
- uas.setUnit(info.getUnit());
|
|
|
|
|
- uas.setUuid(info.getUuid());
|
|
|
|
|
- uas.setVersion(info.getVersion());
|
|
|
|
|
- uas.setWeight(info.getWeight());
|
|
|
|
|
- if (info.getBrand() != null) {
|
|
|
|
|
- uas.setBrand(convertUas(info.getBrand()));
|
|
|
|
|
- }
|
|
|
|
|
- return uas;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商城器件简易信息转换为uas器件简易信息
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param info 商城器件简易信息
|
|
|
|
|
+ * @return uas器件简易信息
|
|
|
|
|
+ */
|
|
|
|
|
+ public static ComponentInfoUas convertUas(ComponentInfo info) {
|
|
|
|
|
+ ComponentInfoUas uas = new ComponentInfoUas();
|
|
|
|
|
+ uas.setAttach(info.getAttach());
|
|
|
|
|
+ uas.setBrandid(info.getBrandid());
|
|
|
|
|
+ uas.setCode(info.getCode());
|
|
|
|
|
+ uas.setInactionStockQty(info.getInactionStockQty());
|
|
|
|
|
+ // uas.setWastageQty(info.getWastageQty());
|
|
|
|
|
+ uas.setId(info.getId());
|
|
|
|
|
+ uas.setImg(info.getImg());
|
|
|
|
|
+ uas.setKindid(info.getKindid());
|
|
|
|
|
+ uas.setMaxDelivery(info.getMaxDelivery());
|
|
|
|
|
+ uas.setMinBuyQty(info.getMinBuyQty());
|
|
|
|
|
+ uas.setMinDelivery(info.getMinDelivery());
|
|
|
|
|
+ uas.setMinPrice(info.getMinPrice());
|
|
|
|
|
+ uas.setMaxPrice(info.getMaxPrice());
|
|
|
|
|
+ uas.setOrderNumber(info.getOrderNumber());
|
|
|
|
|
+ uas.setOrderQty(info.getOrderQty());
|
|
|
|
|
+ uas.setOriginalQty(info.getOriginalQty());
|
|
|
|
|
+ uas.setPackaging(info.getEncapsulation());
|
|
|
|
|
+ uas.setReserve(info.getReserve());
|
|
|
|
|
+ uas.setReserveType(info.getReserveType());
|
|
|
|
|
+ uas.setSampleQty(info.getSampleQty());
|
|
|
|
|
+ uas.setSpec(info.getEncapsulation());
|
|
|
|
|
+ uas.setUnit(info.getUnit());
|
|
|
|
|
+ uas.setUuid(info.getUuid());
|
|
|
|
|
+ uas.setVersion(info.getVersion());
|
|
|
|
|
+ uas.setWeight(info.getWeight());
|
|
|
|
|
+ if (info.getBrand() != null) {
|
|
|
|
|
+ uas.setBrand(convertUas(info.getBrand()));
|
|
|
|
|
+ }
|
|
|
|
|
+ return uas;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 商城品牌简易信息转换为uas品牌简易信息
|
|
|
|
|
- * @param info 商城品牌简易信息
|
|
|
|
|
- * @return uas品牌简易信息
|
|
|
|
|
- */
|
|
|
|
|
- public static BrandInfoUas convertUas(BrandInfo info) {
|
|
|
|
|
- BrandInfoUas uas = new BrandInfoUas();
|
|
|
|
|
- uas.setId(info.getId());
|
|
|
|
|
- uas.setLogoUrl(info.getLogoUrl());
|
|
|
|
|
- uas.setNameCn(info.getNameCn());
|
|
|
|
|
- uas.setNameEn(info.getNameEn());
|
|
|
|
|
- uas.setUuid(info.getUuid());
|
|
|
|
|
- uas.setVersion(info.getVersion());
|
|
|
|
|
- uas.setVenodr(info.getVendor());
|
|
|
|
|
- uas.setWeight(info.getWeight());
|
|
|
|
|
- return uas;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商城品牌简易信息转换为uas品牌简易信息
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param info 商城品牌简易信息
|
|
|
|
|
+ * @return uas品牌简易信息
|
|
|
|
|
+ */
|
|
|
|
|
+ public static BrandInfoUas convertUas(BrandInfo info) {
|
|
|
|
|
+ BrandInfoUas uas = new BrandInfoUas();
|
|
|
|
|
+ uas.setId(info.getId());
|
|
|
|
|
+ uas.setLogoUrl(info.getLogoUrl());
|
|
|
|
|
+ uas.setNameCn(info.getNameCn());
|
|
|
|
|
+ uas.setNameEn(info.getNameEn());
|
|
|
|
|
+ uas.setUuid(info.getUuid());
|
|
|
|
|
+ uas.setVersion(info.getVersion());
|
|
|
|
|
+ uas.setVenodr(info.getVendor());
|
|
|
|
|
+ uas.setWeight(info.getWeight());
|
|
|
|
|
+ return uas;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 分页转换
|
|
|
|
|
- * @param page
|
|
|
|
|
- * @param <T>
|
|
|
|
|
- * @return
|
|
|
|
|
- */
|
|
|
|
|
- public static <T> IPage<T> convertPage(final Page<T> page) {
|
|
|
|
|
- IPage<T> iPage = new IPage<>();
|
|
|
|
|
- iPage.setContent(page.getContent());
|
|
|
|
|
- iPage.setFirst(page.isFirst());
|
|
|
|
|
- iPage.setLast(page.isLast());
|
|
|
|
|
- iPage.setNumber(page.getNumber());
|
|
|
|
|
- iPage.setNumberOfElements(page.getNumberOfElements());
|
|
|
|
|
- iPage.setSize(page.getSize());
|
|
|
|
|
- iPage.setTotalElements(page.getTotalElements());
|
|
|
|
|
- return iPage;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 分页转换
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param page
|
|
|
|
|
+ * @param <T>
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public static <T> IPage<T> convertPage(final Page<T> page) {
|
|
|
|
|
+ IPage<T> iPage = new IPage<>();
|
|
|
|
|
+ iPage.setContent(page.getContent());
|
|
|
|
|
+ iPage.setFirst(page.isFirst());
|
|
|
|
|
+ iPage.setLast(page.isLast());
|
|
|
|
|
+ iPage.setNumber(page.getNumber());
|
|
|
|
|
+ iPage.setNumberOfElements(page.getNumberOfElements());
|
|
|
|
|
+ iPage.setSize(page.getSize());
|
|
|
|
|
+ iPage.setTotalElements(page.getTotalElements());
|
|
|
|
|
+ return iPage;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 商城属性信息转换为uas属性信息
|
|
|
|
|
- * @param property 商城属性信息
|
|
|
|
|
- * @return uas属性信息
|
|
|
|
|
- */
|
|
|
|
|
- public static PropertyUas convertUas(Property property) {
|
|
|
|
|
- PropertyUas propertyUas = new PropertyUas();
|
|
|
|
|
- propertyUas.setId(property.getId());
|
|
|
|
|
- propertyUas.setLabelCn(property.getLabelCn());
|
|
|
|
|
- propertyUas.setLabelEn(property.getLabelEn());
|
|
|
|
|
- return propertyUas;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商城属性信息转换为uas属性信息
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param property 商城属性信息
|
|
|
|
|
+ * @return uas属性信息
|
|
|
|
|
+ */
|
|
|
|
|
+ public static PropertyUas convertUas(Property property) {
|
|
|
|
|
+ PropertyUas propertyUas = new PropertyUas();
|
|
|
|
|
+ propertyUas.setId(property.getId());
|
|
|
|
|
+ propertyUas.setLabelCn(property.getLabelCn());
|
|
|
|
|
+ propertyUas.setLabelEn(property.getLabelEn());
|
|
|
|
|
+ return propertyUas;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 商城标准参数信息转换为uas标准参数信息
|
|
|
|
|
- * @param kindProperty 商城标准参数信息
|
|
|
|
|
- * @return uas标准参数信息
|
|
|
|
|
- */
|
|
|
|
|
- public static KindPropertyUas convertUas(KindProperty kindProperty) {
|
|
|
|
|
- KindPropertyUas kindPropertyUas = new KindPropertyUas();
|
|
|
|
|
- kindPropertyUas.setId(kindProperty.getId());
|
|
|
|
|
- kindPropertyUas.setDetno(kindProperty.getDetno());
|
|
|
|
|
- kindPropertyUas.setKindId(kindProperty.getKindId());
|
|
|
|
|
- kindPropertyUas.setPropertyId(kindProperty.getPropertyId());
|
|
|
|
|
- kindPropertyUas.setType(kindProperty.getType());
|
|
|
|
|
- kindPropertyUas.setUnit(kindProperty.getUnit());
|
|
|
|
|
- kindPropertyUas.setProperty(convertUas(kindProperty.getProperty()));
|
|
|
|
|
- // 所有可能值
|
|
|
|
|
- if ("A".equals(kindProperty.getType()) && !CollectionUtils.isEmpty(kindProperty.getValues())) {
|
|
|
|
|
- List<String> values = new ArrayList<String>();
|
|
|
|
|
- int i = 0;
|
|
|
|
|
- for (KindPropertyValues value : kindProperty.getValues()) {
|
|
|
|
|
- i++;
|
|
|
|
|
- if (i > 50)
|
|
|
|
|
- break;
|
|
|
|
|
- values.add(value.getValue());
|
|
|
|
|
- }
|
|
|
|
|
- kindPropertyUas.setValues(values);
|
|
|
|
|
- }
|
|
|
|
|
- // 所有单位
|
|
|
|
|
- if (!CollectionUtils.isEmpty(kindProperty.getMultiUnits())) {
|
|
|
|
|
- List<KindPropertyUnitUas> kindPropertyUnitUas = new ArrayList<KindPropertyUnitUas>();
|
|
|
|
|
- for (KindPropertyUnit kindPropertyUnit : kindProperty.getMultiUnits()) {
|
|
|
|
|
- kindPropertyUnitUas.add(convertUas(kindPropertyUnit));
|
|
|
|
|
- }
|
|
|
|
|
- kindPropertyUas.setMultiUnits(kindPropertyUnitUas);
|
|
|
|
|
- }
|
|
|
|
|
- // 所有可选项
|
|
|
|
|
- if (!CollectionUtils.isEmpty(kindProperty.getOptions())) {
|
|
|
|
|
- List<KindPropertyOptionUas> kindPropertyOptionUas = new ArrayList<KindPropertyOptionUas>();
|
|
|
|
|
- for (KindPropertyOption kindPropertyOption : kindProperty.getOptions()) {
|
|
|
|
|
- kindPropertyOptionUas.add(convertUas(kindPropertyOption));
|
|
|
|
|
- }
|
|
|
|
|
- kindPropertyUas.setOptions(kindPropertyOptionUas);
|
|
|
|
|
- }
|
|
|
|
|
- return kindPropertyUas;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商城标准参数信息转换为uas标准参数信息
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param kindProperty 商城标准参数信息
|
|
|
|
|
+ * @return uas标准参数信息
|
|
|
|
|
+ */
|
|
|
|
|
+ public static KindPropertyUas convertUas(KindProperty kindProperty) {
|
|
|
|
|
+ KindPropertyUas kindPropertyUas = new KindPropertyUas();
|
|
|
|
|
+ kindPropertyUas.setId(kindProperty.getId());
|
|
|
|
|
+ kindPropertyUas.setDetno(kindProperty.getDetno());
|
|
|
|
|
+ kindPropertyUas.setKindId(kindProperty.getKindId());
|
|
|
|
|
+ kindPropertyUas.setPropertyId(kindProperty.getPropertyId());
|
|
|
|
|
+ kindPropertyUas.setType(kindProperty.getType());
|
|
|
|
|
+ kindPropertyUas.setUnit(kindProperty.getUnit());
|
|
|
|
|
+ kindPropertyUas.setProperty(convertUas(kindProperty.getProperty()));
|
|
|
|
|
+ // 所有可能值
|
|
|
|
|
+ if ("A".equals(kindProperty.getType()) && !CollectionUtils.isEmpty(kindProperty.getValues())) {
|
|
|
|
|
+ List<String> values = new ArrayList<String>();
|
|
|
|
|
+ int i = 0;
|
|
|
|
|
+ for (KindPropertyValues value : kindProperty.getValues()) {
|
|
|
|
|
+ i++;
|
|
|
|
|
+ if (i > 50)
|
|
|
|
|
+ break;
|
|
|
|
|
+ values.add(value.getValue());
|
|
|
|
|
+ }
|
|
|
|
|
+ kindPropertyUas.setValues(values);
|
|
|
|
|
+ }
|
|
|
|
|
+ // 所有单位
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(kindProperty.getMultiUnits())) {
|
|
|
|
|
+ List<KindPropertyUnitUas> kindPropertyUnitUas = new ArrayList<KindPropertyUnitUas>();
|
|
|
|
|
+ for (KindPropertyUnit kindPropertyUnit : kindProperty.getMultiUnits()) {
|
|
|
|
|
+ kindPropertyUnitUas.add(convertUas(kindPropertyUnit));
|
|
|
|
|
+ }
|
|
|
|
|
+ kindPropertyUas.setMultiUnits(kindPropertyUnitUas);
|
|
|
|
|
+ }
|
|
|
|
|
+ // 所有可选项
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(kindProperty.getOptions())) {
|
|
|
|
|
+ List<KindPropertyOptionUas> kindPropertyOptionUas = new ArrayList<KindPropertyOptionUas>();
|
|
|
|
|
+ for (KindPropertyOption kindPropertyOption : kindProperty.getOptions()) {
|
|
|
|
|
+ kindPropertyOptionUas.add(convertUas(kindPropertyOption));
|
|
|
|
|
+ }
|
|
|
|
|
+ kindPropertyUas.setOptions(kindPropertyOptionUas);
|
|
|
|
|
+ }
|
|
|
|
|
+ return kindPropertyUas;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 商城标准参数单位转换为uas标准参数单位
|
|
|
|
|
- * @param kindPropertyUnit 商城标准参数单位
|
|
|
|
|
- * @return uas标准参数单位
|
|
|
|
|
- */
|
|
|
|
|
- public static KindPropertyUnitUas convertUas(KindPropertyUnit kindPropertyUnit) {
|
|
|
|
|
- KindPropertyUnitUas kindPropertyUnitUas = new KindPropertyUnitUas();
|
|
|
|
|
- kindPropertyUnitUas.setId(kindPropertyUnit.getId());
|
|
|
|
|
- kindPropertyUnitUas.setDetno(kindPropertyUnit.getNumber());
|
|
|
|
|
- kindPropertyUnitUas.setUnit(kindPropertyUnit.getUnit());
|
|
|
|
|
- kindPropertyUnitUas.setRadix(kindPropertyUnit.getRadix());
|
|
|
|
|
- return kindPropertyUnitUas;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商城标准参数单位转换为uas标准参数单位
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param kindPropertyUnit 商城标准参数单位
|
|
|
|
|
+ * @return uas标准参数单位
|
|
|
|
|
+ */
|
|
|
|
|
+ public static KindPropertyUnitUas convertUas(KindPropertyUnit kindPropertyUnit) {
|
|
|
|
|
+ KindPropertyUnitUas kindPropertyUnitUas = new KindPropertyUnitUas();
|
|
|
|
|
+ kindPropertyUnitUas.setId(kindPropertyUnit.getId());
|
|
|
|
|
+ kindPropertyUnitUas.setDetno(kindPropertyUnit.getNumber());
|
|
|
|
|
+ kindPropertyUnitUas.setUnit(kindPropertyUnit.getUnit());
|
|
|
|
|
+ kindPropertyUnitUas.setRadix(kindPropertyUnit.getRadix());
|
|
|
|
|
+ return kindPropertyUnitUas;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 商城标准参数选项转换为uas标准参数选项
|
|
|
|
|
- * @param kindPropertyOption 商城标准参数选项
|
|
|
|
|
- * @return uas标准参数选项
|
|
|
|
|
- */
|
|
|
|
|
- public static KindPropertyOptionUas convertUas(KindPropertyOption kindPropertyOption) {
|
|
|
|
|
- KindPropertyOptionUas kindPropertyOptionUas = new KindPropertyOptionUas();
|
|
|
|
|
- kindPropertyOptionUas.setId(kindPropertyOption.getId());
|
|
|
|
|
- kindPropertyOptionUas.setDetno(kindPropertyOption.getNumber());
|
|
|
|
|
- kindPropertyOptionUas.setOption(kindPropertyOption.getOption());
|
|
|
|
|
- return kindPropertyOptionUas;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商城标准参数选项转换为uas标准参数选项
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param kindPropertyOption 商城标准参数选项
|
|
|
|
|
+ * @return uas标准参数选项
|
|
|
|
|
+ */
|
|
|
|
|
+ public static KindPropertyOptionUas convertUas(KindPropertyOption kindPropertyOption) {
|
|
|
|
|
+ KindPropertyOptionUas kindPropertyOptionUas = new KindPropertyOptionUas();
|
|
|
|
|
+ kindPropertyOptionUas.setId(kindPropertyOption.getId());
|
|
|
|
|
+ kindPropertyOptionUas.setDetno(kindPropertyOption.getNumber());
|
|
|
|
|
+ kindPropertyOptionUas.setOption(kindPropertyOption.getOption());
|
|
|
|
|
+ return kindPropertyOptionUas;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 商城业务消息转换为uas业务消息
|
|
|
|
|
- *
|
|
|
|
|
- * @author hejq
|
|
|
|
|
- * @param operationInfo 商城业务消息
|
|
|
|
|
- * @return uas业务消息
|
|
|
|
|
- */
|
|
|
|
|
- public static OperationInfoUas convertUas(OperationInfo operationInfo) {
|
|
|
|
|
- OperationInfoUas operationInfoUas = new OperationInfoUas();
|
|
|
|
|
- operationInfoUas.setB2cId(operationInfo.getB2cid());
|
|
|
|
|
- operationInfoUas.setOperationRemark(operationInfo.getOperationRemark());
|
|
|
|
|
- operationInfoUas.setOperationResult(operationInfo.getOperationResult());
|
|
|
|
|
- operationInfoUas.setServiceCode(operationInfo.getServiceCode());
|
|
|
|
|
- operationInfoUas.setUuid(operationInfo.getUuid());
|
|
|
|
|
- return operationInfoUas;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商城业务消息转换为uas业务消息
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param operationInfo 商城业务消息
|
|
|
|
|
+ * @return uas业务消息
|
|
|
|
|
+ * @author hejq
|
|
|
|
|
+ */
|
|
|
|
|
+ public static OperationInfoUas convertUas(OperationInfo operationInfo) {
|
|
|
|
|
+ OperationInfoUas operationInfoUas = new OperationInfoUas();
|
|
|
|
|
+ operationInfoUas.setB2cId(operationInfo.getB2cid());
|
|
|
|
|
+ operationInfoUas.setOperationRemark(operationInfo.getOperationRemark());
|
|
|
|
|
+ operationInfoUas.setOperationResult(operationInfo.getOperationResult());
|
|
|
|
|
+ operationInfoUas.setServiceCode(operationInfo.getServiceCode());
|
|
|
|
|
+ operationInfoUas.setUuid(operationInfo.getUuid());
|
|
|
|
|
+ return operationInfoUas;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 转为平台的产品
|
|
|
|
|
- *
|
|
|
|
|
- * @return
|
|
|
|
|
- */
|
|
|
|
|
- public static Product convert(Prod prod) {
|
|
|
|
|
- Product product = new Product();
|
|
|
|
|
- product.setProdNum(prod.getPr_code());
|
|
|
|
|
- product.setEnUU(SystemSession.getUser().getEnterprise().getUu());
|
|
|
|
|
- product.setUserUU(SystemSession.getUser().getUserUU());
|
|
|
|
|
- product.setProdName(prod.getPr_detail());
|
|
|
|
|
- product.setSpec(prod.getPr_spec());
|
|
|
|
|
- product.setUnit(prod.getPr_unit());
|
|
|
|
|
- product.setSourceId(prod.getPr_id());
|
|
|
|
|
- product.setBrand(prod.getPr_brand());
|
|
|
|
|
- if (prod.getPr_orispeccode() != null) {
|
|
|
|
|
- product.setCmpCode(prod.getPr_orispeccode());
|
|
|
|
|
- } else {
|
|
|
|
|
- product.setCmpCode(prod.getPr_spec());
|
|
|
|
|
- }
|
|
|
|
|
- int i = Constant.NO;
|
|
|
|
|
- product.setStandard(i);// 默认设置为非标准,到平台做匹配更新
|
|
|
|
|
- Enterprise enter = SystemSession.getUser().getEnterprise();
|
|
|
|
|
- // erp上传的数据默认赋值给标准信息
|
|
|
|
|
- product.setPbranden(product.getBrand());
|
|
|
|
|
- product.setPbrand(product.getBrand());
|
|
|
|
|
- product.setPcmpcode(product.getCmpCode());
|
|
|
|
|
- product.setKind(product.getProdName());
|
|
|
|
|
- product.setSourceApp("ERP");
|
|
|
|
|
- product.setErpDate(new Date());
|
|
|
|
|
- product.setB2cDownStatus(Status.NOT_UPLOAD.value());
|
|
|
|
|
- return product;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 转为平台的产品
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public static Product convert(Prod prod) {
|
|
|
|
|
+ Product product = new Product();
|
|
|
|
|
+ product.setProdNum(prod.getPr_code());
|
|
|
|
|
+ product.setEnUU(SystemSession.getUser().getEnterprise().getUu());
|
|
|
|
|
+ product.setUserUU(SystemSession.getUser().getUserUU());
|
|
|
|
|
+ product.setProdName(prod.getPr_detail());
|
|
|
|
|
+ product.setSpec(prod.getPr_spec());
|
|
|
|
|
+ product.setUnit(prod.getPr_unit());
|
|
|
|
|
+ product.setSourceId(prod.getPr_id());
|
|
|
|
|
+ product.setBrand(prod.getPr_brand());
|
|
|
|
|
+ if (prod.getPr_orispeccode() != null) {
|
|
|
|
|
+ product.setCmpCode(prod.getPr_orispeccode());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ product.setCmpCode(prod.getPr_spec());
|
|
|
|
|
+ }
|
|
|
|
|
+ int i = Constant.NO;
|
|
|
|
|
+ product.setStandard(i);// 默认设置为非标准,到平台做匹配更新
|
|
|
|
|
+ Enterprise enter = SystemSession.getUser().getEnterprise();
|
|
|
|
|
+ // erp上传的数据默认赋值给标准信息
|
|
|
|
|
+ product.setPbranden(product.getBrand());
|
|
|
|
|
+ product.setPbrand(product.getBrand());
|
|
|
|
|
+ product.setPcmpcode(product.getCmpCode());
|
|
|
|
|
+ product.setKind(product.getProdName());
|
|
|
|
|
+ product.setSourceApp("ERP");
|
|
|
|
|
+ product.setErpDate(new Date());
|
|
|
|
|
+ product.setB2cDownStatus(Status.NOT_UPLOAD.value());
|
|
|
|
|
+ return product;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 替代料转换
|
|
|
|
|
+ * @param replace
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public static ProductReplace convert(ProductReplaceErp replace) {
|
|
|
|
|
+ ProductReplace productReplace = new ProductReplace();
|
|
|
|
|
+ //设置ERPid
|
|
|
|
|
+ productReplace.setErpId(replace.getBPR_ID());
|
|
|
|
|
+ //设置替代关系状态
|
|
|
|
|
+ productReplace.setStatus(replace.getBPR_STATUSCODE());
|
|
|
|
|
+ //TODO 设置物料号
|
|
|
|
|
+ productReplace.setProductId(Long.parseLong(replace.getBPR_PRODCODE()));
|
|
|
|
|
+ //设置替代料号
|
|
|
|
|
+ productReplace.setReplaceId(replace.getBPR_REPCODE());
|
|
|
|
|
+ //设置原品牌
|
|
|
|
|
+ productReplace.setpBranden(replace.getBPR_PRODBRAND());
|
|
|
|
|
+ //设置替代品牌
|
|
|
|
|
+ productReplace.setPtrBranden(replace.getBPR_REPBAND());
|
|
|
|
|
+ //设置原型号
|
|
|
|
|
+ productReplace.setpCmpcode(replace.getBPR_PRODOSCODE());
|
|
|
|
|
+ //设置替代型号
|
|
|
|
|
+ productReplace.setpCmpcode(replace.getBPR_REPOSCODE());
|
|
|
|
|
+ //设置更新时间
|
|
|
|
|
+ productReplace.setTime(replace.getBPR_DATE());
|
|
|
|
|
+ return productReplace;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|