Authored by mali

二手

@@ -29,6 +29,16 @@ public class StoragePrice { @@ -29,6 +29,16 @@ public class StoragePrice {
29 29
30 private Integer sizeId; 30 private Integer sizeId;
31 31
  32 + private Integer preSaleFlag; // 库存类型
  33 +
  34 + public Integer getPreSaleFlag() {
  35 + return preSaleFlag;
  36 + }
  37 +
  38 + public void setPreSaleFlag(Integer preSaleFlag) {
  39 + this.preSaleFlag = preSaleFlag;
  40 + }
  41 +
32 public Integer getId() { 42 public Integer getId() {
33 return id; 43 return id;
34 } 44 }
@@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
13 <result column="status" jdbcType="INTEGER" property="status"/> 13 <result column="status" jdbcType="INTEGER" property="status"/>
14 <result column="update_time" jdbcType="INTEGER" property="updateTime"/> 14 <result column="update_time" jdbcType="INTEGER" property="updateTime"/>
15 <result column="create_time" jdbcType="INTEGER" property="createTime"/> 15 <result column="create_time" jdbcType="INTEGER" property="createTime"/>
  16 + <result column="pre_sale_flag" jdbcType="INTEGER" property="preSaleFlag"/>
16 </resultMap> 17 </resultMap>
17 <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> 18 <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
18 delete from storage_price 19 delete from storage_price
@@ -127,7 +128,7 @@ @@ -127,7 +128,7 @@
127 128
128 <select id="selectStoragePriceList" resultMap="BaseResultMap"> 129 <select id="selectStoragePriceList" resultMap="BaseResultMap">
129 select sp.id, sp.skup, sp.product_id, s.goods_id, sp.storage_id, sp.depot_num, sp.seller_uid, sp.price, sp.status, 130 select sp.id, sp.skup, sp.product_id, s.goods_id, sp.storage_id, sp.depot_num, sp.seller_uid, sp.price, sp.status,
130 - sp.update_time, sp.create_time 131 + sp.update_time, sp.create_time, sp.pre_sale_flag
131 from storage_price sp, storage s where sp.storage_id = s.id 132 from storage_price sp, storage s where sp.storage_id = s.id
132 <include refid="skupPageCondition2"/> 133 <include refid="skupPageCondition2"/>
133 order by sp.id desc limit #{start},#{rows} 134 order by sp.id desc limit #{start},#{rows}
@@ -152,17 +153,20 @@ @@ -152,17 +153,20 @@
152 <if test="storagePrice.sizeId != null and storagePrice.sizeId > 0"> 153 <if test="storagePrice.sizeId != null and storagePrice.sizeId > 0">
153 and s.size_id = #{storagePrice.sizeId} 154 and s.size_id = #{storagePrice.sizeId}
154 </if> 155 </if>
  156 + <if test="storagePrice.preSaleFlag != null">
  157 + and sp.pre_sale_flag = #{storagePrice.preSaleFlag}
  158 + </if>
155 </sql> 159 </sql>
156 160
157 <select id="selectByProductIds" resultMap="BaseResultMap"> 161 <select id="selectByProductIds" resultMap="BaseResultMap">
158 select id, skup, product_id, goods_id, storage_id, depot_num, seller_uid, price, status, 162 select id, skup, product_id, goods_id, storage_id, depot_num, seller_uid, price, status,
159 - update_time, create_time 163 + update_time, create_time, pre_sale_flag
160 from storage_price 164 from storage_price
161 where product_id in 165 where product_id in
162 <foreach item="item" index="index" collection="list" open="(" separator="," close=")"> 166 <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
163 #{item} 167 #{item}
164 - </foreach>  
165 - limit 5000 <!-- 防止太多的数据,导致内存扛不住 --> 168 + </foreach> and status = 1
  169 + limit 10000 <!-- 防止太多的数据,导致内存扛不住 -->
166 </select> 170 </select>
167 <select id="selectProductIdsBySkupInfo" resultType="java.lang.Integer"> 171 <select id="selectProductIdsBySkupInfo" resultType="java.lang.Integer">
168 select DISTINCT product_id from storage_price where 1 = 1 172 select DISTINCT product_id from storage_price where 1 = 1
@@ -2,7 +2,10 @@ package com.yoho.ufo.controller; @@ -2,7 +2,10 @@ package com.yoho.ufo.controller;
2 2
3 import javax.annotation.Resource; 3 import javax.annotation.Resource;
4 4
  5 +import com.yoho.product.model.SelfShelvesReq;
  6 +import com.yoho.product.model.SelfShelvesRsp;
5 import com.yohobuy.ufo.model.request.product.ProductRequestBatchBo; 7 import com.yohobuy.ufo.model.request.product.ProductRequestBatchBo;
  8 +import com.yohobuy.ufo.model.resp.product.SecondDetailResp;
6 import org.slf4j.Logger; 9 import org.slf4j.Logger;
7 import org.slf4j.LoggerFactory; 10 import org.slf4j.LoggerFactory;
8 import org.springframework.web.bind.annotation.CrossOrigin; 11 import org.springframework.web.bind.annotation.CrossOrigin;
@@ -144,5 +147,12 @@ public class ProductController { @@ -144,5 +147,12 @@ public class ProductController {
144 bo.setDuSales(""); 147 bo.setDuSales("");
145 return productService.updateSales(bo, 0); 148 return productService.updateSales(bo, 0);
146 }*/ 149 }*/
147 - 150 +
  151 +
  152 + @RequestMapping(value = "/getSecondDetailBySkup")
  153 + public com.yoho.ufo.service.model.ApiResponse getSecondDetailBySkup(ProductRequestBo req) {
  154 + LOGGER.info("getSecondDetailBySkup in. req is {}", req);
  155 + SecondDetailResp result = productService.getSecondDetailBySkup(req.getSkup());
  156 + return new com.yoho.ufo.service.model.ApiResponse.ApiResponseBuilder().code(200).data(result).message("查询成功").build();
  157 + }
148 } 158 }
@@ -3,6 +3,7 @@ package com.yoho.ufo.convert; @@ -3,6 +3,7 @@ package com.yoho.ufo.convert;
3 import com.yoho.core.common.utils.DateUtil; 3 import com.yoho.core.common.utils.DateUtil;
4 import com.yoho.ufo.dal.model.Product; 4 import com.yoho.ufo.dal.model.Product;
5 import com.yoho.ufo.dal.model.StoragePrice; 5 import com.yoho.ufo.dal.model.StoragePrice;
  6 +import com.yohobuy.ufo.model.enums.StorageTypeEnum;
