Commit 15887b784ef168d9e0f1a16f9a7fa1e4488d2cb9

Authored by alexyang
1 parent 33a755cd

remove code

titan-sdk/src/main/java/com/diligrp/titan/sdk/input/ProductInfoParamInput.java
@@ -13,18 +13,11 @@ import java.util.List; @@ -13,18 +13,11 @@ import java.util.List;
13 public class ProductInfoParamInput { 13 public class ProductInfoParamInput {
14 14
15 private List<Long> pids; 15 private List<Long> pids;
16 - private String[] defindResult;  
17 public List<Long> getPids() { 16 public List<Long> getPids() {
18 return pids; 17 return pids;
19 } 18 }
20 public void setPids(List<Long> pids) { 19 public void setPids(List<Long> pids) {
21 this.pids = pids; 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 package com.diligrp.titan.sdk.service; 1 package com.diligrp.titan.sdk.service;
2 2
3 -import com.diligrp.titan.sdk.constant.TopTypeEnum;  
4 import com.diligrp.titan.sdk.domain.Product; 3 import com.diligrp.titan.sdk.domain.Product;
5 -import com.diligrp.titan.sdk.domain.ProductSearchSort;  
6 import com.diligrp.titan.sdk.input.PopProductSearchInput; 4 import com.diligrp.titan.sdk.input.PopProductSearchInput;
7 import com.diligrp.titan.sdk.input.PopProductView; 5 import com.diligrp.titan.sdk.input.PopProductView;
8 -import com.diligrp.titan.sdk.input.ProductPriceInput;  
9 import com.diligrp.titan.sdk.input.UpdateProductInput; 6 import com.diligrp.titan.sdk.input.UpdateProductInput;
10 import com.diligrp.titan.sdk.output.BaseOutput; 7 import com.diligrp.titan.sdk.output.BaseOutput;
11 import com.diligrp.titan.sdk.output.PageOutput; 8 import com.diligrp.titan.sdk.output.PageOutput;
@@ -30,12 +27,11 @@ public interface ProductService { @@ -30,12 +27,11 @@ public interface ProductService {
30 /** 27 /**
31 * this method is 查询商品的信息,支持批量查询 28 * this method is 查询商品的信息,支持批量查询
32 * @param pids PIDS 列表 29 * @param pids PIDS 列表
33 - * @param defindResult(attribute、cate、auth、video、subCates) 查询商品所需要的信息列表  
34 * @return 30 * @return
35 * @createTime 2015年4月24日 下午5:09:04 31 * @createTime 2015年4月24日 下午5:09:04
36 * @author yangjianjun 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 * 批量查询SKU的详情, 37 * 批量查询SKU的详情,
titan-sdk/src/main/java/com/diligrp/titan/sdk/service/impl/ProductServiceImpl.java
1 package com.diligrp.titan.sdk.service.impl; 1 package com.diligrp.titan.sdk.service.impl;
2 2
3 import com.alibaba.fastjson.TypeReference; 3 import com.alibaba.fastjson.TypeReference;
4 -import com.diligrp.titan.sdk.constant.TopTypeEnum;  
5 import com.diligrp.titan.sdk.domain.Product; 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 import com.diligrp.titan.sdk.output.BaseOutput; 9 import com.diligrp.titan.sdk.output.BaseOutput;
9 import com.diligrp.titan.sdk.output.PageOutput; 10 import com.diligrp.titan.sdk.output.PageOutput;
10 import com.diligrp.titan.sdk.service.ProductService; 11 import com.diligrp.titan.sdk.service.ProductService;
@@ -35,11 +36,10 @@ public class ProductServiceImpl extends ServiceExcutor implements ProductService @@ -35,11 +36,10 @@ public class ProductServiceImpl extends ServiceExcutor implements ProductService
35 } 36 }
36 37
37 @Override 38 @Override
38 - public BaseOutput<List<Product>> getProductInfo(List<Long> pids, String[] defindResult) { 39 + public BaseOutput<List<Product>> getProductInfo(List<Long> pids) {
39 BaseOutput<List<Product>> output = new BaseOutput<List<Product>>(); 40 BaseOutput<List<Product>> output = new BaseOutput<List<Product>>();
40 ProductInfoParamInput productInfoInput=new ProductInfoParamInput(); 41 ProductInfoParamInput productInfoInput=new ProductInfoParamInput();
41 productInfoInput.setPids(pids); 42 productInfoInput.setPids(pids);
42 - productInfoInput.setDefindResult(defindResult);  
43 output = execute("/product/getProductInfo", productInfoInput, output, new TypeReference<BaseOutput<List<Product>>>() { 43 output = execute("/product/getProductInfo", productInfoInput, output, new TypeReference<BaseOutput<List<Product>>>() {
44 }); 44 });
45 return output; 45 return output;
titan-sdk/src/test/java/com/diligrp/titan/sdk/TestProductService.java
@@ -83,7 +83,7 @@ public class TestProductService { @@ -83,7 +83,7 @@ public class TestProductService {
83 public void getProductInfo() { 83 public void getProductInfo() {
84 List<Long> pids = new ArrayList<Long>(); 84 List<Long> pids = new ArrayList<Long>();
85 pids.add(1000000018L); 85 pids.add(1000000018L);
86 - BaseOutput<List<Product>> base = client.getProductService().getProductInfo(pids, null); 86 + BaseOutput<List<Product>> base = client.getProductService().getProductInfo(pids);
87 System.out.println(base); 87 System.out.println(base);
88 } 88 }
89 89
titan-web/pom.xml
@@ -90,9 +90,9 @@ @@ -90,9 +90,9 @@
90 90
91 <dependencies> 91 <dependencies>
92 <dependency> 92 <dependency>
93 - <groupId>com.yqyw.titan</groupId> 93 + <groupId>com.b2c.titan</groupId>
94 <artifactId>titan-sdk</artifactId> 94 <artifactId>titan-sdk</artifactId>
95 - <version>0.0.2-SNAPSHOT</version> 95 + <version>1.0-SNAPSHOT</version>
96 <exclusions> 96 <exclusions>
97 <exclusion> 97 <exclusion>
98 <artifactId>log4j</artifactId> 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,7 +537,7 @@ public class ProductPop extends BaseDomain {
537 } 537 }
538 538
539 public void setSkuList(List<ProductSkuPop> skuList) { 539 public void setSkuList(List<ProductSkuPop> skuList) {
540 - if (this.quotationType == QUOTATION_TYPE_GG && CollectionUtils 540 + if (CollectionUtils
541 .isNotEmpty(skuList)) { 541 .isNotEmpty(skuList)) {
542 Integer minPrice = null; 542 Integer minPrice = null;
543 Integer maxPrice = null; 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,7 +6,6 @@ package com.dili.titan.web.controller;
6 6
7 import com.alibaba.fastjson.JSON; 7 import com.alibaba.fastjson.JSON;
8 import com.alibaba.fastjson.JSONObject; 8 import com.alibaba.fastjson.JSONObject;
9 -import com.dili.titan.common.ProductStatus;  
10 import com.dili.titan.common.log.LogHelper; 9 import com.dili.titan.common.log.LogHelper;
11 import com.dili.titan.common.log.LogTypeEnum; 10 import com.dili.titan.common.log.LogTypeEnum;
12 import com.dili.titan.common.utils.SkuUtil; 11 import com.dili.titan.common.utils.SkuUtil;
@@ -17,7 +16,6 @@ import com.dili.titan.domain.Category; @@ -17,7 +16,6 @@ import com.dili.titan.domain.Category;
17 import com.dili.titan.domain.ProductPop; 16 import com.dili.titan.domain.ProductPop;
18 import com.dili.titan.domain.ProductPopQuery; 17 import com.dili.titan.domain.ProductPopQuery;
19 import com.dili.titan.domain.base.Result; 18 import com.dili.titan.domain.base.Result;
20 -import com.dili.titan.domain.common.Message;  
21 import com.dili.titan.domain.common.Page; 19 import com.dili.titan.domain.common.Page;
22 import com.dili.titan.rpc.ImageRPC; 20 import com.dili.titan.rpc.ImageRPC;
23 import com.dili.titan.service.AttributeValueService; 21 import com.dili.titan.service.AttributeValueService;
@@ -29,7 +27,6 @@ import com.diligrp.manage.sdk.session.SessionContext; @@ -29,7 +27,6 @@ import com.diligrp.manage.sdk.session.SessionContext;
29 import com.diligrp.titan.sdk.TitanClient; 27 import com.diligrp.titan.sdk.TitanClient;
30 import com.diligrp.titan.sdk.domain.Product; 28 import com.diligrp.titan.sdk.domain.Product;
31 import com.diligrp.titan.sdk.domain.Sku; 29 import com.diligrp.titan.sdk.domain.Sku;
32 -import com.diligrp.titan.sdk.input.DefindResult;  
33 import com.diligrp.titan.sdk.output.BaseOutput; 30 import com.diligrp.titan.sdk.output.BaseOutput;
34 import org.apache.commons.collections.CollectionUtils; 31 import org.apache.commons.collections.CollectionUtils;
35 import org.apache.commons.lang.StringUtils; 32 import org.apache.commons.lang.StringUtils;
@@ -213,7 +210,7 @@ public class ProductPopController extends BaseController { @@ -213,7 +210,7 @@ public class ProductPopController extends BaseController {
213 Product productPop = null;//productPopService.selectEntry(id); 210 Product productPop = null;//productPopService.selectEntry(id);
214 List<Long> list=new ArrayList<Long>(); 211 List<Long> list=new ArrayList<Long>();
215 list.add(id); 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 List<Product> productPopDetails = rest.getData(); 214 List<Product> productPopDetails = rest.getData();
218 //productRestService.get 215 //productRestService.get
219 if(CollectionUtils.isNotEmpty(productPopDetails)){ 216 if(CollectionUtils.isNotEmpty(productPopDetails)){
@@ -278,50 +275,7 @@ public class ProductPopController extends BaseController { @@ -278,50 +275,7 @@ public class ProductPopController extends BaseController {
278 // return msg; 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 * @throws Exception 281 * @throws Exception
titan-web/src/main/resources/sqlmap/ProductSkuPop.xml
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 5
6 <!-- product_pop_sku 所有查询列 --> 6 <!-- product_pop_sku 所有查询列 -->
7 <sql id="QUERY_COLUMN_LIST"> 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 sales, status, version, ctime]]> 9 sales, status, version, ctime]]>
10 </sql> 10 </sql>
11 11
@@ -19,9 +19,7 @@ @@ -19,9 +19,7 @@
19 <if test="sku != null and sku != ''"><![CDATA[AND sku = #{sku}]]></if> 19 <if test="sku != null and sku != ''"><![CDATA[AND sku = #{sku}]]></if>
20 <if test="title != null and title != ''"><![CDATA[AND title = #{title}]]></if> 20 <if test="title != null and title != ''"><![CDATA[AND title = #{title}]]></if>
21 <if test="price != null and price != ''"><![CDATA[AND price = #{price}]]></if> 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 <if test="storeUnit != null and storeUnit != ''"><![CDATA[AND store_unit = #{storeUnit}]]></if> 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 <if test="pid != null and pid != ''"><![CDATA[AND pid = #{pid}]]></if> 23 <if test="pid != null and pid != ''"><![CDATA[AND pid = #{pid}]]></if>
26 <if test="sales != null and sales != ''"><![CDATA[AND sales = #{sales}]]></if> 24 <if test="sales != null and sales != ''"><![CDATA[AND sales = #{sales}]]></if>
27 <if test="status != null and status != ''"><![CDATA[AND status = #{status}]]></if> 25 <if test="status != null and status != ''"><![CDATA[AND status = #{status}]]></if>
@@ -42,9 +40,7 @@ @@ -42,9 +40,7 @@
42 <if test="sku != null"><![CDATA[sku = #{sku},]]></if> 40 <if test="sku != null"><![CDATA[sku = #{sku},]]></if>
43 <if test="title != null"><![CDATA[title = #{title},]]></if> 41 <if test="title != null"><![CDATA[title = #{title},]]></if>
44 <if test="price != null"><![CDATA[price = #{price},]]></if> 42 <if test="price != null"><![CDATA[price = #{price},]]></if>
45 - <if test="store != null"><![CDATA[store = #{store},]]></if>  
46 <if test="storeUnit != null"><![CDATA[store_unit = #{storeUnit},]]></if> 43 <if test="storeUnit != null"><![CDATA[store_unit = #{storeUnit},]]></if>
47 - <if test="miniPurchase != null"><![CDATA[mini_purchase = #{miniPurchase},]]></if>  
48 <if test="pid != null"><![CDATA[pid = #{pid},]]></if> 44 <if test="pid != null"><![CDATA[pid = #{pid},]]></if>
49 <if test="sales != null"><![CDATA[sales = #{sales},]]></if> 45 <if test="sales != null"><![CDATA[sales = #{sales},]]></if>
50 <if test="status != null"><![CDATA[status = #{status},]]></if> 46 <if test="status != null"><![CDATA[status = #{status},]]></if>
@@ -93,7 +89,7 @@ @@ -93,7 +89,7 @@
93 <!-- 其它SQL语句 --> 89 <!-- 其它SQL语句 -->
94 90
95 <select id="findBySkuList" parameterType="java.util.List" resultType="productSkuPop"> 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 sales, status, version, ctime 93 sales, status, version, ctime
98 FROM 94 FROM
99 product_pop_sku 95 product_pop_sku
@@ -104,7 +100,7 @@ @@ -104,7 +100,7 @@
104 </select> 100 </select>
105 101
106 <select id="findBySkuListWithVersion" parameterType="java.util.List" resultType="productSkuPop"> 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 sales, status, version, ctime 104 sales, status, version, ctime
109 FROM 105 FROM
110 product_pop_sku 106 product_pop_sku
@@ -121,8 +117,8 @@ @@ -121,8 +117,8 @@
121 <update id="updatePopSku" parameterType="java.util.Map"> 117 <update id="updatePopSku" parameterType="java.util.Map">
122 <![CDATA[UPDATE product_pop_sku]]> 118 <![CDATA[UPDATE product_pop_sku]]>
123 SET 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 <![CDATA[WHERE sku = #{sku.sku} AND version = #{version}]]> 122 <![CDATA[WHERE sku = #{sku.sku} AND version = #{version}]]>
127 </update> 123 </update>
128 124
@@ -145,10 +141,10 @@ @@ -145,10 +141,10 @@
145 <!-- 插入product_pop_sku记录,使用自增id --> 141 <!-- 插入product_pop_sku记录,使用自增id -->
146 <insert id="insertEntry" parameterType="productSkuPop" > 142 <insert id="insertEntry" parameterType="productSkuPop" >
147 <![CDATA[ 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 sales, status, version, ctime, utime) 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 </insert> 149 </insert>
154 </mapper> 150 </mapper>
155 \ No newline at end of file 151 \ No newline at end of file