Subversion Repositories SmartDukaan

Rev

Rev 34832 | Rev 34956 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34832 Rev 34856
Line 9... Line 9...
9
import com.spice.profitmandi.dao.cart.CartService;
9
import com.spice.profitmandi.dao.cart.CartService;
10
import com.spice.profitmandi.dao.entity.auth.AuthUser;
10
import com.spice.profitmandi.dao.entity.auth.AuthUser;
11
import com.spice.profitmandi.dao.entity.catalog.Bid;
11
import com.spice.profitmandi.dao.entity.catalog.Bid;
12
import com.spice.profitmandi.dao.entity.catalog.Item;
12
import com.spice.profitmandi.dao.entity.catalog.Item;
13
import com.spice.profitmandi.dao.entity.catalog.TagListing;
13
import com.spice.profitmandi.dao.entity.catalog.TagListing;
-
 
14
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
14
import com.spice.profitmandi.dao.entity.fofo.LoanTransaction;
15
import com.spice.profitmandi.dao.entity.fofo.LoanTransaction;
15
import com.spice.profitmandi.dao.entity.transaction.LineItem;
16
import com.spice.profitmandi.dao.entity.transaction.LineItem;
16
import com.spice.profitmandi.dao.entity.transaction.Order;
17
import com.spice.profitmandi.dao.entity.transaction.Order;
17
import com.spice.profitmandi.dao.entity.transaction.Transaction;
18
import com.spice.profitmandi.dao.entity.transaction.Transaction;
18
import com.spice.profitmandi.dao.entity.transaction.TransactionApproval;
19
import com.spice.profitmandi.dao.entity.transaction.TransactionApproval;
Line 23... Line 24...
23
import com.spice.profitmandi.dao.repository.catalog.BidRepository;
24
import com.spice.profitmandi.dao.repository.catalog.BidRepository;
24
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
25
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
25
import com.spice.profitmandi.dao.repository.catalog.LiquidationRepository;
26
import com.spice.profitmandi.dao.repository.catalog.LiquidationRepository;
26
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
27
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
27
import com.spice.profitmandi.dao.repository.cs.CsService;
28
import com.spice.profitmandi.dao.repository.cs.CsService;
-
 
29
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
28
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
30
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
29
import com.spice.profitmandi.dao.repository.fofo.LoanTransactionRepository;
31
import com.spice.profitmandi.dao.repository.fofo.LoanTransactionRepository;
30
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
32
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
31
import com.spice.profitmandi.dao.repository.transaction.SDCreditRequirementRepository;
33
import com.spice.profitmandi.dao.repository.transaction.SDCreditRequirementRepository;
32
import com.spice.profitmandi.dao.repository.transaction.TransactionApprovalRepository;
34
import com.spice.profitmandi.dao.repository.transaction.TransactionApprovalRepository;
Line 105... Line 107...
105
    private LiquidationRepository liquidationRepository;
107
    private LiquidationRepository liquidationRepository;
106
 
108
 
107
    @Autowired
109
    @Autowired
108
    com.spice.profitmandi.dao.repository.user.UserRepository user_userRepository;
110
    com.spice.profitmandi.dao.repository.user.UserRepository user_userRepository;
109
 
111
 
-
 
112
    @Autowired
-
 
113
    FofoStoreRepository fofoStoreRepository;
-
 
114
 
110
 
115
 
111
    public void parseBulkOrders(MultipartFile file, int creatorId) throws Exception {
116
    public void parseBulkOrders(MultipartFile file, int creatorId) throws Exception {
112
        XSSFWorkbook myWorkBook = new XSSFWorkbook(file.getInputStream());
117
        XSSFWorkbook myWorkBook = new XSSFWorkbook(file.getInputStream());
113
 
118
 
114
        myWorkBook.setMissingCellPolicy(Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
119
        myWorkBook.setMissingCellPolicy(Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
Line 159... Line 164...
159
                    String message = "Pricing Does not exist for " + fofoBulkOrderModel.getItemId() + "(" + fofoBulkOrderModel.getDescription() + ")";
164
                    String message = "Pricing Does not exist for " + fofoBulkOrderModel.getItemId() + "(" + fofoBulkOrderModel.getDescription() + ")";
160
                    throw new ProfitMandiBusinessException(message, message, message);
165
                    throw new ProfitMandiBusinessException(message, message, message);
161
                }
166
                }
162
                List<String> partnerIneligibleBrands = brandsService.partnerIneligibleBrands(fofoId);
167
                List<String> partnerIneligibleBrands = brandsService.partnerIneligibleBrands(fofoId);
163
                Item item = itemRepository.selectById(fofoBulkOrderModel.getItemId());
168
                Item item = itemRepository.selectById(fofoBulkOrderModel.getItemId());
-
 
169
                FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
-
 
170
                if (!fofoStore.isInternal()) {
164
                if (partnerIneligibleBrands.contains(item.getBrand())) {
171
                    if (partnerIneligibleBrands.contains(item.getBrand())) {
165
                    throw new ProfitMandiBusinessException("Brand is not allowed", "Brand ( " + item.getBrand() + ") is not allowed for this partner", "");
172
                        throw new ProfitMandiBusinessException("Brand is not allowed", "Brand ( " + item.getBrand() + ") is not allowed for this partner", "");
-
 
173
                    }
166
                }
174
                }
167
 
175
 
168
                double itemSellingPrice = tagListing.getSellingPrice();
176
                double itemSellingPrice = tagListing.getSellingPrice();
169
                boolean isActualPrice = fofoBulkOrderModel.getItemPrice() == itemSellingPrice;
177
                boolean isActualPrice = fofoBulkOrderModel.getItemPrice() == itemSellingPrice;
170
                boolean isPriceZero = fofoBulkOrderModel.getItemPrice() == 0d;
178
                boolean isPriceZero = fofoBulkOrderModel.getItemPrice() == 0d;