6 import com.yohobuy.ufo.model.request.product.ProductRequestBo; 7 import com.yohobuy.ufo.model.request.product.ProductRequestBo;
7 import com.yohobuy.ufo.model.resp.product.ProductResponceBo; 8 import com.yohobuy.ufo.model.resp.product.ProductResponceBo;
8 import org.springframework.stereotype.Service; 9 import org.springframework.stereotype.Service;
@@ -25,6 +26,7 @@ public class ProductConvertService { @@ -25,6 +26,7 @@ public class ProductConvertService {
25 storagePrice.setSkup(bo.getSkup()); 26 storagePrice.setSkup(bo.getSkup());
26 storagePrice.setSizeId(bo.getSizeId()); 27 storagePrice.setSizeId(bo.getSizeId());
27 storagePrice.setProductId(bo.getId()); 28 storagePrice.setProductId(bo.getId());
  29 + storagePrice.setPreSaleFlag(bo.getPreSaleFlag());
28 return storagePrice; 30 return storagePrice;
29 } 31 }
30 32
@@ -41,6 +43,8 @@ public class ProductConvertService { @@ -41,6 +43,8 @@ public class ProductConvertService {
41 bo.setSkupCreateTime(DateUtil.getDateStrBySecond(storagePrice.getCreateTime(), DateUtil.DATE_TIME_FORMAT)); 43 bo.setSkupCreateTime(DateUtil.getDateStrBySecond(storagePrice.getCreateTime(), DateUtil.DATE_TIME_FORMAT));
42 bo.setSellerUid(storagePrice.getSellerUid()); 44 bo.setSellerUid(storagePrice.getSellerUid());
43 bo.setId(storagePrice.getProductId()); 45 bo.setId(storagePrice.getProductId());
  46 + bo.setPreSaleFlag(storagePrice.getPreSaleFlag());
  47 + bo.setPreSaleFlagStr(StorageTypeEnum.getTypeName(storagePrice.getPreSaleFlag()));
44 return bo; 48 return bo;
45 } 49 }
46 50
1 package com.yoho.ufo.service; 1 package com.yoho.ufo.service;
2 2
  3 +import com.yohobuy.ufo.model.resp.product.SecondDetailResp;
