Browse Source

Merge branch 'dev-mysql' into feature/yc-mobile-0522

# Conflicts:
#	src/main/resources/jxls-tpl/trade/releaseByBatch-rmb.xls
#	src/main/resources/jxls-tpl/trade/releaseByBatchError-rmb.xls
#	src/main/resources/jxls-tpl/trade/releaseByBatchError-usd.xls
#	src/main/resources/jxls-tpl/trade/releasebyBatch-usd.xls
shenjj 7 years ago
parent
commit
2838e8bc9c

+ 21 - 11
src/main/java/com/uas/platform/b2c/prod/commodity/constant/UploadConstant.java

@@ -66,39 +66,44 @@ public final class UploadConstant {
     public static final int MAX_DELIVERY = 7;
     public static final int MAX_DELIVERY = 7;
 
 
     /**
     /**
-     * 包装数量
+     * 规格
      */
      */
-    public static final int PACKAGE_NUMBER = 8;
+    public static final int SPEC = 8;
+
+    /**
+     * 最小包装数量
+     */
+    public static final int PACKAGE_NUMBER = 9;
 
 
     /**
     /**
      * 最小起订量
      * 最小起订量
      */
      */
-    public static final int BUY_MIN_QTY = 9;
+    public static final int BUY_MIN_QTY = 10;
 
 
     /**
     /**
      * 分段价格开始
      * 分段价格开始
      */
      */
-    public static final int PRICE_START = 10;
+    public static final int PRICE_START = 11;
 
 
     /**
     /**
      * 第二个分段
      * 第二个分段
      */
      */
-    public static final int QTY_SECOND_START = 11;
+    public static final int QTY_SECOND_START = 12;
 
 
     /**
     /**
      * 第二个分段
      * 第二个分段
      */
      */
-    public static final int PRICE_SECOND = 12;
+    public static final int PRICE_SECOND = 13;
 
 
     /**
     /**
      * 第三个分段
      * 第三个分段
      */
      */
-    public static final int QTY_THIRD_START = 13;
+    public static final int QTY_THIRD_START = 14;
 
 
     /**
     /**
      * 第三个分段
      * 第三个分段
      */
      */
-    public static final int PRICE_THIRD = 14;
+    public static final int PRICE_THIRD = 15;
 
 
     /**
     /**
      * 分段价格结束
      * 分段价格结束
@@ -108,17 +113,17 @@ public final class UploadConstant {
     /**
     /**
      * 自定义标签
      * 自定义标签
      */
      */
-    public static final int CUSTOM_LABEL = 15;
+    public static final int CUSTOM_LABEL = 16;
 
 
     /**
     /**
      * 导入表的最大列数
      * 导入表的最大列数
      */
      */
-    public static final int TOTAL_COLUMN = 16;
+    public static final int TOTAL_COLUMN = 17;
 
 
     /**
     /**
      * 用户可能直接用导入失败的表格进行导入
      * 用户可能直接用导入失败的表格进行导入
      */
      */
-    public static final int MAX_TOTAL_COLUMN = 17;
+    public static final int MAX_TOTAL_COLUMN = 18;
 
 
     /**
     /**
      * 个人导入表的最大列数
      * 个人导入表的最大列数
@@ -129,4 +134,9 @@ public final class UploadConstant {
      * 个人用户可能直接用导入失败的表格进行导入
      * 个人用户可能直接用导入失败的表格进行导入
      */
      */
     public static final int MAX_TOTAL_COLUMN_PERSON = 4;
     public static final int MAX_TOTAL_COLUMN_PERSON = 4;
+
+    /**
+     * 规格的最大长度
+     */
+    public static final int SPEC_MAX_BYTE = 80;
 }
 }

+ 15 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/Goods.java

