Subversion Repositories SmartDukaan

Rev

Rev 35343 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35343 Rev 37071
Line 2... Line 2...
2
 
2
 
3
 
3
 
4
import com.spice.profitmandi.common.enumuration.ItemType;
4
import com.spice.profitmandi.common.enumuration.ItemType;
5
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
5
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
6
import com.spice.profitmandi.common.util.ExcelUtils;
6
import com.spice.profitmandi.common.util.ExcelUtils;
-
 
7
import com.spice.profitmandi.common.util.StringUtils;
7
import com.spice.profitmandi.common.util.Utils;
8
import com.spice.profitmandi.common.util.Utils;
8
import com.spice.profitmandi.dao.entity.catalog.BrandCatalog;
9
import com.spice.profitmandi.dao.entity.catalog.BrandCatalog;
9
import com.spice.profitmandi.dao.entity.catalog.Catalog;
10
import com.spice.profitmandi.dao.entity.catalog.Catalog;
10
import com.spice.profitmandi.dao.entity.catalog.CategorisedCatalog;
11
import com.spice.profitmandi.dao.entity.catalog.CategorisedCatalog;
11
import com.spice.profitmandi.dao.entity.catalog.Item;
12
import com.spice.profitmandi.dao.entity.catalog.Item;
Line 88... Line 89...
88
        try {
89
        try {
89
            itemLoaderModel.setProductGroup(row.getCell(i++).getStringCellValue().trim());
90
            itemLoaderModel.setProductGroup(row.getCell(i++).getStringCellValue().trim());
90
            itemLoaderModel.setCategoryId((int) row.getCell(i++).getNumericCellValue());
91
            itemLoaderModel.setCategoryId((int) row.getCell(i++).getNumericCellValue());
91
            itemLoaderModel.setCategory(row.getCell(i++).getStringCellValue().trim());
92
            itemLoaderModel.setCategory(row.getCell(i++).getStringCellValue().trim());
92
            itemLoaderModel.setHsnCode(String.valueOf((int) row.getCell(i++).getNumericCellValue()));
93
            itemLoaderModel.setHsnCode(String.valueOf((int) row.getCell(i++).getNumericCellValue()));
93
            itemLoaderModel.setBrand(row.getCell(i++).getStringCellValue().trim());
94
            itemLoaderModel.setBrand(StringUtils.normalizeWhitespace(row.getCell(i++).getStringCellValue()));
94
            Cell modelNumberCell = row.getCell(i++);
95
            Cell modelNumberCell = row.getCell(i++);
95
            if(modelNumberCell== null || modelNumberCell.getStringCellValue().trim().equals("")) {
96
            if(modelNumberCell== null || StringUtils.normalizeWhitespace(modelNumberCell.getStringCellValue()).isEmpty()) {
96
                throw new Exception("Model Number cant be null or empty");
97
                throw new Exception("Model Number cant be null or empty");
97
            } else {
98
            } else {
98
                itemLoaderModel.setModelNumber(modelNumberCell.getStringCellValue().trim());
99
                itemLoaderModel.setModelNumber(StringUtils.normalizeWhitespace(modelNumberCell.getStringCellValue()));
99
            }
100
            }
100
            Cell modelNameCell = row.getCell(i++);
101
            Cell modelNameCell = row.getCell(i++);
101
            if (modelNameCell == null) {
102
            if (modelNameCell == null) {
102
                itemLoaderModel.setModelName("");
103
                itemLoaderModel.setModelName("");
103
            } else {
104
            } else {
104
                itemLoaderModel.setModelName(modelNameCell.getStringCellValue().trim());
105
                itemLoaderModel.setModelName(StringUtils.normalizeWhitespace(modelNameCell.getStringCellValue()));
105
            }
106
            }
106
            itemLoaderModel.setColor(row.getCell(i++).getStringCellValue().trim());
107
            itemLoaderModel.setColor(StringUtils.normalizeWhitespace(row.getCell(i++).getStringCellValue()));
107
            //MRP	SP	MOP	DP	TP	NLC	Startdate	Preferred Vendor	Risky
108
            //MRP	SP	MOP	DP	TP	NLC	Startdate	Preferred Vendor	Risky
108
            // Weight	Item type(1 for Serialized and 2 for non-serialized)	TaxRate
109
            // Weight	Item type(1 for Serialized and 2 for non-serialized)	TaxRate
109
            itemLoaderModel.setMrp(row.getCell(i++).getNumericCellValue());
110
            itemLoaderModel.setMrp(row.getCell(i++).getNumericCellValue());
110
            itemLoaderModel.setSp(row.getCell(i++).getNumericCellValue());
111
            itemLoaderModel.setSp(row.getCell(i++).getNumericCellValue());
111
            itemLoaderModel.setMop(row.getCell(i++).getNumericCellValue());
112
            itemLoaderModel.setMop(row.getCell(i++).getNumericCellValue());