3 import org.springframework.web.multipart.MultipartFile; 4 import org.springframework.web.multipart.MultipartFile;
4 5
5 import com.yoho.core.dal.datasource.annotation.Database; 6 import com.yoho.core.dal.datasource.annotation.Database;
@@ -39,4 +40,5 @@ public interface IProductService { @@ -39,4 +40,5 @@ public interface IProductService {
39 40
40 ApiResponse<Void> updateSales(ProductRequestBo bo, Integer editUid) throws PlatformException; 41 ApiResponse<Void> updateSales(ProductRequestBo bo, Integer editUid) throws PlatformException;
41 42
  43 + SecondDetailResp getSecondDetailBySkup(Integer skup);
42 } 44 }
@@ -11,6 +11,7 @@ import com.yoho.ufo.model.commoditybasicrole.category.ProductSort; @@ -11,6 +11,7 @@ import com.yoho.ufo.model.commoditybasicrole.category.ProductSort;
11 import com.yoho.ufo.model.commoditybasicrole.color.ProductColor; 11 import com.yoho.ufo.model.commoditybasicrole.color.ProductColor;
12 import com.yoho.ufo.model.commoditybasicrole.size.Size; 12 import com.yoho.ufo.model.commoditybasicrole.size.Size;
13 import com.yoho.ufo.util.CollectionUtil; 13 import com.yoho.ufo.util.CollectionUtil;
  14 +import com.yohobuy.ufo.model.enums.StorageTypeEnum;
14 import com.yohobuy.ufo.model.resp.product.ProductResponceBo; 15 import com.yohobuy.ufo.model.resp.product.ProductResponceBo;
15 import org.apache.commons.collections.CollectionUtils; 16 import org.apache.commons.collections.CollectionUtils;
16 import org.apache.commons.lang3.StringUtils; 17 import org.apache.commons.lang3.StringUtils;
@@ -155,12 +156,17 @@ public class ProductAssistService { @@ -155,12 +156,17 @@ public class ProductAssistService {
155 156
156 storagePriceList.stream().forEach(item -> { 157 storagePriceList.stream().forEach(item -> {
157 ProductResponceBo productResponceBo = productMap.get(item.getProductId()); 158 ProductResponceBo productResponceBo = productMap.get(item.getProductId());
158 -  
159 - if (ProductConstants.SKUP_STATUS_SALE.equals(item.getStatus())) { // 展示可售状态的库存  
160 - productResponceBo.setStorage(null == productResponceBo.getStorage() ? 1 : productResponceBo.getStorage() + 1);  
161 -  
162 - productResponceBo.setCurrentPrice(minPrice(productResponceBo.getCurrentPrice(), item.getPrice())); //最低价是skup中的最低价,只是可售库存 159 + if (StorageTypeEnum.PRE_SALE.getType().equals(item.getPreSaleFlag())) { // 展示可售状态的库存
  160 + productResponceBo.setPreSaleStorageNum(null == productResponceBo.getPreSaleStorageNum() ? 1 : productResponceBo.getPreSaleStorageNum() + 1);
  161 + } else if (StorageTypeEnum.DEFECT.getType().equals(item.getPreSaleFlag())) {
  162 + productResponceBo.setDefectStorageNum(null == productResponceBo.getDefectStorageNum() ? 1 : productResponceBo.getDefectStorageNum() + 1);
  163 + } else if (StorageTypeEnum.NORMAL.getType().equals(item.getPreSaleFlag())) {
  164 + productResponceBo.setNormalStorageNum(null == productResponceBo.getNormalStorageNum() ? 1 : productResponceBo.getNormalStorageNum() + 1);
  165 + } else if (StorageTypeEnum.SECOND.getType().equals(item.getPreSaleFlag())) {
  166 + productResponceBo.setSecondStorageNum(null == productResponceBo.getSecondStorageNum() ? 1 : productResponceBo.getSecondStorageNum() + 1);
163 } 167 }
  168 + productResponceBo.setStorage(null == productResponceBo.getStorage() ? 1 : productResponceBo.getStorage() + 1);
  169 + productResponceBo.setCurrentPrice(minPrice(productResponceBo.getCurrentPrice(), item.getPrice())); //最低价是skup中的最低价,只是可售库存
164 }); 170 });
165 return this; 171 return this;
166 } 172 }
@@ -13,6 +13,8 @@ import java.util.Set; @@ -13,6 +13,8 @@ import java.util.Set;
13 import java.util.function.Function; 13 import java.util.function.Function;
14 14
15 import com.yoho.ufo.dal.*; 15 import com.yoho.ufo.dal.*;
  16 +import com.yohobuy.ufo.model.resp.product.SecondDetailResp;
  17 +import com.yohobuy.ufo.model.resp.product.SkupImageInfo;