@@ -527,6 +527,12 @@ public class Goods implements Serializable {
 	@Column(name = "go_audited_time")
 	@Column(name = "go_audited_time")
 	private Date auditedTime;
 	private Date auditedTime;
 
 
+	/**
+	 * 规格信息
+	 */
+	@Column(name = "go_spec")
+	private String spec;
+
 	@Transient
 	@Transient
 	private String selfSale;
 	private String selfSale;
 
 
@@ -1661,4 +1667,13 @@ public class Goods implements Serializable {
 		this.minBuyQty = minBuyQty;
 		this.minBuyQty = minBuyQty;
 		return new ResultMap(CodeType.OK, "成功");
 		return new ResultMap(CodeType.OK, "成功");
 	}
 	}
+
+	public String getSpec() {
+		return spec;
+	}
+
+	public Goods setSpec(String spec) {
+		this.spec = spec;
+		return this;
+	}
 }
 }

+ 16 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/GoodsHistory.java

@@ -409,6 +409,12 @@ public class GoodsHistory {
 	@Column(name = "go_down_msg")
 	@Column(name = "go_down_msg")
 	private String downMsg;
 	private String downMsg;
 
 
+	/**
+	 * 规格信息
+	 */
+	@Column(name = "go_sepc")
+	private String spec;
+
 	/**
 	/**
 	 * 分段价格
 	 * 分段价格
 	 */
 	 */
@@ -1055,6 +1061,7 @@ public class GoodsHistory {
 		this.breakUp = goods.getBreakUp();
 		this.breakUp = goods.getBreakUp();
 		this.tag = goods.getTag();
 		this.tag = goods.getTag();
 		this.prodNum = goods.getProdNum();
 		this.prodNum = goods.getProdNum();
+		this.spec = goods.getSpec();
     }
     }
 
 
 	public Short getSelfDeliveryDemMinTime() {
 	public Short getSelfDeliveryDemMinTime() {
@@ -1170,4 +1177,13 @@ public class GoodsHistory {
 	public void setProdNum(String prodNum) {
 	public void setProdNum(String prodNum) {
 		this.prodNum = prodNum;
 		this.prodNum = prodNum;
 	}
 	}
+
+	public String getSpec() {
+		return spec;
+	}
+
+	public GoodsHistory setSpec(String spec) {
+		this.spec = spec;
+		return this;
+	}
 }
 }

+ 32 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java

@@ -8,6 +8,7 @@ import com.uas.platform.b2c.core.utils.RegexConstant;
 import com.uas.platform.b2c.core.utils.StringUtilB2C;
 import com.uas.platform.b2c.core.utils.StringUtilB2C;
 import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
 import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
 import com.uas.platform.b2c.prod.commodity.constant.ErrorInfoConstant;
 import com.uas.platform.b2c.prod.commodity.constant.ErrorInfoConstant;
+import com.uas.platform.b2c.prod.commodity.constant.UploadConstant;
 import com.uas.platform.b2c.prod.commodity.type.ReleaseConstant;
 import com.uas.platform.b2c.prod.commodity.type.ReleaseConstant;
 import com.uas.platform.b2c.trade.order.StringConstant.Currency;
 import com.uas.platform.b2c.trade.order.StringConstant.Currency;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.CollectionUtils;
@@ -32,7 +33,7 @@ import java.util.regex.Pattern;
  * @time 创建时间:2016年9月24日
  * @time 创建时间:2016年9月24日
  */
  */
 @Entity
 @Entity
-@Table(name = "trade$releasebybatch")
+	@Table(name = "trade$releasebybatch")
 public class ReleaseProductByBatch implements Serializable {
 public class ReleaseProductByBatch implements Serializable {
 
 
 	/**
 	/**
@@ -511,6 +512,12 @@ public class ReleaseProductByBatch implements Serializable {
 	@Column(name = "rel_storename")
 	@Column(name = "rel_storename")
 	private String storeName;
 	private String storeName;
 
 
+	/**
+	 * 规格信息
+	 */
+	@Column(name = "rel_spec")
+	private String spec;
+
 //	private Short repeat;
 //	private Short repeat;
 
 
 	@Override
 	@Override
@@ -667,6 +674,21 @@ public class ReleaseProductByBatch implements Serializable {
 		setPackaging(packagingData);
 		setPackaging(packagingData);
 	}
 	}
 
 
+	/**
+	 * 交期赋值逻辑较为复杂,在调用类进行赋值
+	 * @param value
+	 */
+	public void setSpecByExcel(Object value) {
+		if (!StringUtils.isEmpty(value)) {
+			try {
+				String str = com.uas.platform.b2c.fa.payment.utils.StringUtils.cutOutString(value.toString(), UploadConstant.SPEC_MAX_BYTE);
+				setSpec(str);
+			} catch (UnsupportedEncodingException e) {
+				throw new RuntimeException(e + "指定字符集不支持");
+			}
+		}
+	}
+
 	/**
 	/**
 	 * 交期赋值逻辑较为复杂,在调用类进行赋值
 	 * 交期赋值逻辑较为复杂,在调用类进行赋值
 	 * @param minValue
 	 * @param minValue
@@ -1648,4 +1670,13 @@ public class ReleaseProductByBatch implements Serializable {
 	public void setSaleMethod(String saleMethod) {
 	public void setSaleMethod(String saleMethod) {
 		this.saleMethod = saleMethod;
 		this.saleMethod = saleMethod;
 	}
 	}
+
+	public String getSpec() {
+		return spec;
+	}
+
+	public ReleaseProductByBatch setSpec(String spec) {
+		this.spec = spec;
+		return this;
+	}
 }
 }

+ 8 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java

@@ -24,6 +24,7 @@ import com.uas.platform.b2c.external.erp.commodity.util.ModelConverter;
 import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
 import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
 import com.uas.platform.b2c.prod.commodity.constant.IntegerConstant;
 import com.uas.platform.b2c.prod.commodity.constant.IntegerConstant;
 import com.uas.platform.b2c.prod.commodity.constant.StringConstant;
 import com.uas.platform.b2c.prod.commodity.constant.StringConstant;
+import com.uas.platform.b2c.prod.commodity.constant.UploadConstant;
 import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
 import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
 import com.uas.platform.b2c.prod.commodity.dao.GoodsHistoryDao;
 import com.uas.platform.b2c.prod.commodity.dao.GoodsHistoryDao;
 import com.uas.platform.b2c.prod.commodity.dao.GoodsModifyInfoDao;
 import com.uas.platform.b2c.prod.commodity.dao.GoodsModifyInfoDao;
@@ -296,6 +297,13 @@ public class GoodsServiceImpl implements GoodsService {
 //        if (!PatternUtil.matchChineseAndEnglish(goods.getPackaging())) {
 //        if (!PatternUtil.matchChineseAndEnglish(goods.getPackaging())) {
 //            throw new IllegalOperatorException("包装信息只能包含中文和英文");
 //            throw new IllegalOperatorException("包装信息只能包含中文和英文");
 //        }
 //        }
+        if (!StringUtils.isEmpty(goods.getSpec())) {
+            try {
+                String spec = com.uas.platform.b2c.fa.payment.utils.StringUtils.cutOutString(goods.getSpec().toString(), UploadConstant.SPEC_MAX_BYTE);
+                goods.setSpec(spec);
+            } catch (Exception e) {
+            }
+        }
         if (StringUtils.isEmpty(goods.getProduceDate())) {
         if (StringUtils.isEmpty(goods.getProduceDate())) {
             throw new IllegalOperatorException("型号" + goods.getCode()+"品牌" + goods.getBrandNameEn() +"的产品生产日期为空");
             throw new IllegalOperatorException("型号" + goods.getCode()+"品牌" + goods.getBrandNameEn() +"的产品生产日期为空");
         } else {
         } else {

+ 4 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java

@@ -1016,6 +1016,10 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 				setDeliveryTime(aProduct, minValue, maxValue);
 				setDeliveryTime(aProduct, minValue, maxValue);
 			}
 			}
 
 
+			Object specValue = readWorkBookCell(row.getCell(UploadConstant.SPEC), Cell.CELL_TYPE_STRING,
+					rowNum, UploadConstant.SPEC);
+			aProduct.setSpecByExcel(specValue);
+
 			Object packageNumValue = readWorkBookCell(row.getCell(UploadConstant.PACKAGE_NUMBER), Cell.CELL_TYPE_STRING,
 			Object packageNumValue = readWorkBookCell(row.getCell(UploadConstant.PACKAGE_NUMBER), Cell.CELL_TYPE_STRING,
 					rowNum, UploadConstant.PACKAGE_NUMBER);
 					rowNum, UploadConstant.PACKAGE_NUMBER);
 			aProduct.setMinPackageByExcel(packageNumValue);
 			aProduct.setMinPackageByExcel(packageNumValue);

+ 17 - 1
src/main/java/com/uas/platform/b2c/prod/product/component/modal/ComponentGoods.java

@@ -260,6 +260,12 @@ public class ComponentGoods implements Serializable {
 	@Column(name = "go_storename")
 	@Column(name = "go_storename")
 	private String storeName;
 	private String storeName;
 
 
+	/**
+	 * 视图
+	 */
+	@Column(name = "go_spec")
+	private String spec;
+
 	public Long getCmpId() {
 	public Long getCmpId() {
 		return cmpId;
 		return cmpId;
 	}
 	}
@@ -591,7 +597,16 @@ public class ComponentGoods implements Serializable {
 		return this;
 		return this;
 	}
 	}
 
 
-    public ComponentGoods() {
+	public String getSpec() {
+		return spec;
+	}
+
+	public ComponentGoods setSpec(String spec) {
+		this.spec = spec;
+		return this;
+	}
+
+	public ComponentGoods() {
     }
     }
 	public ComponentGoods(Goods goods) {
 	public ComponentGoods(Goods goods) {
 		this.cmpId = 0L;
 		this.cmpId = 0L;
@@ -641,5 +656,6 @@ public class ComponentGoods implements Serializable {
 		this.shipArea = goods.getShipArea();
 		this.shipArea = goods.getShipArea();
 		this.storeId = goods.getStoreid();
 		this.storeId = goods.getStoreid();
 		this.storeName = goods.getStoreName();
 		this.storeName = goods.getStoreName();
+		this.spec = goods.getSpec();
 	}
 	}
 }
 }

