From 98b1a0affd69bbe63223c21fdd2c404e8bedfccb Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 20 五月 2020 17:25:08 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into 2.1.2

---
 fanli/src/main/java/com/yeshi/fanli/controller/admin/QualityFactoryAdminController.java |  346 +++++++++++++++++++++++++--------------------------------
 1 files changed, 154 insertions(+), 192 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/QualityFactoryAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/QualityFactoryAdminController.java
index 35250c2..382870a 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/QualityFactoryAdminController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/QualityFactoryAdminController.java
@@ -14,6 +14,7 @@
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.yeshi.utils.JsonUtil;
+import org.yeshi.utils.taobao.TbImgUtil;
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
@@ -24,7 +25,7 @@
 import com.yeshi.fanli.entity.bus.lable.QualityFactory;
 import com.yeshi.fanli.entity.common.AdminUser;
 import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
-import com.yeshi.fanli.exception.QualityFactoryException;
+import com.yeshi.fanli.exception.goods.quality.QualityFactoryException;
 import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
 import com.yeshi.fanli.service.inter.lable.LabelGoodsService;
 import com.yeshi.fanli.service.inter.lable.LabelService;
@@ -57,7 +58,6 @@
 	private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
 	@Resource
 	private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
-	
 
 	public static final int SALES_ASC = 1;
 	public static final int SALES_DESC = 2;
@@ -67,55 +67,9 @@
 
 	public static final int TKRATE_ASC = 5;
 	public static final int TKRATE_DESC = 6;
-	
-	
+
 	public static final int PROPOR_ASC = 7;
 	public static final int PROPOR_DESC = 8;
-
-	/**
-	 * 鎵归噺娣诲姞鏍囩 --- 娣樺疂
-	 * 
-	 * @param callback
-	 * @param label
-	 * @param request
-	 * @param out
-	 */
-	@RequestMapping(value = "addBatch")
-	public void addBatch(String callback, String auctionIds, String lableNames, HttpServletRequest request, PrintWriter out) {
-
-		try {
-			// 鑾峰彇褰撳墠鎿嶄綔鐢ㄦ埛
-			AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
-			if (admin == null) {
-				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("褰撳墠璐︽埛澶辨晥,璇烽噸鏂扮櫥闄嗐��")));
-				return;
-			}
-
-			if (StringUtil.isNullOrEmpty(auctionIds)) {
-				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("璇烽�夋嫨姝g‘鐨勫晢鍝佸叆搴�")));
-				return;
-			}
-
-			Gson gson = new Gson();
-			List<Long> auctionIdList = gson.fromJson(auctionIds, new TypeToken<ArrayList<Long>>() {
-			}.getType());
-			if (auctionIdList == null || auctionIdList.size() == 0) {
-				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("璇烽�夋嫨姝g‘鐨勫晢鍝佸叆搴�")));
-				return;
-			}
-
-			qualityFactoryService.addBatch(auctionIdList,lableNames, admin);
-
-			out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("娣诲姞鎴愬姛")));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父")));
-		}
-	}
-	
-
-	
 
 	/**
 	 * 淇濆瓨淇敼绮惧搧搴撳晢鍝佸叧鑱斾俊鎭�
@@ -126,7 +80,8 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "saveModify")
-	public void saveModify(String callback, QualityFactory selectionGoods, HttpServletRequest request, PrintWriter out) {
+	public void saveModify(String callback, QualityFactory selectionGoods, HttpServletRequest request,
+			PrintWriter out) {
 
 		try {
 			AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
@@ -196,21 +151,17 @@
 	@RequestMapping(value = "removeGoods")
 	public void removeGoods(String callback, String ids, PrintWriter out) {
 		try {
-
 			Gson gson = new Gson();
-			List<String> goodsIds = gson.fromJson(ids, new TypeToken<ArrayList<String>>() {}.getType());
+			List<Long> goodsIds = gson.fromJson(ids, new TypeToken<ArrayList<Long>>() {
+			}.getType());
 
 			if (goodsIds == null || goodsIds.size() == 0) {
 				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("鏈娴嬪埌绉婚櫎鍟嗗搧鏁版嵁")));
-			} else {
-				// 鍟嗗搧绉婚櫎绮惧搧搴�
-				qualityFactoryService.deleteByGoodsId(goodsIds);
-				// 娓呯悊鍟嗗搧鎵�鏈夋爣绛�
-				labelGoodsService.deleteByGoodsId(goodsIds);
-
-				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("绉婚櫎鎴愬姛")));
+				return;
 			}
 
+			qualityFactoryService.deleteBatchByTaoBaoGoodsId(goodsIds);
+			out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("绉婚櫎鎴愬姛")));
 		} catch (Exception e) {
 			out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("鎿嶄綔澶辫触")));
 			e.printStackTrace();
@@ -220,10 +171,11 @@
 
 	/**
 	 * 鏌ヨ
+	 * 
 	 * @param out
 	 */
 	@RequestMapping(value = "query")
