Subversion Repositories SmartDukaan

Rev

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

Rev 23798 Rev 23840
Line 21... Line 21...
21
import com.spice.profitmandi.common.model.SchemeModel;
21
import com.spice.profitmandi.common.model.SchemeModel;
22
import com.spice.profitmandi.common.util.StringUtils;
22
import com.spice.profitmandi.common.util.StringUtils;
23
import com.spice.profitmandi.dao.entity.catalog.Item;
23
import com.spice.profitmandi.dao.entity.catalog.Item;
24
import com.spice.profitmandi.dao.entity.catalog.RetailerScheme;
24
import com.spice.profitmandi.dao.entity.catalog.RetailerScheme;
25
import com.spice.profitmandi.dao.entity.catalog.Scheme;
25
import com.spice.profitmandi.dao.entity.catalog.Scheme;
26
import com.spice.profitmandi.dao.entity.dtr.Role;
-
 
27
import com.spice.profitmandi.dao.entity.fofo.FofoLineItem;
26
import com.spice.profitmandi.dao.entity.fofo.FofoLineItem;
28
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
27
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
29
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
28
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
30
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
29
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
31
import com.spice.profitmandi.dao.entity.fofo.Purchase;
30
import com.spice.profitmandi.dao.entity.fofo.Purchase;
32
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
31
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
33
import com.spice.profitmandi.dao.entity.fofo.SchemeItem;
32
import com.spice.profitmandi.dao.entity.fofo.SchemeItem;
34
import com.spice.profitmandi.dao.entity.transaction.Order;
33
import com.spice.profitmandi.dao.entity.transaction.Order;
35
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
34
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
36
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
35
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
37
import com.spice.profitmandi.dao.enumuration.dtr.RoleType;
-
 
38
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
36
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
39
import com.spice.profitmandi.dao.repository.catalog.RetailerSchemeRepository;
37
import com.spice.profitmandi.dao.repository.catalog.RetailerSchemeRepository;
40
import com.spice.profitmandi.dao.repository.catalog.SchemeRepository;
38
import com.spice.profitmandi.dao.repository.catalog.SchemeRepository;
41
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
39
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
42
import com.spice.profitmandi.dao.repository.dtr.RoleRepository;
-
 
43
import com.spice.profitmandi.dao.repository.fofo.FofoLineItemRepository;
40
import com.spice.profitmandi.dao.repository.fofo.FofoLineItemRepository;
44
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
41
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
45
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
42
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
46
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
43
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
47
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
44
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
Line 105... Line 102...
105
	private OrderRepository orderRepository;
102
	private OrderRepository orderRepository;
106
 
103
 
107
	@Autowired
104
	@Autowired
108
	private FofoOrderRepository fofoOrderRepository;
105
	private FofoOrderRepository fofoOrderRepository;
109
 
106
 
110
	@Autowired
-
 
111
	private RoleRepository roleRepository;
-
 
112
 
-
 
113
	@Override
107
	@Override
114
	public void saveScheme(int creatorId, CreateSchemeRequest createSchemeRequest) throws ProfitMandiBusinessException {
108
	public void saveScheme(int creatorId, CreateSchemeRequest createSchemeRequest) throws ProfitMandiBusinessException {
115
 
109
 
116
		this.validateCreateSchemeRequest(createSchemeRequest);
110
		this.validateCreateSchemeRequest(createSchemeRequest);
117
 
111
 
Line 834... Line 828...
834
			Integer fofoId = inventoryItemRepository.selectById(inventoryItemId).getFofoId();
828
			Integer fofoId = inventoryItemRepository.selectById(inventoryItemId).getFofoId();
835
			walletService.rollbackAmountFromWallet(fofoId, amountToRollback, rollbackReference,
829
			walletService.rollbackAmountFromWallet(fofoId, amountToRollback, rollbackReference,
836
					WalletReferenceType.SCHEME_IN, rollbackReason);
830
					WalletReferenceType.SCHEME_IN, rollbackReason);
837
		}
831
		}
838
	}
832
	}
839
 
833
	
840
	@Override
834
	@Override
841
	public Map<String, Object> getSchemes(Set<Integer> roleIds, int offset, int limit)
835
	public Map<String, Object> getSchemes(Set<Integer> roleIds, int offset, int limit)
842
			throws ProfitMandiBusinessException {
836
			throws ProfitMandiBusinessException {
843
		Map<String, Object> map = new HashMap<>();
837
		Map<String, Object> map = new HashMap<>();
844
		List<Scheme> schemes = null;
838
		List<Scheme> schemes = null;