|
|
@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.uas.account.entity.RequsetStatus;
|
|
|
import com.uas.account.support.Page;
|
|
|
import com.uas.account.util.AccountUtils;
|
|
|
@@ -112,15 +113,18 @@ public class BaseInfoServiceImpl implements BaseInfoService {
|
|
|
Product product = new Product();
|
|
|
|
|
|
// 商品名称
|
|
|
- if (row.getCell(0) != null) {
|
|
|
+ if (row.getCell(0) == null) {
|
|
|
+ infos.add("第" + r + 1 + "行商品名称为空");
|
|
|
+ } else {
|
|
|
+ System.out.println(row.getCell(0));
|
|
|
row.getCell(0).setCellType(Cell.CELL_TYPE_STRING);
|
|
|
product.setTitle(row.getCell(0).getStringCellValue().trim());
|
|
|
- } else {
|
|
|
- infos.add("第" + r + 1 + "行商品名称为空");
|
|
|
}
|
|
|
|
|
|
// 型号
|
|
|
- if (row.getCell(1) != null) {
|
|
|
+ if (row.getCell(1) == null) {
|
|
|
+ infos.add("第" + r + 1 + "行编号为空");
|
|
|
+ } else {
|
|
|
row.getCell(1).setCellType(Cell.CELL_TYPE_STRING);
|
|
|
String code = row.getCell(1).getStringCellValue().trim();
|
|
|
List<Product> prods = productDao
|
|
|
@@ -130,8 +134,6 @@ public class BaseInfoServiceImpl implements BaseInfoService {
|
|
|
} else {
|
|
|
alters.add(code);
|
|
|
}
|
|
|
- } else {
|
|
|
- infos.add("第" + r + 1 + "行编号为空");
|
|
|
}
|
|
|
|
|
|
// 规格
|
|
|
@@ -175,6 +177,7 @@ public class BaseInfoServiceImpl implements BaseInfoService {
|
|
|
modelMap.put("success", total - alters.size());
|
|
|
products.add(product);
|
|
|
}
|
|
|
+ System.out.println(JSON.toJSON(products));
|
|
|
}
|
|
|
}
|
|
|
if (!CollectionUtils.isEmpty(products)) {
|
|
|
@@ -284,13 +287,14 @@ public class BaseInfoServiceImpl implements BaseInfoService {
|
|
|
purcOrder.setCurrency("RMB");
|
|
|
purcOrder.setType("平台采购");
|
|
|
purcOrder.setAuditor(SystemSession.getUser().getUserName());
|
|
|
- purcOrder.setShipAddress(SystemSession.getUser().getEnterprise().getEnAddress());
|
|
|
+ purcOrder.setShipAddress(neworder.getShipaddress());
|
|
|
purcOrder.setReceiveName(neworder.getCust().getEnName());
|
|
|
purcOrder.setReceiveCode(String.valueOf(neworder.getCust().getUu()));
|
|
|
purcOrder.setEnName(neworder.getCust().getEnName());
|
|
|
purcOrder.setCurrency(neworder.getCurrency());
|
|
|
purcOrder.setPayments(neworder.getPayments());
|
|
|
purcOrder.setRemark(neworder.getRemark());
|
|
|
+ purcOrder.setShipAddress(neworder.getShipaddress());
|
|
|
short i = 1;
|
|
|
if (!CollectionUtils.isEmpty(neworder.getOrderItems())) {
|
|
|
for (OrderItems orderitem : neworder.getOrderItems()) {
|
|
|
@@ -457,6 +461,7 @@ public class BaseInfoServiceImpl implements BaseInfoService {
|
|
|
|
|
|
@Override
|
|
|
public ModelMap addtoCart(NewPurcOrder neworder) {
|
|
|
+ System.out.println("cart--> " + JSON.toJSONString(neworder));
|
|
|
ModelMap map = new ModelMap();
|
|
|
Cart cart = new Cart();
|
|
|
Set<CartDetail> cartDetails = new HashSet<CartDetail>();
|
|
|
@@ -472,7 +477,7 @@ public class BaseInfoServiceImpl implements BaseInfoService {
|
|
|
cart.setVendUserUU(neworder.getCustUserUU());
|
|
|
cart.setVendUU(neworder.getCust().getUu());
|
|
|
cart.setCurrency("RMB");
|
|
|
- cart.setShipAddress(SystemSession.getUser().getEnterprise().getEnAddress());
|
|
|
+ cart.setShipAddress(neworder.getShipaddress());
|
|
|
cart.setReceiveName(neworder.getCust().getEnName());
|
|
|
cart.setReceiveCode(String.valueOf(neworder.getCust().getUu()));
|
|
|
cart.setEnName(neworder.getCust().getEnName());
|