-	public void query(String callback, Integer pageIndex,Integer pageSize,  Integer sort, 
+	public void query(String callback, Integer pageIndex, Integer pageSize, Integer sort,
 			QualityFactoryVO qualityFactoryVO, PrintWriter out) {
 
 		try {
@@ -261,19 +213,19 @@
 				case PROPOR_ASC:
 					propor = 1;
 					break;
-				case PROPOR_DESC:   
+				case PROPOR_DESC:
 					propor = 2;
 					break;
 				default:
 					break;
 				}
 			}
-			
+
 			qualityFactoryVO.setPrice(price);
 			qualityFactoryVO.setTkRate(tkRate);
 			qualityFactoryVO.setTotalSales(totalSales);
 			qualityFactoryVO.setPropor(propor);
-			qualityFactoryVO.setStart((pageIndex - 1) * pageSize);		
+			qualityFactoryVO.setStart((pageIndex - 1) * pageSize);
 			qualityFactoryVO.setCount(pageSize);
 
 			List<QualityFactory> selectionList = qualityFactoryService.query(qualityFactoryVO);
@@ -294,47 +246,46 @@
 
 			List<Map<String, Object>> listmap = new ArrayList<Map<String, Object>>();
 
-			/*  楠岃瘉缃戠粶: 鑾峰彇鍟嗗搧閾炬帴 鍥剧墖閾炬帴   */
+			/* 楠岃瘉缃戠粶: 鑾峰彇鍟嗗搧閾炬帴 鍥剧墖閾炬帴 */
 			List<TaoBaoGoodsBrief> goodsBriefList = new ArrayList<TaoBaoGoodsBrief>();
-			
+
 			StringBuffer idBuf = new StringBuffer();
 			StringBuffer auctionIdBuf = new StringBuffer();
-			
+
 			int j = 0;
-			for (int i = 0; i < selectionList.size(); i++ ) {
+			for (int i = 0; i < selectionList.size(); i++) {
 				QualityFactory selectionGoods = selectionList.get(i);
-				
+
 				TaoBaoGoodsBrief taoBaoGoodsBrief = selectionGoods.getTaoBaoGoodsBrief();
 				if (taoBaoGoodsBrief == null)
 					continue; // 涓虹┖缁撴潫鏈寰幆
-				
-				
+
 				Long id = taoBaoGoodsBrief.getId();
 				idBuf.append(id + ",");
-				
+
 				Long auctionId = taoBaoGoodsBrief.getAuctionId();
 				if (auctionId != null) {
 					j++;
 					auctionIdBuf.append(auctionId + ",");
 				}
-				
+
 				if (selectionList.size() <= 40) {
 					// 灏忎簬40涓弬鏁�
-					if (i == selectionList.size()-1 ){
+					if (i == selectionList.size() - 1) {
 						if (auctionIdBuf != null && auctionIdBuf.length() > 0) {
 							String auctionIds = auctionIdBuf.toString();
-							String ids = auctionIds.substring(0, auctionIds.length() -1);
+							String ids = auctionIds.substring(0, auctionIds.length() - 1);
 							List<TaoBaoGoodsBrief> list = null;
 							try {
 								list = TaoKeApiUtil.getBatchGoodsInfos(ids);
 							} catch (Exception e) {
 								e.printStackTrace();
 							}
-							
+
 							if (list != null && list.size() > 0) {
 								goodsBriefList.addAll(list);
 							}
-							
+
 							auctionIdBuf = new StringBuffer();
 						}
 					}
@@ -342,59 +293,68 @@
 					if (j == 40) {
 						// 澶т簬40鍙傛暟
 						String auctionIds = auctionIdBuf.toString();
-						String ids = auctionIds.substring(0, auctionIds.length() -1);
+						String ids = auctionIds.substring(0, auctionIds.length() - 1);
 						List<TaoBaoGoodsBrief> list = null;
 						try {
 							list = TaoKeApiUtil.getBatchGoodsInfos(ids);
 						} catch (Exception e) {
 							e.printStackTrace();
 						}
-						
+
 						if (list != null && list.size() > 0) {
 							goodsBriefList.addAll(list);
 						}
-						
-						j= 0;
+
+						j = 0;
 						auctionIdBuf = new StringBuffer();
-						
-					} else if (i == selectionList.size()-1 ){
+
+					} else if (i == selectionList.size() - 1) {
 						// 鏈�鍚庝竴涓�
 						String auctionIds = auctionIdBuf.toString();
-						String ids = auctionIds.substring(0, auctionIds.length() -1);
+						String ids = auctionIds.substring(0, auctionIds.length() - 1);
 						List<TaoBaoGoodsBrief> list = null;
 						try {
 							list = TaoKeApiUtil.getBatchGoodsInfos(ids);
 						} catch (Exception e) {
 							e.printStackTrace();
 						}
-						
+
 						if (list != null && list.size() > 0) {
 							goodsBriefList.addAll(list);
 						}
 						auctionIdBuf = new StringBuffer();
 					}
 				}
-				
+
 			}
-			
-			
+
 			for (QualityFactory selectionGoods : selectionList) {
 
 				TaoBaoGoodsBrief taoBaoGoodsBrief = selectionGoods.getTaoBaoGoodsBrief();
+
 				if (taoBaoGoodsBrief == null)
 					continue; // 涓虹┖缁撴潫鏈寰幆
 
+				// 璁剧疆鍥剧墖澶у皬
+				taoBaoGoodsBrief.setPictUrl(TbImgUtil.getTBSize220Img(taoBaoGoodsBrief.getPictUrl()));
+
+				String auctionUrl = taoBaoGoodsBrief.getAuctionUrl();
+				if (auctionUrl != null && auctionUrl.trim().length() > 0 && auctionUrl.contains("id=null")) {
+					auctionUrl = auctionUrl.replace("id=null", "id=" + taoBaoGoodsBrief.getAuctionId());
+					taoBaoGoodsBrief.setAuctionUrl(auctionUrl);
+				}
+
 				Map<String, Object> map = new HashMap<String, Object>();
-				
+
 				BoutiqueAutoRule boutiqueAutoRule = selectionGoods.getBoutiqueAutoRule();
 				if (boutiqueAutoRule == null) {
 					boutiqueAutoRule = new BoutiqueAutoRule();
 					selectionGoods.setBoutiqueAutoRule(boutiqueAutoRule);
 				}
-				
+
 				String reslutSource = "";
 				Integer gsSource = selectionGoods.getGoodsSource();
-				if (QualityFactory.SOURCE_TAOBAO == gsSource ) {
+				if (QualityFactory.SOURCE_TAOBAO == gsSource) {
 					reslutSource = "娣樺疂";
 				} else if (QualityFactory.SOURCE_TAOBAO_MATERIAL == gsSource) {
 					reslutSource = "娣樺疂鎺ㄨ崘";
@@ -409,10 +369,9 @@
 				} else if (QualityFactory.SOURCE_OTHER == gsSource) {
 					reslutSource = "鍟嗗姟鍚堜綔";
 				}
-				
+
 				map.put("goodsSource", reslutSource);
-				
-				
+
 				map.put("selectionGoods", selectionGoods);
 
 				/* 鍟嗗搧閿�鍞姸鎬侊細 0 鍦ㄥ敭 1鍋滃敭 */
@@ -420,17 +379,16 @@
 				Long auctionId = taoBaoGoodsBrief.getAuctionId();
 				if (auctionId != null) {
 					if (goodsBriefList != null && goodsBriefList.size() > 0) {
-						for (TaoBaoGoodsBrief tb :goodsBriefList) {
+						for (TaoBaoGoodsBrief tb : goodsBriefList) {
 							Long auctionIdTB = tb.getAuctionId();
 							if (auctionId.equals(auctionIdTB)) {
 								saleStae = 0;
 							}
 						}
-					} 
+					}
 				}
-				
+
 				map.put("saleStae", saleStae);
-				
 
 				/* 1 瀹氬悜璁″垝 2 钀ラ攢杩斿埄 銆侀珮浣� 3 鏅剑 */
 				Integer includeDxjh = taoBaoGoodsBrief.getIncludeDxjh();
@@ -455,10 +413,8 @@
 						map.put("yongjinType", 3);
 					}
 				}
-				
-				
-				
-				 /* 鍒稿悗浠�--璁$畻 */
+
+				/* 鍒稿悗浠�--璁$畻 */
 				BigDecimal couponPrice = TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief);
 				map.put("couponPrice", couponPrice);
 
@@ -470,24 +426,22 @@
 				BigDecimal estimateProfit = MoneyBigDecimalUtil.div(profit, new BigDecimal("100"));
 				// 棰勮鏀剁泭
 				map.put("estimateProfit", estimateProfit);
-				
-				
+
 				BigDecimal couponAmount = taoBaoGoodsBrief.getCouponAmount();
 				if (couponAmount != null && zkPrice != null) {
-					BigDecimal propors = couponAmount.divide(zkPrice ,10 ,BigDecimal.ROUND_HALF_DOWN);
+					BigDecimal propors = couponAmount.divide(zkPrice, 10, BigDecimal.ROUND_HALF_DOWN);
 					BigDecimal resultPropor = MoneyBigDecimalUtil.mul(propors, new BigDecimal("100"));
 					map.put("propor", resultPropor);
 				} else {
 					map.put("propor", 0);
 				}
-				
 
 				/* 鍟嗗搧鏍囩鍒楄〃 */
 				Long id = taoBaoGoodsBrief.getId();
 				int totalLabels = labelGoodsService.getCountQueryByGoodsId(id);
-				
-				//List<LabelGoods> labelList = labelService.getByGoodsId(id);
-				
+
+				// List<LabelGoods> labelList = labelService.getByGoodsId(id);
+
 				map.put("totalLabels", totalLabels);
 
 				listmap.add(map);
@@ -512,7 +466,8 @@
 	 * 鑾峰彇鍟嗗搧淇℃伅 浠ュ強瀵瑰簲鏍囩鍒楄〃锛涙鍟嗗搧鏍囩鍊欓�夐」
 	 * 
 	 * @param callback
-	 * @param id 绮鹃�塱d
+	 * @param id
+	 *            绮鹃�塱d
 	 * @param request
 	 * @param out
 	 */
@@ -533,7 +488,7 @@
 				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("璇ュ晢鍝佸凡涓嶅湪")));
 				return;
 			}
