Subversion Repositories SmartDukaan

Rev

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

Rev 29511 Rev 31238
Line 1... Line 1...
1
package com.spice.profitmandi.web.controller;
1
package com.spice.profitmandi.web.controller;
2
 
2
 
3
import java.time.LocalDateTime;
-
 
4
import java.util.HashMap;
-
 
5
import java.util.List;
-
 
6
import java.util.Map;
-
 
7
import java.util.stream.Collectors;
-
 
8
 
-
 
9
import javax.servlet.http.HttpServletRequest;
-
 
10
 
-
 
11
import org.apache.logging.log4j.LogManager;
-
 
12
import org.apache.logging.log4j.Logger;
-
 
13
import org.springframework.beans.factory.annotation.Autowired;
-
 
14
import org.springframework.stereotype.Controller;
-
 
15
import org.springframework.transaction.annotation.Transactional;
-
 
16
import org.springframework.ui.Model;
-
 
17
import org.springframework.web.bind.annotation.RequestBody;
-
 
18
import org.springframework.web.bind.annotation.RequestMapping;
-
 
19
import org.springframework.web.bind.annotation.RequestMethod;
-
 
20
import org.springframework.web.bind.annotation.RequestParam;
-
 
21
 
-
 
22
import com.spice.profitmandi.dao.entity.inventory.State;
3
import com.spice.profitmandi.dao.entity.inventory.State;
23
import com.spice.profitmandi.dao.entity.inventory.Warehouse;
-
 
24
import com.spice.profitmandi.dao.entity.inventory.Vendor;
4
import com.spice.profitmandi.dao.entity.inventory.Vendor;
-
 
5
import com.spice.profitmandi.dao.entity.transaction.Seller;
-
 
6
import com.spice.profitmandi.dao.entity.transaction.SellerWarehouse;
-
 
7
import com.spice.profitmandi.dao.entity.transaction.WarehouseAddressMapping;
-
 
8
import com.spice.profitmandi.dao.entity.transaction.WarehouseAddressMaster;
25
import com.spice.profitmandi.dao.entity.warehouse.Supplier;
9
import com.spice.profitmandi.dao.entity.warehouse.Supplier;
26
import com.spice.profitmandi.dao.enumuration.inventory.InventoryType;
10
import com.spice.profitmandi.dao.enumuration.inventory.InventoryType;
27
import com.spice.profitmandi.dao.enumuration.inventory.WarehouseType;
11
import com.spice.profitmandi.dao.enumuration.inventory.WarehouseType;
28
import com.spice.profitmandi.dao.hrms.CreateNewSupplier;
12
import com.spice.profitmandi.dao.hrms.CreateNewSupplier;
29
import com.spice.profitmandi.dao.hrms.WarehouseIdPrefixModel;
13
import com.spice.profitmandi.dao.hrms.WarehouseIdPrefixModel;
30
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
14
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
31
import com.spice.profitmandi.dao.repository.inventory.VendorRepository;
15
import com.spice.profitmandi.dao.repository.inventory.VendorRepository;
32
import com.spice.profitmandi.dao.repository.inventory.WarehouseRepository;
16
import com.spice.profitmandi.dao.repository.inventory.WarehouseRepository;
33
import com.spice.profitmandi.dao.repository.transaction.WareHouseAddressMasterRepository;
-
 
34
import com.spice.profitmandi.dao.repository.transaction.SellerRepository;
17
import com.spice.profitmandi.dao.repository.transaction.SellerRepository;
35
import com.spice.profitmandi.dao.repository.transaction.SellerWarehouseRepository;
18
import com.spice.profitmandi.dao.repository.transaction.SellerWarehouseRepository;
36
import com.spice.profitmandi.dao.repository.transaction.WareHouseAddressMappingRepository;
19
import com.spice.profitmandi.dao.repository.transaction.WareHouseAddressMappingRepository;
-
 
20
import com.spice.profitmandi.dao.repository.transaction.WareHouseAddressMasterRepository;
37
import com.spice.profitmandi.dao.repository.warehouse.SupplierRepository;
21
import com.spice.profitmandi.dao.repository.warehouse.SupplierRepository;
38
import com.spice.profitmandi.service.warehouse.WarehouseService;
22
import com.spice.profitmandi.service.warehouse.WarehouseService;
39
import com.spice.profitmandi.web.util.MVCResponseSender;
23
import com.spice.profitmandi.web.util.MVCResponseSender;
-
 
24
import org.apache.logging.log4j.LogManager;
-
 
25
import org.apache.logging.log4j.Logger;
-
 
26
import org.springframework.beans.factory.annotation.Autowired;
-
 
27
import org.springframework.stereotype.Controller;
-
 
28
import org.springframework.transaction.annotation.Transactional;
-
 
29
import org.springframework.ui.Model;
-
 
30
import org.springframework.web.bind.annotation.RequestBody;
-
 
31
import org.springframework.web.bind.annotation.RequestMapping;
-
 
32
import org.springframework.web.bind.annotation.RequestMethod;
-
 
33
import org.springframework.web.bind.annotation.RequestParam;
40
 
34
 
41
import com.spice.profitmandi.dao.entity.transaction.*;
35
import javax.servlet.http.HttpServletRequest;
-
 
36
import java.util.HashMap;
-
 
37
import java.util.List;
-
 
38
import java.util.Map;
-
 
39
import java.util.stream.Collectors;
42
 
40
 
43
@Controller
41
@Controller
44
@Transactional(rollbackFor = Throwable.class)
42
@Transactional(rollbackFor = Throwable.class)
45
public class SupplierController {
43
public class SupplierController {
46
 
44
 
Line 172... Line 170...
172
 
170
 
173
		Supplier supplier = supplierRepository.selectById(id);
171
		Supplier supplier = supplierRepository.selectById(id);
174
 
172
 
175
		supplier.setStatus(false);
173
		supplier.setStatus(false);
176
 
174
 
177
		model.addAttribute("response", mvcResponseSender.createResponseString(true));
175
		model.addAttribute("response1", mvcResponseSender.createResponseString(true));
178
 
176
 
179
		return "response";
177
		return "response";
180
	}
178
	}
181
 
179
 
182
	@RequestMapping(value = "/setStatusActive", method = RequestMethod.POST)
180
	@RequestMapping(value = "/setStatusActive", method = RequestMethod.POST)
Line 185... Line 183...
185
 
183
 
186
		Supplier supplier = supplierRepository.selectById(id);
184
		Supplier supplier = supplierRepository.selectById(id);
187
 
185
 
188
		supplier.setStatus(true);
186
		supplier.setStatus(true);
189
 
187
 
190
		model.addAttribute("response", mvcResponseSender.createResponseString(true));
188
		model.addAttribute("response1", mvcResponseSender.createResponseString(true));
191
 
189
 
192
		return "response";
190
		return "response";
193
 
191
 
194
	}
192
	}
195
 
193