+ 1 - 1
src/main/java/com/uas/platform/b2c/trade/presale/controller/StoreFocusController.java

@@ -58,7 +58,7 @@ public class StoreFocusController {
 	 */
 	 */
 	@RequestMapping(value = "/delete", method = RequestMethod.POST)
 	@RequestMapping(value = "/delete", method = RequestMethod.POST)
 	@ApiOperation(value = "单个/批量删除店铺关注记录", httpMethod = "POST")
 	@ApiOperation(value = "单个/批量删除店铺关注记录", httpMethod = "POST")
-	public String deleteByIds(@ApiParam(required = true, value = "id集合") @RequestBody List<Long> ids) {
+	public String deleteByIds(@ApiParam(required = true, value = "id集合") @RequestBody List<Long> ids ) {
 		return storeFocusService.deleteByIds(ids);
 		return storeFocusService.deleteByIds(ids);
 	}
 	}
 
 

+ 15 - 5
src/main/java/com/uas/platform/b2c/trade/presale/service/impl/StoreFocusServiceImpl.java

@@ -71,17 +71,27 @@ public class StoreFocusServiceImpl implements StoreFocusService {
 		int count = 0;
 		int count = 0;
 		while (it.hasNext()) {
 		while (it.hasNext()) {
 			Long id = (Long) it.next();
 			Long id = (Long) it.next();
-			List<StoreFocus> list = storeFocusDao.findStoreFocusByUseruuAndEnuuAndStoreid(
-					SystemSession.getUser().getUserUU(), SystemSession.getUser().getEnterprise().getUu(), id);
-			if (list.size()>0){
-				storeFocusDao.delete(list.get(0).getId());
-				count++;
+			if (SystemSession.getUser().getEnterprise() == null) {
+				List<StoreFocus> list = storeFocusDao.findFocusByUseruuAndDissociativeAndStoreid(
+						SystemSession.getUser().getUserUU(), Type.PERSONAL.value(), id);
+				if (list.size()>0){
+					storeFocusDao.delete(list.get(0).getId());
+					count++;
+				}
+			} else {
+				List<StoreFocus> list = storeFocusDao.findStoreFocusByUseruuAndEnuuAndStoreid(
+						SystemSession.getUser().getUserUU(), SystemSession.getUser().getEnterprise().getUu(), id);
+				if (list.size()>0){
+					storeFocusDao.delete(list.get(0).getId());
+					count++;
+				}
 			}
 			}
 		}
 		}
 		System.out.println("删除的条数" + count);
 		System.out.println("删除的条数" + count);
 		return "success";
 		return "success";
 	}
 	}
 
 