16 import org.apache.commons.collections.CollectionUtils; 18 import org.apache.commons.collections.CollectionUtils;
17 import org.apache.commons.lang3.StringUtils; 19 import org.apache.commons.lang3.StringUtils;
18 import org.elasticsearch.common.collect.Lists; 20 import org.elasticsearch.common.collect.Lists;
@@ -1215,4 +1217,72 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw @@ -1215,4 +1217,72 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
1215 } 1217 }
1216 return new ApiResponse<>(); 1218 return new ApiResponse<>();
1217 } 1219 }
  1220 +
  1221 + public SecondDetailResp getSecondDetailBySkup(Integer skup) {
  1222 + SecondDetailResp secondDetailResp = new SecondDetailResp();
  1223 +
  1224 + List<SkupImageInfo> infos = new ArrayList<>();
  1225 + SkupImageInfo info = new SkupImageInfo();
  1226 + info.setImageDesc("测试笔 ooo");
  1227 + info.setImageUrl("http://img11.static.yhbimg.com/goodsimg/2019/04/03/15/01f64fcbd42158d47188ec0d07a3d24938.jpg");
  1228 + infos.add(info);
  1229 +
  1230 + SkupImageInfo info1 = new SkupImageInfo();
  1231 + info1.setImageDesc("测试笔 ooo");
  1232 + info1.setImageUrl("http://img11.static.yhbimg.com/goodsimg/2019/04/03/15/01f64fcbd42158d47188ec0d07a3d24938.jpg");
  1233 + infos.add(info1);
  1234 +
  1235 +
  1236 + SkupImageInfo info2 = new SkupImageInfo();
  1237 + info2.setImageDesc("测试笔 ooo");
  1238 + info2.setImageUrl("http://img11.static.yhbimg.com/goodsimg/2019/04/03/15/01f64fcbd42158d47188ec0d07a3d24938.jpg");
  1239 + infos.add(info2);
  1240 +
  1241 +
  1242 + SkupImageInfo info3 = new SkupImageInfo();
  1243 + info3.setImageDesc("测试笔 ooo");
  1244 + info3.setImageUrl("http://img11.static.yhbimg.com/goodsimg/2019/04/03/15/01f64fcbd42158d47188ec0d07a3d24938.jpg");
  1245 + infos.add(info3);
  1246 +
  1247 +
  1248 + SkupImageInfo info4 = new SkupImageInfo();
  1249 + info4.setImageDesc("测试笔 ooo");
  1250 + info4.setImageUrl("http://img11.static.yhbimg.com/goodsimg/2019/04/03/15/01f64fcbd42158d47188ec0d07a3d24938.jpg");
  1251 + infos.add(info4);
  1252 +
  1253 +
  1254 + SkupImageInfo info5 = new SkupImageInfo();
  1255 + info5.setImageDesc("测试笔 ooo");
  1256 + info5.setImageUrl("http://img11.static.yhbimg.com/goodsimg/2019/04/03/15/01f64fcbd42158d47188ec0d07a3d24938.jpg");
  1257 + infos.add(info5);
  1258 +
  1259 +
  1260 + SkupImageInfo info6 = new SkupImageInfo();
  1261 + info6.setImageDesc("测试笔 ooo");
  1262 + info6.setImageUrl("http://img11.static.yhbimg.com/goodsimg/2019/04/03/15/01f64fcbd42158d47188ec0d07a3d24938.jpg");
  1263 + infos.add(info6);
  1264 +
  1265 +
  1266 + SkupImageInfo info7 = new SkupImageInfo();
  1267 + info7.setImageDesc("测试笔 ooo");
  1268 + info7.setImageUrl("http://img11.static.yhbimg.com/goodsimg/2019/04/03/15/01f64fcbd42158d47188ec0d07a3d24938.jpg");
  1269 + infos.add(info7);
  1270 +
  1271 +
  1272 + SkupImageInfo info8 = new SkupImageInfo();
  1273 + info8.setImageDesc("测试笔 ooo");
  1274 + info8.setImageUrl("http://img11.static.yhbimg.com/goodsimg/2019/04/03/15/01f64fcbd42158d47188ec0d07a3d24938.jpg");
  1275 + infos.add(info8);
  1276 +
  1277 + SkupImageInfo info9 = new SkupImageInfo();
  1278 + info9.setImageDesc("测试笔 ooo");
  1279 + info9.setImageUrl("http://img11.static.yhbimg.com/goodsimg/2019/04/03/15/01f64fcbd42158d47188ec0d07a3d24938.jpg");
  1280 + infos.add(info9);
  1281 +
  1282 + secondDetailResp.setImageInfoList(infos);
  1283 +
  1284 + secondDetailResp.setDesc("测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好测试好");
  1285 + return secondDetailResp;
  1286 + }
  1287 +
