Przeglądaj źródła

Merge remote-tracking branch 'origin/dev-mysql' into dev-mysql

hulh 8 lat temu
rodzic
commit
f120e1a477

+ 8 - 9
src/main/java/com/uas/platform/b2c/common/account/controller/SecurityController.java

@@ -1,5 +1,7 @@
 package com.uas.platform.b2c.common.account.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.uas.account.entity.UserView;
 import com.uas.platform.b2c.common.account.model.Enterprise;
 import com.uas.platform.b2c.common.account.model.SigninLog;
 import com.uas.platform.b2c.common.account.model.User;
@@ -22,10 +24,7 @@ import org.springframework.mobile.device.LiteDeviceResolver;
 import org.springframework.mobile.device.site.SitePreference;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -199,14 +198,14 @@ public class SecurityController {
 	 */
 	@RequestMapping(value = "/login/other")
 	@ResponseBody
-	public String afterCrossLogin(HttpServletRequest request, HttpServletResponse response, String uid, long time , String data) {
+	public String afterCrossLogin(HttpServletRequest request, HttpServletResponse response, UserView userView) {
 		String callback =request.getParameter("jsoncallback");
 		response.setContentType("text/html;charset=UTF-8");
-		if (uid != null && data != null) {
+		if (userView != null && userView.getUid() != null) {
  				SSOToken tk = new SSOToken();
-				tk.setUid(uid);
-				tk.setTime(time);
-				tk.setData(data);
+				tk.setUid(userView.getUid());
+				tk.setTime(System.currentTimeMillis());
+				tk.setData(JSON.toJSONString(userView));
 				SSOHelper.setSSOCookie(request, response, tk, true);
 				User user = getUserByToken(tk);
 				if (user != null) {

+ 10 - 3
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java

@@ -27,6 +27,7 @@ import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.ReleaseStatus;
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.poi.hssf.usermodel.HSSFCell;
 import org.apache.poi.hssf.usermodel.HSSFDateUtil;
 import org.apache.poi.ss.usermodel.*;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -326,7 +327,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 					}
 
 					// 最小包单价
-					Object priceMinPackQtyCellValue = readWorkBookCell(row.getCell(9), Cell.CELL_TYPE_STRING, r, 9);
+					Object priceMinPackQtyCellValue = readWorkBookCell(row.getCell(9), Cell.CELL_TYPE_NUMERIC, r, 9);
 					releaseProductByBatch.setMinPackPriceStr(StringUtilB2C.getStr(priceMinPackQtyCellValue));
 					if ((priceMinPackQtyCellValue != null)&&(isNumber(priceMinPackQtyCellValue.toString())) && (NumberUtil.compare(Double.valueOf(priceMinPackQtyCellValue.toString()), 0.0d) > 0)) {
 						Double price = Double.valueOf(priceMinPackQtyCellValue.toString());
@@ -573,7 +574,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 			if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK) {
 				switch (cellType) {
 				case Cell.CELL_TYPE_STRING:
-					cell.setCellType(Cell.CELL_TYPE_STRING);
+					cell.setCellType(HSSFCell.CELL_TYPE_STRING);
 					String str = cell.getStringCellValue().trim();
 //					Object data = getCellData(cell);
 //					String str = data == null ? "" : data.toString();
@@ -586,6 +587,12 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 				case Cell.CELL_TYPE_NUMERIC:
 					cell.setCellType(Cell.CELL_TYPE_NUMERIC);
 					obj = cell.getNumericCellValue();
+					if(obj != null) {
+						if(obj.toString().indexOf("E") > 0) {
+							BigDecimal b = new BigDecimal(obj.toString());
+							obj = b.toPlainString();
+						}
+					}
 					break;
 				default:
 					if(cell.getCellType() == Cell.CELL_TYPE_STRING) {
@@ -688,7 +695,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		Object endQtyCellValue = readWorkBookCell(cellQty, Cell.CELL_TYPE_STRING, r, num);
 		releaseProductByBatch.setFragmentQty(StringUtilB2C.getStr(endQtyCellValue), i);
 
-		Object priceCellValue = readWorkBookCell(cellPrice, Cell.CELL_TYPE_STRING, r, num + 1);
+		Object priceCellValue = readWorkBookCell(cellPrice, Cell.CELL_TYPE_NUMERIC, r, num + 1);
 		releaseProductByBatch.setFragmentPrice(StringUtilB2C.getStr(priceCellValue), i);
 		if ((endQtyCellValue != null)&&(isNumber(endQtyCellValue.toString())) && (NumberUtil.compare(Double.valueOf(endQtyCellValue.toString()), 0.0d) > 0)) {
 			Double end = Double.valueOf(endQtyCellValue.toString());