-			
+
 			// 鍟嗗搧鍥剧墖
 			List<String> imgList = TaoBaoUtil.getTbImg(taobao.getAuctionId() + "");
 
@@ -554,7 +509,6 @@
 
 	}
 
-
 	/**
 	 * 鍗曚釜鍟嗗搧璐翠笂鏍囩
 	 * 
@@ -570,10 +524,11 @@
 		try {
 			// 鑾峰彇褰撳墠鎿嶄綔鐢ㄦ埛
 			AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
-//			if (admin == null) {
-//				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("褰撳墠璐︽埛澶辨晥,璇烽噸鏂扮櫥闄嗐��")));
-//				return;
-//			}
+			// if (admin == null) {
+			// out.print(JsonUtil.loadJSONP(callback,
+			// JsonUtil.loadFalseResult("褰撳墠璐︽埛澶辨晥,璇烽噸鏂扮櫥闄嗐��")));
+			// return;
+			// }
 
 			if (id == null || labId == null) {
 				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("璇蜂紶閫掓纭殑鍙傛暟")));
@@ -663,11 +618,12 @@
 
 		try {
 			AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
-//
-//			if (admin == null) {
-//				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("褰撳墠璐︽埛宸插け鏁�,璇烽噸鏂扮櫥闄�")));
-//				return;
-//			} 
+			//
+			// if (admin == null) {
+			// out.print(JsonUtil.loadJSONP(callback,
+			// JsonUtil.loadFalseResult("褰撳墠璐︽埛宸插け鏁�,璇烽噸鏂扮櫥闄�")));
+			// return;
+			// }
 
 			Long id = selectionGoods.getId();
 			QualityFactory resultObj = qualityFactoryService.selectByPrimaryKey(id);
@@ -687,7 +643,6 @@
 					out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("淇敼澶辫触")));
 				}
 			}
-			
 
 		} catch (QualityFactoryException e) {
 			e.printStackTrace();
@@ -697,32 +652,32 @@
 	}
 
 	@RequestMapping(value = "queryMyLabels")
-	public void queryMyLabels(String callback, Integer pageIndex, Integer pageSize, 
-			String ids, HttpServletRequest request, PrintWriter out) {
+	public void queryMyLabels(String callback, Integer pageIndex, Integer pageSize, String ids,
+			HttpServletRequest request, PrintWriter out) {
 
 		try {
-			
+
 			if (StringUtil.isNullOrEmpty(ids)) {
 				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("璇蜂紶閫掓纭弬鏁�:101")));
 				return;
 			}
-			
+
 			Gson gson = new Gson();
-			List<Long> idList = gson.fromJson(ids, new TypeToken<ArrayList<Long>>() {}.getType());
+			List<Long> idList = gson.fromJson(ids, new TypeToken<ArrayList<Long>>() {
+			}.getType());
 			if (idList == null || idList.size() == 0) {
 				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("璇蜂紶閫掓纭弬鏁�:102")));
 				return;
 			}
-			
+
 			if (idList.size() > 1) {
 				// 鍙鐞嗗崟涓晢鍝�
 				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("璇蜂紶閫掓纭弬鏁�:103")));
 				return;
 			}
-			
-			
+
 			Long id = idList.get(0);
-			
+
 			if (id == null) {
 				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("璇蜂紶閫掓纭弬鏁�:104")));
 				return;
@@ -735,21 +690,20 @@
 				pageSize = Constant.PAGE_SIZE;
 
 			// 鍟嗗搧鏍囩鍒楄〃
-			List<LabelGoods> labelList = labelGoodsService.queryByGoodsId((pageIndex - 1) * pageSize, 
-					pageSize, id);
+			List<LabelGoods> labelList = labelGoodsService.queryByGoodsId((pageIndex - 1) * pageSize, pageSize, id);
 
 			if (labelList == null || labelList.size() == 0) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏍囩"));
 				return;
 			}
-			
+
 			int count = labelGoodsService.getCountQueryByGoodsId(id);
 
 			int totalPage = count % pageSize == 0 ? count / pageSize : count / pageSize + 1;
 			PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
 
 			GsonBuilder gsonBuilder = new GsonBuilder();
-			gsonBuilder.serializeNulls(); 
+			gsonBuilder.serializeNulls();
 			Gson rgson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
 
 			JSONObject data = new JSONObject();
@@ -776,8 +730,8 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "queryLabel")
-	public void queryLabel(String callback, Integer pageIndex, Integer pageSize, String key, 
-			String ids, HttpServletRequest request, PrintWriter out) {
+	public void queryLabel(String callback, Integer pageIndex, Integer pageSize, String key, String ids,
+			HttpServletRequest request, PrintWriter out) {
 
 		try {
 
@@ -785,29 +739,30 @@
 				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("璇蜂紶閫掓纭弬鏁�:101")));
 				return;
 			}
-			
+
 			Gson gson = new Gson();
-			List<Long> idList = gson.fromJson(ids, new TypeToken<ArrayList<Long>>() {}.getType());
+			List<Long> idList = gson.fromJson(ids, new TypeToken<ArrayList<Long>>() {
+			}.getType());
 			if (idList == null || idList.size() == 0) {
 				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("璇蜂紶閫掓纭弬鏁�:102")));
 				return;
 			}
-			
+
 			int count = 0;
 			List<Label> labelList = null;
-			
+
 			if (pageIndex == null)
 				pageIndex = 1;
 
 			if (pageSize == null)
 				pageSize = Constant.PAGE_SIZE;
-			
+
 			if (idList.size() > 1) {
 				// 澶氫釜鍟嗗搧 鏌ヨ鎵�鏈夋爣绛�
-				 labelList = labelService.query((pageIndex - 1) * pageSize, pageSize, key, null, null,null);
-				
-				 count = labelService.getQueryCount(key, null, null);
-				
+				labelList = labelService.query((pageIndex - 1) * pageSize, pageSize, key, null, null, null);
+
+				count = labelService.getQueryCount(key, null, null);
+
 			} else {
 				// 鍗曚釜鍟嗗搧
 				Long id = idList.get(0);
@@ -820,12 +775,12 @@
 
 				count = labelService.getCountQueryGoodsCandidate(key, id);
 			}
-			
+
 			if (labelList == null || labelList.size() == 0) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏍囩"));
 				return;
 			}
-			
+
 			int totalPage = count % pageSize == 0 ? count / pageSize : count / pageSize + 1;
 			PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
 
@@ -855,7 +810,8 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "addBatchcGoodsLabel")
-	public void addBatchcGoodsLabel(String callback, String labIds, Long id, HttpServletRequest request, PrintWriter out) {
+	public void addBatchcGoodsLabel(String callback, String labIds, Long id, HttpServletRequest request,
+			PrintWriter out) {
 
 		try {
 			if (StringUtil.isNullOrEmpty(labIds)) {
@@ -877,7 +833,7 @@
 			}
 
 			TaoBaoGoodsBrief taoBaoGoodsBrief = taoBaoGoodsBriefService.selectByPrimaryKey(id);
-			
+
 			// 鑾峰彇褰撳墠鎿嶄綔鐢ㄦ埛
 			AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
 			labelGoodsService.addBatchByLabId(taoBaoGoodsBrief, labIdList, admin);
@@ -889,14 +845,14 @@
 			e.printStackTrace();
 		}
 	}
-	
-	@RequestMapping(value="updateGoodsBrief")
-	public void updateGoodsBrief(String callback, TaoBaoGoodsBrief tb, PrintWriter out){
+
+	@RequestMapping(value = "updateGoodsBrief")
+	public void updateGoodsBrief(String callback, TaoBaoGoodsBrief tb, PrintWriter out) {
 		try {
-			
+
 			// 瀹為檯鏈簿閫塈D
 			Long id = tb.getId();
-			
+
 			QualityFactory resultObj = qualityFactoryService.selectByPrimaryKey(id);
 
 			if (resultObj == null) {
@@ -909,66 +865,72 @@
 				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("璇ュ晢鍝佸凡涓嶅湪")));
 				return;
 			}
-			
+
 			String title = tb.getTitle();
 			String pictUrl = tb.getPictUrl();
-			
-			if (!StringUtil.isNullOrEmpty(title)) 
+
+			if (!StringUtil.isNullOrEmpty(title))
 				taobao.setTitle(title);
-			
-			if (!StringUtil.isNullOrEmpty(pictUrl)) 
+
+			if (!StringUtil.isNullOrEmpty(pictUrl))
 				taobao.setPictUrl(pictUrl);
-			
+
+			if (!StringUtil.isNullOrEmpty(tb.getPictUrlWhite()))
+				taobao.setPictUrlWhite(tb.getPictUrlWhite());
+
 			// 鏇存柊鍟嗗搧
 			taoBaoGoodsUpdateService.getUpdateTaoBaoGoodsBrief(taobao);
-			
+
 			out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("淇敼鎴愬姛")));
-			
+
 		} catch (Exception e) {
 			e.printStackTrace();
 			out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("淇敼澶辫触")));
 		}
-		
+
 	}
-	
-	
+
 	/**
 	 * 鎵归噺娣诲姞鏍囩 --- 绮惧搧搴擄紙闅忔満鏉冮噸锛�
+	 * 
 	 * @param callback
 	 * @param request
-	 * @param out @param 		  鏉冮噸鑼冨洿 澶у��
-	 * @param 		  浣i噾鑼冨洿 灏忓��
+	 * @param out
+	 * @param 鏉冮噸鑼冨洿
+	 *            澶у��
+	 * @param 浣i噾鑼冨洿
+	 *            灏忓��
 	 */
 	@RequestMapping(value = "setWeightBatch")