1218 } 1288 }
@@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
20 <div style="margin-left: 30px;" class="div_search"> 20 <div style="margin-left: 30px;" class="div_search">
21 <input id="status" type="text"/> 21 <input id="status" type="text"/>
22 <input id="SKUP" type="text"> 22 <input id="SKUP" type="text">
  23 + <input id="preSaleFlag" type="text">
23 <input id="sellerUid" type="text"> 24 <input id="sellerUid" type="text">
24 <input id="storageId" type="text"> 25 <input id="storageId" type="text">
25 <input id="sizeId" type="text"> 26 <input id="sizeId" type="text">
@@ -88,6 +89,14 @@ @@ -88,6 +89,14 @@
88 textField: "text" 89 textField: "text"
89 }); 90 });
90 91
  92 + $("#preSaleFlag").myCombobox({
  93 + prompt: "SKU_P类型",
  94 + width: 200,
  95 + data: [{id: '0',text: '现货'}, {id: '1',text: '预售'}, {id: '5',text: '全新瑕疵'}, {id: '6',text: '二手'}],
  96 + valueField: "id",
  97 + textField: "text"
  98 + });
  99 +
91 $("#SKUP").textbox({ 100 $("#SKUP").textbox({
92 prompt: "SKU_P" 101 prompt: "SKU_P"
93 }); 102 });
@@ -138,6 +147,11 @@ @@ -138,6 +147,11 @@
138 width: 40, 147 width: 40,
139 align: "center" 148 align: "center"
140 }, { 149 }, {
  150 + title: "SKUP类型",
  151 + field: "preSaleFlagStr",
  152 + width: 80,
  153 + align: "center",
  154 + }, {
141 title: "SKU", 155 title: "SKU",
142 field: "storageId", 156 field: "storageId",
143 width: 80, 157 width: 80,
@@ -181,10 +195,15 @@ @@ -181,10 +195,15 @@
181 width: 120, 195 width: 120,
182 align: "center", 196 align: "center",
183 formatter: function (value, rowData) { 197 formatter: function (value, rowData) {
  198 + var button = '';
  199 + if (rowData.preSaleFlag == 5 || rowData.preSaleFlag == 6) {
  200 + button += "<a role='queryDetail' dataId='" + rowData.skup + "' product_name='" + rowData.productName + "' style='margin-left:10px;background-color: #f0ad4e'>查看二手</a>";
  201 + }
  202 +
184 if (rowData.status == 1) { 203 if (rowData.status == 1) {
185 - return "<a role='edit' dataId='" + rowData.skup + "' product_name='" + rowData.productName + "' style='margin-left:10px'>取消售卖</a>"; 204 + return button + "<a role='edit' dataId='" + rowData.skup + "' product_name='" + rowData.productName + "' style='margin-left:10px'>取消售卖</a>";
186 } else { 205 } else {
187 - return ''; 206 + return button;
188 } 207 }
189 } 208 }
190 }]], 209 }]],
@@ -203,6 +222,14 @@ @@ -203,6 +222,14 @@
203 editRow(id, $(this).attr("product_name")); 222 editRow(id, $(this).attr("product_name"));
204 } 223 }
205 }); 224 });
  225 + // 编辑
  226 + $(this).myDatagrid("getPanel").find("a[role='queryDetail']").linkbutton({
  227 + iconCls: "icon-edit",
  228 + onClick: function () {
  229 + var id = $(this).attr("dataId");
  230 + queryDetail(id, $(this).attr("product_name"));
  231 + }
  232 + });
