Subversion Repositories SmartDukaan

Rev

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

Rev 33838 Rev 33873
Line 7... Line 7...
7
import com.spice.profitmandi.common.model.*;
7
import com.spice.profitmandi.common.model.*;
8
import com.spice.profitmandi.common.util.FormattingUtils;
8
import com.spice.profitmandi.common.util.FormattingUtils;
9
import com.spice.profitmandi.common.util.StringUtils;
9
import com.spice.profitmandi.common.util.StringUtils;
10
import com.spice.profitmandi.common.util.Utils;
10
import com.spice.profitmandi.common.util.Utils;
11
import com.spice.profitmandi.common.web.client.RestClient;
11
import com.spice.profitmandi.common.web.client.RestClient;
-
 
12
import com.spice.profitmandi.dao.cart.SmartCartService;
12
import com.spice.profitmandi.dao.entity.catalog.CustomerOfferItem;
13
import com.spice.profitmandi.dao.entity.catalog.CustomerOfferItem;
13
import com.spice.profitmandi.dao.entity.catalog.Item;
14
import com.spice.profitmandi.dao.entity.catalog.Item;
14
import com.spice.profitmandi.dao.entity.catalog.TagListing;
15
import com.spice.profitmandi.dao.entity.catalog.TagListing;
15
import com.spice.profitmandi.dao.entity.catalog.UpgradeOffer;
16
import com.spice.profitmandi.dao.entity.catalog.UpgradeOffer;
16
import com.spice.profitmandi.dao.entity.dtr.*;
17
import com.spice.profitmandi.dao.entity.dtr.*;
Line 248... Line 249...
248
    private CustomerOfferItemRepository customerOfferItemRepository;
249
    private CustomerOfferItemRepository customerOfferItemRepository;
249
 
250
 
250
    @Autowired
251
    @Autowired
251
    private UpgradeOfferRepository upgradeOfferRepository;
252
    private UpgradeOfferRepository upgradeOfferRepository;
252
 
253
 
-
 
254
    @Autowired
-
 
255
    private SmartCartService smartCartService;
-
 
256
 
253
    @Value("${prod}")
257
    @Value("${prod}")
254
    private boolean prodEnv;
258
    private boolean prodEnv;
255
 
259
 
256
    private static final String SMS_GATEWAY = "http://api.pinnacle.in/index.php/sms/send";
260
    private static final String SMS_GATEWAY = "http://api.pinnacle.in/index.php/sms/send";
257
    private static final String SENDER = "SMTDKN";
261
    private static final String SENDER = "SMTDKN";
Line 643... Line 647...
643
                    }
647
                    }
644
                }
648
                }
645
            }
649
            }
646
        }
650
        }
647
 
651
 
-
 
652
        // Update Partner Opening Stock current qty
-
 
653
        if (fofoOrder.getId() > 0){
-
 
654
            List<FofoOrderItem> fofoOrderItems = fofoOrderItemRepository.selectByOrderId(fofoOrder.getId());
-
 
655
            for (FofoOrderItem fofoOrderItem : fofoOrderItems) {
-
 
656
                Item item = itemRepository.selectById(fofoOrderItem.getItemId());
-
 
657
                smartCartService.minusOpeningStock(item.getId(),fofoOrder.getFofoId(),fofoOrderItem.getQuantity());
-
 
658
            }
-
 
659
        }
-
 
660
 
-
 
661
 
648
        return fofoOrder.getId();
662
        return fofoOrder.getId();
649
    }
663
    }
650
 
664
 
651
    static Map<Double, List<ScratchedGift>> GIFT_SERIES = new TreeMap<>(Comparator.reverseOrder());
665
    static Map<Double, List<ScratchedGift>> GIFT_SERIES = new TreeMap<>(Comparator.reverseOrder());
652
 
666