+
 	@Override
 	@Override
 	public Page<StoreFocus> getPageStoreFocus(final PageInfo info) {
 	public Page<StoreFocus> getPageStoreFocus(final PageInfo info) {
 		if (SystemSession.getUser().getEnterprise() != null) {
 		if (SystemSession.getUser().getEnterprise() != null) {

BIN
src/main/resources/jxls-tpl/trade/releaseByBatch-rmb.xls


BIN
src/main/resources/jxls-tpl/trade/releaseByBatchError-rmb.xls


BIN
src/main/resources/jxls-tpl/trade/releaseByBatchError-usd.xls


BIN
src/main/resources/jxls-tpl/trade/releasebyBatch-usd.xls


+ 4 - 12
src/main/webapp/resources/js/common/query/seekPurchase.js

@@ -14,26 +14,18 @@ define([ 'ngResource' ], function() {
         url: 'http://218.17.158.219:24000/inquiry/public',
         url: 'http://218.17.158.219:24000/inquiry/public',
         method: 'GET',
         method: 'GET',
       },
       },
-      /*saveOneSeekPurchase: {
+      saveOneSeekPurchase: {
         url: 'http://218.17.158.219:24000/inquiry/buyer/save',
         url: 'http://218.17.158.219:24000/inquiry/buyer/save',
         method: 'POST'
         method: 'POST'
-      },*/
-      saveOneSeekPurchase: {
-                url: 'http://10.1.51.96:8080/inquiry/buyer/save',
-                method: 'POST'
-            },
+      },
       saveOneSeekPurchaseProd: {
       saveOneSeekPurchaseProd: {
         url: 'https://api-inquiry.usoftmall.com/inquiry/buyer/save',
         url: 'https://api-inquiry.usoftmall.com/inquiry/buyer/save',
         method: 'POST'
         method: 'POST'
       },
       },
-     /* saveOffer: {
+     saveOffer: {
         url: 'http://218.17.158.219:24000/inquiry/sale/item/save',
         url: 'http://218.17.158.219:24000/inquiry/sale/item/save',
         method: 'POST'
         method: 'POST'
-      },*/
-       saveOffer: {
-                url: 'http://10.1.51.96:8080/inquiry/sale/item/save',
-                method: 'POST'
-            },
+      },
       saveOfferProd: {
       saveOfferProd: {
         url: 'https://api-inquiry.usoftmall.com/inquiry/sale/item/save',
         url: 'https://api-inquiry.usoftmall.com/inquiry/sale/item/save',
         method: 'POST'
         method: 'POST'