-	public void setWeightBatch(String callback,String ids, Integer weight,Integer weightSmall, 
-			Integer weightLarge, HttpServletRequest request, PrintWriter out) {
+	public void setWeightBatch(String callback, String ids, Integer weight, Integer weightSmall, Integer weightLarge,
+			HttpServletRequest request, PrintWriter out) {
 
-		try {  
-		
-			 if (StringUtil.isNullOrEmpty(ids)) {
-				 out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("鏈�夋嫨闇�鎿嶄綔鐨勫晢鍝�")));
-				 return;
-			 } 
-			 
-			 Gson gson = new Gson();
-			 List<Long> idList = gson.fromJson(ids, new TypeToken<ArrayList<Long>>() {}.getType());
-			 
-			 if (idList == null || idList.size() == 0) {
-				 out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("璇烽�夋嫨闇�鎿嶄綔鐨勫晢鍝�")));
-				 return;
-			 } 
-				// 鑾峰彇褰撳墠鎿嶄綔鐢ㄦ埛
-			 AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
-			 
-			 qualityFactoryService.setWeightBatch(idList, admin, weight, weightSmall, weightLarge);
-			 out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("璁剧疆鎴愬姛")));
-	
-		} catch ( Exception e) {
+		try {
+
+			if (StringUtil.isNullOrEmpty(ids)) {
+				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("鏈�夋嫨闇�鎿嶄綔鐨勫晢鍝�")));
+				return;
+			}
+
+			Gson gson = new Gson();
+			List<Long> idList = gson.fromJson(ids, new TypeToken<ArrayList<Long>>() {
+			}.getType());
+
+			if (idList == null || idList.size() == 0) {
+				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("璇烽�夋嫨闇�鎿嶄綔鐨勫晢鍝�")));
+				return;
+			}
+			// 鑾峰彇褰撳墠鎿嶄綔鐢ㄦ埛
+			AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
+
+			qualityFactoryService.setWeightBatch(idList, admin, weight, weightSmall, weightLarge);
+			out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("璁剧疆鎴愬姛")));
+
+		} catch (Exception e) {
 			out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父")));
 			e.printStackTrace();
 		}
 
 	}
-	
-	
+
 }

--
Gitblit v1.8.0