206 } 233 }
207 }); 234 });
208 235
@@ -220,6 +247,7 @@ @@ -220,6 +247,7 @@
220 onClick: function () { 247 onClick: function () {
221 $('#status').combobox('clear'); 248 $('#status').combobox('clear');
222 $('#SKUP').textbox('clear'); 249 $('#SKUP').textbox('clear');
  250 + $('#preSaleFlag').combobox('clear');
223 $('#sellerUid').textbox('clear'); 251 $('#sellerUid').textbox('clear');
224 $('#storageId').textbox('clear'); 252 $('#storageId').textbox('clear');
225 $('#sizeId').combobox('clear'); 253 $('#sizeId').combobox('clear');
@@ -238,6 +266,7 @@ @@ -238,6 +266,7 @@
238 function getParams() { 266 function getParams() {
239 var status = $('#status').combobox('getValue'); 267 var status = $('#status').combobox('getValue');
240 var skup = $('#SKUP').textbox('getValue'); 268 var skup = $('#SKUP').textbox('getValue');
  269 + var preSaleFlag = $('#preSaleFlag').combobox('getValue');
241 var sellerUid = $('#sellerUid').textbox('getValue'); 270 var sellerUid = $('#sellerUid').textbox('getValue');
242 var storageId = $('#storageId').textbox('getValue'); 271 var storageId = $('#storageId').textbox('getValue');
243 var sizeId = $('#sizeId').combobox('getValue'); 272 var sizeId = $('#sizeId').combobox('getValue');
@@ -248,6 +277,9 @@ @@ -248,6 +277,9 @@
248 if (undefined !== skup && null !== skup && "" !== skup) { 277 if (undefined !== skup && null !== skup && "" !== skup) {
249 param.skup = skup; 278 param.skup = skup;
250 } 279 }
  280 + if (undefined !== preSaleFlag && null !== preSaleFlag && "" !== preSaleFlag) {
  281 + param.preSaleFlag = preSaleFlag;
  282 + }
251 if (undefined !== sellerUid && null !== sellerUid && "" !== sellerUid) { 283 if (undefined !== sellerUid && null !== sellerUid && "" !== sellerUid) {
252 param.sellerUid = sellerUid; 284 param.sellerUid = sellerUid;
253 } 285 }
@@ -285,6 +317,11 @@ @@ -285,6 +317,11 @@
285 } 317 }
286 }); 318 });
287 } 319 }
  320 +
  321 + function queryDetail(skup, productName) { // 跳转到二手详情
  322 + window.open(contextPath + "/html/goods/storage/storageSecondDetail.html?skup=" + skup + "&time_version=" + new Date().getTime());
  323 + }
  324 +
