Commit 15887b784ef168d9e0f1a16f9a7fa1e4488d2cb9
1 parent
33a755cd
remove code
Showing
8 changed files
with
20 additions
and
81 deletions
titan-sdk/src/main/java/com/diligrp/titan/sdk/input/ProductInfoParamInput.java
... | ... | @@ -13,18 +13,11 @@ import java.util.List; |
13 | 13 | public class ProductInfoParamInput { |
14 | 14 | |
15 | 15 | private List<Long> pids; |
16 | - private String[] defindResult; | |
17 | 16 | public List<Long> getPids() { |
18 | 17 | return pids; |
19 | 18 | } |
20 | 19 | public void setPids(List<Long> pids) { |
21 | 20 | this.pids = pids; |
22 | 21 | } |
23 | - public String[] getDefindResult() { | |
24 | - return defindResult; | |
25 | - } | |
26 | - public void setDefindResult(String[] defindResult) { | |
27 | - this.defindResult = defindResult; | |
28 | - } | |
29 | - | |
22 | + | |
30 | 23 | } | ... | ... |
titan-sdk/src/main/java/com/diligrp/titan/sdk/service/ProductService.java
1 | 1 | package com.diligrp.titan.sdk.service; |
2 | 2 | |
3 | -import com.diligrp.titan.sdk.constant.TopTypeEnum; | |
4 | 3 | import com.diligrp.titan.sdk.domain.Product; |
5 | -import com.diligrp.titan.sdk.domain.ProductSearchSort; | |
6 | 4 | import com.diligrp.titan.sdk.input.PopProductSearchInput; |
7 | 5 | import com.diligrp.titan.sdk.input.PopProductView; |
8 | -import com.diligrp.titan.sdk.input.ProductPriceInput; | |
9 | 6 | import com.diligrp.titan.sdk.input.UpdateProductInput; |
10 | 7 | import com.diligrp.titan.sdk.output.BaseOutput; |
11 | 8 | import com.diligrp.titan.sdk.output.PageOutput; |
... | ... | @@ -30,12 +27,11 @@ public interface ProductService { |
30 | 27 | /** |
31 | 28 | * this method is 查询商品的信息,支持批量查询 |
32 | 29 | * @param pids PIDS 列表 |
33 | - * @param defindResult(attribute、cate、auth、video、subCates) 查询商品所需要的信息列表 | |
34 | 30 | * @return |
35 | 31 | * @createTime 2015年4月24日 下午5:09:04 |
36 | 32 | * @author yangjianjun |
37 | 33 | */ |
38 | - BaseOutput<List<Product>> getProductInfo(List<Long> pids, String[] defindResult); | |
34 | + BaseOutput<List<Product>> getProductInfo(List<Long> pids); | |
39 | 35 | |
40 | 36 | /** |
41 | 37 | * 批量查询SKU的详情, | ... | ... |
titan-sdk/src/main/java/com/diligrp/titan/sdk/service/impl/ProductServiceImpl.java
1 | 1 | package com.diligrp.titan.sdk.service.impl; |
2 | 2 | |
3 | 3 | import com.alibaba.fastjson.TypeReference; |
4 | -import com.diligrp.titan.sdk.constant.TopTypeEnum; | |
5 | 4 | import com.diligrp.titan.sdk.domain.Product; |
6 | -import com.diligrp.titan.sdk.domain.ProductSearchSort; | |
7 | -import com.diligrp.titan.sdk.input.*; | |
5 | +import com.diligrp.titan.sdk.input.PopProductSearchInput; | |
6 | +import com.diligrp.titan.sdk.input.PopProductView; | |
7 | +import com.diligrp.titan.sdk.input.ProductInfoParamInput; | |
8 | +import com.diligrp.titan.sdk.input.UpdateProductInput; | |
8 | 9 | import com.diligrp.titan.sdk.output.BaseOutput; |
9 | 10 | import com.diligrp.titan.sdk.output.PageOutput; |
10 | 11 | import com.diligrp.titan.sdk.service.ProductService; |
... | ... | @@ -35,11 +36,10 @@ public class ProductServiceImpl extends ServiceExcutor implements ProductService |
35 | 36 | } |
36 | 37 | |
37 | 38 | @Override |
38 | - public BaseOutput<List<Product>> getProductInfo(List<Long> pids, String[] defindResult) { | |
39 | + public BaseOutput<List<Product>> getProductInfo(List<Long> pids) { | |
39 | 40 | BaseOutput<List<Product>> output = new BaseOutput<List<Product>>(); |
40 | 41 | ProductInfoParamInput productInfoInput=new ProductInfoParamInput(); |
41 | 42 | productInfoInput.setPids(pids); |
42 | - productInfoInput.setDefindResult(defindResult); | |
43 | 43 | output = execute("/product/getProductInfo", productInfoInput, output, new TypeReference<BaseOutput<List<Product>>>() { |
44 | 44 | }); |
45 | 45 | return output; | ... | ... |
titan-sdk/src/test/java/com/diligrp/titan/sdk/TestProductService.java
... | ... | @@ -83,7 +83,7 @@ public class TestProductService { |
83 | 83 | public void getProductInfo() { |
84 | 84 | List<Long> pids = new ArrayList<Long>(); |
85 | 85 | pids.add(1000000018L); |
86 | - BaseOutput<List<Product>> base = client.getProductService().getProductInfo(pids, null); | |
86 | + BaseOutput<List<Product>> base = client.getProductService().getProductInfo(pids); | |
87 | 87 | System.out.println(base); |
88 | 88 | } |
89 | 89 | ... | ... |
titan-web/pom.xml
... | ... | @@ -90,9 +90,9 @@ |
90 | 90 | |
91 | 91 | <dependencies> |
92 | 92 | <dependency> |
93 | - <groupId>com.yqyw.titan</groupId> | |
93 | + <groupId>com.b2c.titan</groupId> | |
94 | 94 | <artifactId>titan-sdk</artifactId> |
95 | - <version>0.0.2-SNAPSHOT</version> | |
95 | + <version>1.0-SNAPSHOT</version> | |
96 | 96 | <exclusions> |
97 | 97 | <exclusion> |
98 | 98 | <artifactId>log4j</artifactId> | ... | ... |
titan-web/src/main/java/com/dili/titan/domain/ProductPop.java
... | ... | @@ -537,7 +537,7 @@ public class ProductPop extends BaseDomain { |
537 | 537 | } |
538 | 538 | |
539 | 539 | public void setSkuList(List<ProductSkuPop> skuList) { |
540 | - if (this.quotationType == QUOTATION_TYPE_GG && CollectionUtils | |
540 | + if (CollectionUtils | |
541 | 541 | .isNotEmpty(skuList)) { |
542 | 542 | Integer minPrice = null; |
543 | 543 | Integer maxPrice = null; | ... | ... |
titan-web/src/main/java/com/dili/titan/web/controller/ProductPopController.java
... | ... | @@ -6,7 +6,6 @@ package com.dili.titan.web.controller; |
6 | 6 | |
7 | 7 | import com.alibaba.fastjson.JSON; |
8 | 8 | import com.alibaba.fastjson.JSONObject; |
9 | -import com.dili.titan.common.ProductStatus; | |
10 | 9 | import com.dili.titan.common.log.LogHelper; |
11 | 10 | import com.dili.titan.common.log.LogTypeEnum; |
12 | 11 | import com.dili.titan.common.utils.SkuUtil; |
... | ... | @@ -17,7 +16,6 @@ import com.dili.titan.domain.Category; |
17 | 16 | import com.dili.titan.domain.ProductPop; |
18 | 17 | import com.dili.titan.domain.ProductPopQuery; |
19 | 18 | import com.dili.titan.domain.base.Result; |
20 | -import com.dili.titan.domain.common.Message; | |
21 | 19 | import com.dili.titan.domain.common.Page; |
22 | 20 | import com.dili.titan.rpc.ImageRPC; |
23 | 21 | import com.dili.titan.service.AttributeValueService; |
... | ... | @@ -29,7 +27,6 @@ import com.diligrp.manage.sdk.session.SessionContext; |
29 | 27 | import com.diligrp.titan.sdk.TitanClient; |
30 | 28 | import com.diligrp.titan.sdk.domain.Product; |
31 | 29 | import com.diligrp.titan.sdk.domain.Sku; |
32 | -import com.diligrp.titan.sdk.input.DefindResult; | |
33 | 30 | import com.diligrp.titan.sdk.output.BaseOutput; |
34 | 31 | import org.apache.commons.collections.CollectionUtils; |
35 | 32 | import org.apache.commons.lang.StringUtils; |
... | ... | @@ -213,7 +210,7 @@ public class ProductPopController extends BaseController { |
213 | 210 | Product productPop = null;//productPopService.selectEntry(id); |
214 | 211 | List<Long> list=new ArrayList<Long>(); |
215 | 212 | list.add(id); |
216 | - BaseOutput<List<Product>> rest = titanClient.getProductService().getProductInfo(list,new String[]{DefindResult.ATTRIBUTE,DefindResult.AUTH,DefindResult.CATE,DefindResult.FEEDBACK,DefindResult.SUB_CATES,DefindResult.VIEDEO}); | |
213 | + BaseOutput<List<Product>> rest = titanClient.getProductService().getProductInfo(list); | |
217 | 214 | List<Product> productPopDetails = rest.getData(); |
218 | 215 | //productRestService.get |
219 | 216 | if(CollectionUtils.isNotEmpty(productPopDetails)){ |
... | ... | @@ -278,50 +275,7 @@ public class ProductPopController extends BaseController { |
278 | 275 | // return msg; |
279 | 276 | // } |
280 | 277 | |
281 | - /** | |
282 | - * 审核商品 | |
283 | - * @param productPopAudit | |
284 | - * @throws Exception | |
285 | - * @createTime 2014年6月7日 下午2:50:04 | |
286 | - * @author celine | |
287 | - */ | |
288 | - @RequestMapping(value = "/audit") | |
289 | - @ResponseBody | |
290 | - public Message audit(@RequestBody ProductPopAudit productPopAudit) throws Exception { | |
291 | - long start = System.currentTimeMillis(); | |
292 | - Message msg = null; | |
293 | - try { | |
294 | - ProductPop productPop = productPopService.selectEntry(productPopAudit.getPid()); | |
295 | - if(!qxValidate(productPop)){ | |
296 | - msg = Message.failure("没有权限!请联系管理员!"); | |
297 | - return msg; | |
298 | - } | |
299 | - int res = productPopService.audit(productPopAudit); | |
300 | - msg = res > 0 ? Message.success() : Message.failure(); | |
301 | - if(res > 0){ | |
302 | - //待办事项 | |
303 | - ProductPopQuery query = new ProductPopQuery(); | |
304 | - query.setStatus(1); | |
305 | - query.setManualAuditType(ProductPop.MANUAL_TYPE_NO); | |
306 | - int count = productPopService.getProductPopCount(query);if(productPopAudit.getStatus()== ProductStatus.PRODUCT_DENIED) { | |
307 | - } | |
308 | - }else{ | |
309 | - msg.setResult("审核第三方商品失败!"); | |
310 | - return msg; | |
311 | - } | |
312 | - } catch (Exception e) { | |
313 | - LogHelper.error(LogTypeEnum.PRODUCT_POP,e,"失败:" + e.getMessage(), e); | |
314 | - msg = Message.failure(); | |
315 | - LogHelper.error(LogTypeEnum.PRODUCT_POP,e,"审核第三方商品异常!!参数={},操作人账号={},耗时:{}", | |
316 | - productPopAudit.toString(),PassportService.getCurrentUserName(),System.currentTimeMillis() - start); | |
317 | 278 | |
318 | - } | |
319 | - LogHelper.info(LogTypeEnum.PRODUCT_POP,"审核第三方商品成功!!参数={},操作人账号={},耗时:{}", | |
320 | - productPopAudit.toString(),PassportService.getCurrentUserName(),System.currentTimeMillis() - start); | |
321 | - | |
322 | - return msg; | |
323 | - } | |
324 | - | |
325 | 279 | /** |
326 | 280 | * 批量审核商品 |
327 | 281 | * @throws Exception | ... | ... |
titan-web/src/main/resources/sqlmap/ProductSkuPop.xml
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | |
6 | 6 | <!-- product_pop_sku 所有查询列 --> |
7 | 7 | <sql id="QUERY_COLUMN_LIST"> |
8 | - <![CDATA[id,sku,title,price,store,store_unit AS storeUnit, mini_purchase AS miniPurchase,pid, | |
8 | + <![CDATA[id,sku,title,price,store_unit AS storeUnit,pid, | |
9 | 9 | sales, status, version, ctime]]> |
10 | 10 | </sql> |
11 | 11 | |
... | ... | @@ -19,9 +19,7 @@ |
19 | 19 | <if test="sku != null and sku != ''"><![CDATA[AND sku = #{sku}]]></if> |
20 | 20 | <if test="title != null and title != ''"><![CDATA[AND title = #{title}]]></if> |
21 | 21 | <if test="price != null and price != ''"><![CDATA[AND price = #{price}]]></if> |
22 | - <if test="store != null and store != ''"><![CDATA[AND store = #{store}]]></if> | |
23 | 22 | <if test="storeUnit != null and storeUnit != ''"><![CDATA[AND store_unit = #{storeUnit}]]></if> |
24 | - <if test="miniPurchase != null and miniPurchase != ''"><![CDATA[AND mini_purchase = #{miniPurchase}]]></if> | |
25 | 23 | <if test="pid != null and pid != ''"><![CDATA[AND pid = #{pid}]]></if> |
26 | 24 | <if test="sales != null and sales != ''"><![CDATA[AND sales = #{sales}]]></if> |
27 | 25 | <if test="status != null and status != ''"><![CDATA[AND status = #{status}]]></if> |
... | ... | @@ -42,9 +40,7 @@ |
42 | 40 | <if test="sku != null"><![CDATA[sku = #{sku},]]></if> |
43 | 41 | <if test="title != null"><![CDATA[title = #{title},]]></if> |
44 | 42 | <if test="price != null"><![CDATA[price = #{price},]]></if> |
45 | - <if test="store != null"><![CDATA[store = #{store},]]></if> | |
46 | 43 | <if test="storeUnit != null"><![CDATA[store_unit = #{storeUnit},]]></if> |
47 | - <if test="miniPurchase != null"><![CDATA[mini_purchase = #{miniPurchase},]]></if> | |
48 | 44 | <if test="pid != null"><![CDATA[pid = #{pid},]]></if> |
49 | 45 | <if test="sales != null"><![CDATA[sales = #{sales},]]></if> |
50 | 46 | <if test="status != null"><![CDATA[status = #{status},]]></if> |
... | ... | @@ -93,7 +89,7 @@ |
93 | 89 | <!-- 其它SQL语句 --> |
94 | 90 | |
95 | 91 | <select id="findBySkuList" parameterType="java.util.List" resultType="productSkuPop"> |
96 | - SELECT id,sku,title,price,store,store_unit AS storeUnit, mini_purchase AS miniPurchase,pid, | |
92 | + SELECT id,sku,title,price,store_unit AS storeUnit, pid, | |
97 | 93 | sales, status, version, ctime |
98 | 94 | FROM |
99 | 95 | product_pop_sku |
... | ... | @@ -104,7 +100,7 @@ |
104 | 100 | </select> |
105 | 101 | |
106 | 102 | <select id="findBySkuListWithVersion" parameterType="java.util.List" resultType="productSkuPop"> |
107 | - SELECT id,sku,title,price,store,store_unit AS storeUnit, mini_purchase AS miniPurchase,pid, | |
103 | + SELECT id,sku,title,price,store_unit AS storeUnit,pid, | |
108 | 104 | sales, status, version, ctime |
109 | 105 | FROM |
110 | 106 | product_pop_sku |
... | ... | @@ -121,8 +117,8 @@ |
121 | 117 | <update id="updatePopSku" parameterType="java.util.Map"> |
122 | 118 | <![CDATA[UPDATE product_pop_sku]]> |
123 | 119 | SET |
124 | - title = #{sku.title},price = #{sku.price},store = #{sku.store},store_unit = #{sku.storeUnit}, | |
125 | - mini_purchase = #{sku.miniPurchase}, version = version + 1, utime= now() | |
120 | + title = #{sku.title},price = #{sku.price},store_unit = #{sku.storeUnit}, | |
121 | + version = version + 1, utime= now() | |
126 | 122 | <![CDATA[WHERE sku = #{sku.sku} AND version = #{version}]]> |
127 | 123 | </update> |
128 | 124 | |
... | ... | @@ -145,10 +141,10 @@ |
145 | 141 | <!-- 插入product_pop_sku记录,使用自增id --> |
146 | 142 | <insert id="insertEntry" parameterType="productSkuPop" > |
147 | 143 | <![CDATA[ |
148 | - INSERT INTO product_pop_sku (sku,title,price,store,store_unit, mini_purchase, pid, | |
144 | + INSERT INTO product_pop_sku (sku,title,price,store_unit, pid, | |
149 | 145 | sales, status, version, ctime, utime) |
150 | - VALUES (#{sku},#{title},#{price},#{store},#{storeUnit}, | |
151 | - #{miniPurchase},#{pid},#{sales},#{status},#{version},now(), now()) | |
146 | + VALUES (#{sku},#{title},#{price},#{storeUnit}, | |
147 | + #{pid},#{sales},#{status},#{version},now(), now()) | |
152 | 148 | ]]> |
153 | 149 | </insert> |
154 | 150 | </mapper> |
155 | 151 | \ No newline at end of file | ... | ... |