Authored by mali

增加尺码id

@@ -25,6 +25,8 @@ public class StoragePrice { @@ -25,6 +25,8 @@ public class StoragePrice {
25 25
26 private Integer createTime; 26 private Integer createTime;
27 27
  28 + private Integer sizeId;
  29 +
28 public Integer getId() { 30 public Integer getId() {
29 return id; 31 return id;
30 } 32 }
@@ -112,4 +114,12 @@ public class StoragePrice { @@ -112,4 +114,12 @@ public class StoragePrice {
112 public void setCreateTime(Integer createTime) { 114 public void setCreateTime(Integer createTime) {
113 this.createTime = createTime; 115 this.createTime = createTime;
114 } 116 }
  117 +
  118 + public Integer getSizeId() {
  119 + return sizeId;
  120 + }
  121 +
  122 + public void setSizeId(Integer sizeId) {
  123 + this.sizeId = sizeId;
  124 + }
115 } 125 }
@@ -179,7 +179,7 @@ @@ -179,7 +179,7 @@
179 </select> 179 </select>
180 180
181 <select id="selectProductStorageList" resultMap="BaseResultMap"> 181 <select id="selectProductStorageList" resultMap="BaseResultMap">
182 - select id, brand_id, product_name 182 + select id, brand_id, product_name, max_sort_id, mid_sort_id
183 from product p 183 from product p
184 where <include refid="skcPageCondition" /> limit #{start},#{rows} 184 where <include refid="skcPageCondition" /> limit #{start},#{rows}
185 </select> 185 </select>
@@ -109,32 +109,33 @@ @@ -109,32 +109,33 @@
109 </select> 109 </select>
110 110
111 <select id="selectStoragePriceCount" resultType="java.lang.Integer"> 111 <select id="selectStoragePriceCount" resultType="java.lang.Integer">
112 - select count(*) from storage_price where <include refid="skupPageCondition2" /> 112 + select count(*) from storage_price sp, storage s where sp.storage_id = s.id <include refid="skupPageCondition2" />
113 </select> 113 </select>
114 114
115 <select id="selectStoragePriceList" resultMap="BaseResultMap"> 115 <select id="selectStoragePriceList" resultMap="BaseResultMap">
116 select id, skup, product_id, goods_id, storage_id, depot_num, seller_uid, price, status, 116 select id, skup, product_id, goods_id, storage_id, depot_num, seller_uid, price, status,
117 update_time, create_time 117 update_time, create_time
118 - from storage_price  
119 - where <include refid="skupPageCondition2" /> limit #{start},#{rows} 118 + from storage_price sp, storage s where sp.storage_id = s.id <include refid="skupPageCondition2" /> limit #{start},#{rows}
120 </select> 119 </select>
121 120
122 <sql id="skupPageCondition2" > 121 <sql id="skupPageCondition2" >
123 - 1 = 1  
124 <if test="storagePrice.status != null and storagePrice.status > -1"> 122 <if test="storagePrice.status != null and storagePrice.status > -1">
125 - and status = #{storagePrice.status} 123 + and sp.status = #{storagePrice.status}
126 </if> 124 </if>
127 <if test="storagePrice.storageId != null and storagePrice.storageId > 0"> 125 <if test="storagePrice.storageId != null and storagePrice.storageId > 0">
128 - and storage_id = #{storagePrice.storageId} 126 + and sp.storage_id = #{storagePrice.storageId}
129 </if> 127 </if>
130 <if test="storagePrice.sellerUid != null and storagePrice.sellerUid > 0"> 128 <if test="storagePrice.sellerUid != null and storagePrice.sellerUid > 0">
131 - and seller_uid = #{storagePrice.sellerUid} 129 + and sp.seller_uid = #{storagePrice.sellerUid}
132 </if> 130 </if>
133 <if test="storagePrice.productId != null and storagePrice.productId > 0"> 131 <if test="storagePrice.productId != null and storagePrice.productId > 0">
134 - and product_id = #{storagePrice.productId} 132 + and sp.product_id = #{storagePrice.productId}
135 </if> 133 </if>
136 <if test="storagePrice.skup != null and storagePrice.skup > 0"> 134 <if test="storagePrice.skup != null and storagePrice.skup > 0">
137 - and skup = #{storagePrice.skup} 135 + and sp.skup = #{storagePrice.skup}
  136 + </if>
  137 + <if test="storagePrice.sizeId != null and storagePrice.sizeId > 0">
  138 + and s.size_id = #{storagePrice.sizeId}
138 </if> 139 </if>
139 </sql> 140 </sql>
140 141
@@ -23,6 +23,7 @@ public class ProductConvertService { @@ -23,6 +23,7 @@ public class ProductConvertService {
23 storagePrice.setStatus(bo.getStatus()); 23 storagePrice.setStatus(bo.getStatus());
24 storagePrice.setStorageId(bo.getStorageId()); 24 storagePrice.setStorageId(bo.getStorageId());
25 storagePrice.setSkup(bo.getSkup()); 25 storagePrice.setSkup(bo.getSkup());
  26 + storagePrice.setSizeId(bo.getSizeId());
26 return storagePrice; 27 return storagePrice;
27 } 28 }
28 29
@@ -50,6 +51,8 @@ public class ProductConvertService { @@ -50,6 +51,8 @@ public class ProductConvertService {
50 bo.setSkup(productItem.getSkup()); 51 bo.setSkup(productItem.getSkup());
51 bo.setStorageId(productItem.getStorageId()); 52 bo.setStorageId(productItem.getStorageId());
52 bo.setSellerUid(productItem.getSellerUid()); 53 bo.setSellerUid(productItem.getSellerUid());
  54 + bo.setMaxSortId(productItem.getMaxSortId());
  55 + bo.setMidSortId(productItem.getMidSortId());
53 bo.setId(productItem.getId()); 56 bo.setId(productItem.getId());
54 bo.setBrandId(productItem.getBrandId()); 57 bo.setBrandId(productItem.getBrandId());
55 bo.setProductName(productItem.getProductName()); 58 bo.setProductName(productItem.getProductName());
@@ -36,7 +36,7 @@ public interface ISizeService { @@ -36,7 +36,7 @@ public interface ISizeService {
36 PageResponseBO<SizeResponseBo> getSizePageList(SizeRequestBo sizeRequestBo); 36 PageResponseBO<SizeResponseBo> getSizePageList(SizeRequestBo sizeRequestBo);
37 37
38 /** 38 /**
39 - * 查询所有的颜色,下拉框使用 39 + * 查询所有的尺码,下拉框使用
40 * @return 40 * @return
41 */ 41 */
42 List<JSONObject> queryAllSize4Goods(Integer sortId); 42 List<JSONObject> queryAllSize4Goods(Integer sortId);
@@ -494,6 +494,11 @@ public static void main(String[] args) { @@ -494,6 +494,11 @@ public static void main(String[] args) {
494 storageMapper.addStorageNum(sp.getStorageId(), -1); 494 storageMapper.addStorageNum(sp.getStorageId(), -1);
495 return new ApiResponse<>(400, "操作成功"); 495 return new ApiResponse<>(400, "操作成功");
496 } 496 }
  497 +
  498 + // TODO 发推送给商家端
  499 +
  500 + // TODO 调用银联接口退保证金
  501 +
497 return new ApiResponse<>(400, "SKUP取消失败,状态已变更!"); 502 return new ApiResponse<>(400, "SKUP取消失败,状态已变更!");
498 } 503 }
499 504
@@ -69,7 +69,7 @@ public class SizeServiceImpl implements ISizeService { @@ -69,7 +69,7 @@ public class SizeServiceImpl implements ISizeService {
69 } 69 }
70 70
71 /** 71 /**
72 - * 查询所有的颜色,下拉框使用 72 + * 查询所有的尺码,下拉框使用
73 * @return 73 * @return
74 */ 74 */
75 public List<JSONObject> queryAllSize4Goods(Integer sortId) { 75 public List<JSONObject> queryAllSize4Goods(Integer sortId) {
@@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
22 <input id="SKUP" type="text"> 22 <input id="SKUP" type="text">
23 <input id="sellerUid" type="text"> 23 <input id="sellerUid" type="text">
24 <input id="storageId" type="text"> 24 <input id="storageId" type="text">
  25 + <input id="sizeId" type="text">
25 26
26 <a id="searchLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">筛选</a> 27 <a id="searchLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">筛选</a>
27 <a id="searchAllLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">全部</a> 28 <a id="searchAllLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">全部</a>
@@ -49,15 +50,16 @@ @@ -49,15 +50,16 @@
49 } 50 }
50 $(function () { 51 $(function () {
51 var productId = parseURL(window.location.href).productId; 52 var productId = parseURL(window.location.href).productId;
  53 + var midSortId = parseURL(window.location.href).midSortId;
52 54
53 $('#returnList').linkbutton({ 55 $('#returnList').linkbutton({
54 onClick: function () { 56 onClick: function () {
55 location.href = contextPath + "/html/goods/storage/storageList.html"; 57 location.href = contextPath + "/html/goods/storage/storageList.html";
56 } 58 }
57 }); 59 });
58 - 60 + // /** 1:可售,2卖出,3鉴定失败,4卖家取消, 5客服取消. */
59 $("#status").myCombobox({ 61 $("#status").myCombobox({
60 - prompt: "请选择", 62 + prompt: "状态",
61 width: 200, 63 width: 200,
62 data: [{id: '1',text: '待付保证金'}, {id: '2',text: '卖家取消支付'}, {id: '2',text: '卖家支付超时'}, {id: '2',text: '出售中'} 64 data: [{id: '1',text: '待付保证金'}, {id: '2',text: '卖家取消支付'}, {id: '2',text: '卖家支付超时'}, {id: '2',text: '出售中'}
63 , {id: '2',text: '卖家取消出售'}, {id: '2',text: '平台取消出售'}, {id: '2',text: '已出售'}], 65 , {id: '2',text: '卖家取消出售'}, {id: '2',text: '平台取消出售'}, {id: '2',text: '已出售'}],
@@ -76,6 +78,24 @@ @@ -76,6 +78,24 @@
76 prompt: "SKU" 78 prompt: "SKU"
77 }); 79 });
78 80
  81 + $.ajax({
  82 + contentType: "application/json",
  83 + dataType: "json",
  84 + type: "GET",
  85 + url: contextPath + '/size/queryAllSize4Goods?sortId=' + midSortId,
  86 + success: function (data) {
  87 + if (data.code != 200 || !data.data || data.data.length == 0) {
  88 + return;
  89 + }
  90 + $("#sizeId").myCombobox({
  91 + prompt: "尺码",
  92 + width: 200,
  93 + data: data.data,
  94 + valueField: "id",
  95 + textField: "text"
  96 + });
  97 + }
  98 + });
79 99
80 $("#skupTable").myDatagrid({ 100 $("#skupTable").myDatagrid({
81 fit: true, 101 fit: true,
@@ -185,6 +205,7 @@ @@ -185,6 +205,7 @@
185 $('#SKUP').combobox('clear'); 205 $('#SKUP').combobox('clear');
186 $('#sellerUid').textbox('clear'); 206 $('#sellerUid').textbox('clear');
187 $('#storageId').textbox('clear'); 207 $('#storageId').textbox('clear');
  208 + $('#sizeId').combobox('clear');
188 var param = {}; 209 var param = {};
189 $("#skupTable").myDatagrid("load", param); 210 $("#skupTable").myDatagrid("load", param);
190 } 211 }
@@ -202,7 +223,8 @@ @@ -202,7 +223,8 @@
202 var skup = $('#SKUP').textbox('getValue'); 223 var skup = $('#SKUP').textbox('getValue');
203 var sellerUid = $('#sellerUid').textbox('getValue'); 224 var sellerUid = $('#sellerUid').textbox('getValue');
204 var storageId = $('#storageId').textbox('getValue'); 225 var storageId = $('#storageId').textbox('getValue');
205 - var param = {'productId': productId}; 226 + var sizeId = $('#sizeId').textbox('getValue');
  227 + var param = {'id': productId};
206 if (undefined !== status && null !== status && "" !== status) { 228 if (undefined !== status && null !== status && "" !== status) {
207 param.status = status; 229 param.status = status;
208 } 230 }
@@ -211,9 +233,13 @@ @@ -211,9 +233,13 @@
211 } 233 }
212 if (undefined !== sellerUid && null !== sellerUid && "" !== sellerUid) { 234 if (undefined !== sellerUid && null !== sellerUid && "" !== sellerUid) {
213 param.sellerUid = sellerUid; 235 param.sellerUid = sellerUid;
214 - }if (undefined !== storageId && null !== storageId && "" !== storageId) { 236 + }
  237 + if (undefined !== storageId && null !== storageId && "" !== storageId) {
215 param.storageId = storageId; 238 param.storageId = storageId;
216 } 239 }
  240 + if (undefined !== sizeId && null !== sizeId && "" !== sizeId) {
  241 + param.sizeId = sizeId;
  242 + }
217 return param; 243 return param;
218 } 244 }
219 245
@@ -125,7 +125,7 @@ @@ -125,7 +125,7 @@
125 width: 40, 125 width: 40,
126 align: "center", 126 align: "center",
127 formatter: function (value, rowData) { 127 formatter: function (value, rowData) {
128 - var str = "<a role='edit' dataId='" + rowData.id + "' style='margin-left:10px'>库存详情</a>"; 128 + var str = "<a role='edit' dataId='" + rowData.id + "' sortid = '" + rowData.midSortId + "' style='margin-left:10px'>库存详情</a>";
129 return str; 129 return str;
130 } 130 }
131 }]], 131 }]],
@@ -141,7 +141,8 @@ @@ -141,7 +141,8 @@
141 iconCls: "icon-edit", 141 iconCls: "icon-edit",
142 onClick: function () { 142 onClick: function () {
143 var id = $(this).attr("dataId"); 143 var id = $(this).attr("dataId");
144 - detailStorage(id); 144 + var midSortId = $(this).attr("midSortId");
  145 + detailStorage(id, midSortId);
145 } 146 }
146 }); 147 });
147 } 148 }
@@ -227,8 +228,8 @@ @@ -227,8 +228,8 @@
227 } 228 }
228 229
229 230
230 - function detailStorage(id) {  
231 - this.location.href = contextPath + "/html/goods/storage/storageDetail.html?productId=" + id; 231 + function detailStorage(id, midSortId) {
  232 + this.location.href = contextPath + "/html/goods/storage/storageDetail.html?productId=" + id + "&midSortId=" + midSortId;
232 } 233 }
233 }); 234 });
234 235