288 }); 325 });
289 326
290 327
@@ -227,6 +227,50 @@ @@ -227,6 +227,50 @@
227 return 0; 227 return 0;
228 } 228 }
229 }, { 229 }, {
  230 + title: "现货库存",
  231 + field: "normalStorageNum",
  232 + width: 20,
  233 + align: "center",
  234 + formatter: function (value, rowData) {
  235 + if (value) {
  236 + return value;
  237 + }
  238 + return 0;
  239 + }
  240 + }, {
  241 + title: "预售库存",
  242 + field: "preSaleStorageNum",
  243 + width: 20,
  244 + align: "center",
  245 + formatter: function (value, rowData) {
  246 + if (value) {
  247 + return value;
  248 + }
  249 + return 0;
  250 + }
  251 + }, {
  252 + title: "全新瑕疵库存",
  253 + field: "defectStorageNum",
  254 + width: 20,
  255 + align: "center",
  256 + formatter: function (value, rowData) {
  257 + if (value) {
  258 + return value;
  259 + }
  260 + return 0;
  261 + }
  262 + }, {
  263 + title: "二手库存",
  264 + field: "secondStorageNum",
  265 + width: 20,
  266 + align: "center",
  267 + formatter: function (value, rowData) {
  268 + if (value) {
  269 + return value;
  270 + }
  271 + return 0;
  272 + }
  273 + }, {
230 title: "操作", 274 title: "操作",
231 field: "operations", 275 field: "operations",
232 width: 40, 276 width: 40,
@@ -428,7 +472,7 @@ @@ -428,7 +472,7 @@
428 472
429 473
430 function detailStorage(id, midSortId) { 474 function detailStorage(id, midSortId) {
431 - this.location.href = contextPath + "/html/goods/storage/storageDetail.html?productId=" + id + "&midSortId=" + midSortId; 475 + this.location.href = contextPath + "/html/goods/storage/storageDetail.html?productId=" + id + "&midSortId=" + midSortId + "&time_version=" + new Date().getTime();
432 } 476 }
433 477
434 478
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <meta charset="UTF-8"/>
  5 + <title>Yoho!Buy运营平台</title>
  6 + <script src="/ufoPlatform/js/include.js"></script>
  7 + <style>
  8 + .sub-info th{
  9 + font-size: 16px;
  10 + text-align: right;
  11 + width: 30%;
  12 + }
  13 + .sub-info td{
  14 + font-size: 16px;
  15 + width: 70%;
  16 + }
  17 + </style>
  18 +</head>
  19 +<body class="easyui-layout">
  20 +<div region="north" style="height:90px;">
  21 + <script>
  22 + document.write(addHead('库存详情', '查看二手信息'));
  23 + </script>
  24 +</div>
  25 +
  26 +<div id="businessDiv" region="center">
  27 + <table id="businessTable" class="sub-info" frame="void" width="80%" cellpadding="16" align="center">
  28 + <tr>
  29 + <th>图片</th>
  30 + <td id="imageListTd"></td>
  31 + </tr>
  32 + <tr>
  33 + <th>描述</th>
  34 + <td id="desc"></td>
  35 + </tr>
  36 + </table>
  37 + <br>
  38 + <br>
  39 +</div>
  40 +<div style="display: none">
  41 + <div id="dlg" class="datagrid-toolbar" style="padding:5px;">
  42 + <img id="simg" src="" alt="" width="800">
  43 + </div>
  44 +</div>
  45 +<script>
  46 + $(function() {
  47 + var param=window.location.search;
  48 + var skup = getQueryString(param, "skup");
  49 +
  50 + getDetailInfo(skup);
  51 +
  52 + //放大图片预览
  53 + $(".pimg").click(function(){
  54 + var _this = $(this);//将当前的pimg元素作为_this传入函数
  55 + var src = _this.attr("src");
  56 + //var index = src.indexOf("?");
  57 + //src = src.substring(0, index);
  58 + //window.open(src);
  59 + download(src);
  60 + });
  61 +
  62 + });
  63 +
  64 + function download(url) {
  65 + $('#dlg').dialog({
  66 + title: '预览',
  67 + width: 800,
  68 + height: 600,
  69 + resizable: false,
  70 + closed: false,
  71 + cache: false,
  72 + modal: true
  73 + });
  74 + $("#simg").attr("src", url);
  75 + }
  76 +
  77 + function getDetailInfo(skup){
  78 + var form = new FormData();
  79 + form.append("skup", skup);
  80 +
  81 + //发送请求
  82 + $.ajax({
  83 + type: "POST",
  84 + url: contextPath + '/product/getSecondDetailBySkup',
  85 + data: form,
  86 + async: false,
  87 + cache: false,
  88 + contentType: false,
  89 + processData: false,
  90 + dataType: 'json',
  91 + success: function (result) {
  92 + if(result.code == 200) {
  93 + $("#desc").html(result.data.desc);
  94 + var imageStr = "";
  95 + for (var i=0;i<result.data.imageInfoList.length;i++){
  96 + imageStr += "<img height='100px;' width='100px;' class='pimg' src='"+result.data.imageInfoList[i].imageUrl+"'/>";
  97 + if(i%3==0 && i!=0) {
  98 + imageStr += "<br/>"
  99 + }
  100 + }
  101 + $("#imageListTd").html(imageStr);
  102 + $.parser.parse($("#imageListTd").parent());
  103 + }
  104 + else {
  105 + $.messager.alert("失败", result.message, "error");
  106 + }
  107 + }
  108 + });
  109 + }
  110 +
  111 + function getQueryString(paraPart,name) {
  112 + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  113 + var r = paraPart.substr(1).match(reg);
  114 + if (r != null) return unescape(r[2]);
  115 + return null;
  116 + }
  117 +
  118 +</script>
  119 +</body>
  120 +</html>