| 24417 |
govind |
1 |
package com.spice.profitmandi.web.controller;
|
|
|
2 |
|
|
|
3 |
import java.time.LocalDateTime;
|
| 24572 |
amit.gupta |
4 |
import java.util.ArrayList;
|
| 27139 |
amit.gupta |
5 |
import java.util.Arrays;
|
| 24417 |
govind |
6 |
import java.util.HashSet;
|
|
|
7 |
import java.util.List;
|
|
|
8 |
import java.util.Map;
|
|
|
9 |
import java.util.Optional;
|
| 24572 |
amit.gupta |
10 |
import java.util.Set;
|
| 24500 |
govind |
11 |
import java.util.stream.Collectors;
|
| 24417 |
govind |
12 |
|
|
|
13 |
import javax.servlet.http.HttpServletRequest;
|
| 24699 |
govind |
14 |
import javax.swing.SortOrder;
|
| 24417 |
govind |
15 |
|
|
|
16 |
import org.apache.logging.log4j.LogManager;
|
|
|
17 |
import org.apache.logging.log4j.Logger;
|
|
|
18 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 24620 |
govind |
19 |
import org.springframework.mail.javamail.JavaMailSender;
|
| 24417 |
govind |
20 |
import org.springframework.stereotype.Controller;
|
|
|
21 |
import org.springframework.transaction.annotation.Transactional;
|
|
|
22 |
import org.springframework.ui.Model;
|
| 24471 |
govind |
23 |
import org.springframework.web.bind.annotation.DeleteMapping;
|
| 24417 |
govind |
24 |
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
25 |
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
26 |
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
27 |
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
28 |
|
|
|
29 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
|
|
30 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| 24620 |
govind |
31 |
import com.spice.profitmandi.common.util.Utils;
|
| 24417 |
govind |
32 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
|
|
33 |
import com.spice.profitmandi.dao.entity.cs.Activity;
|
| 27270 |
tejbeer |
34 |
import com.spice.profitmandi.dao.entity.cs.ActivityAttachment;
|
| 25570 |
tejbeer |
35 |
import com.spice.profitmandi.dao.entity.cs.PartnerPosition;
|
| 24417 |
govind |
36 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
|
|
37 |
import com.spice.profitmandi.dao.entity.cs.Region;
|
|
|
38 |
import com.spice.profitmandi.dao.entity.cs.Ticket;
|
| 24500 |
govind |
39 |
import com.spice.profitmandi.dao.entity.cs.TicketAssigned;
|
| 24417 |
govind |
40 |
import com.spice.profitmandi.dao.entity.cs.TicketCategory;
|
| 24747 |
govind |
41 |
import com.spice.profitmandi.dao.entity.cs.TicketSearchType;
|
| 24417 |
govind |
42 |
import com.spice.profitmandi.dao.entity.cs.TicketSubCategory;
|
| 27270 |
tejbeer |
43 |
import com.spice.profitmandi.dao.entity.dtr.Document;
|
| 24417 |
govind |
44 |
import com.spice.profitmandi.dao.entity.fofo.ActivityType;
|
|
|
45 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 24699 |
govind |
46 |
import com.spice.profitmandi.dao.enumuration.cs.TicketStatus;
|
| 25570 |
tejbeer |
47 |
import com.spice.profitmandi.dao.model.CreatePositionModel;
|
| 24417 |
govind |
48 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 27270 |
tejbeer |
49 |
import com.spice.profitmandi.dao.repository.catalog.DeviceRepository;
|
|
|
50 |
import com.spice.profitmandi.dao.repository.cs.ActivityAttachmentRepository;
|
| 24417 |
govind |
51 |
import com.spice.profitmandi.dao.repository.cs.ActivityRepository;
|
|
|
52 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 24557 |
govind |
53 |
import com.spice.profitmandi.dao.repository.cs.PartnerRegionRepository;
|
| 25570 |
tejbeer |
54 |
import com.spice.profitmandi.dao.repository.cs.PartnersPositionRepository;
|
| 24417 |
govind |
55 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
|
|
56 |
import com.spice.profitmandi.dao.repository.cs.RegionRepository;
|
| 24500 |
govind |
57 |
import com.spice.profitmandi.dao.repository.cs.TicketAssignedRepository;
|
| 24417 |
govind |
58 |
import com.spice.profitmandi.dao.repository.cs.TicketCategoryRepository;
|
|
|
59 |
import com.spice.profitmandi.dao.repository.cs.TicketRepository;
|
|
|
60 |
import com.spice.profitmandi.dao.repository.cs.TicketSubCategoryRepository;
|
| 27270 |
tejbeer |
61 |
import com.spice.profitmandi.dao.repository.dtr.DocumentRepository;
|
| 25570 |
tejbeer |
62 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 24417 |
govind |
63 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
|
|
64 |
import com.spice.profitmandi.service.slab.TargetSlabService;
|
|
|
65 |
import com.spice.profitmandi.service.user.RetailerService;
|
|
|
66 |
import com.spice.profitmandi.web.model.LoginDetails;
|
|
|
67 |
import com.spice.profitmandi.web.util.CookiesProcessor;
|
|
|
68 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
|
|
69 |
|
|
|
70 |
@Controller
|
|
|
71 |
@Transactional(rollbackFor = Throwable.class)
|
|
|
72 |
public class CsController {
|
|
|
73 |
|
|
|
74 |
private static final Logger LOGGER = LogManager.getLogger(CsController.class);
|
|
|
75 |
|
| 24620 |
govind |
76 |
private static final String ACTIVITY_SUBJECT = "Message related ticketId#%s";
|
| 24699 |
govind |
77 |
private static final String PARTNER_RESOLVED_TICKET_MAIL = "Dear Partner , we have resolved your ticket # %s , request to kindly accept the same. In case you still have any concerns regarding the same pls click on %s so that we can help you.Regards\nSmartdukaan";
|
|
|
78 |
private static final String PARTNER_REOPEN = "Dear Partner , Your ticket # %s has been re-opened as per your confirmation & we are committed to resolve it on priority.Regards\nSmartdukaan";
|
| 27205 |
amit.gupta |
79 |
private static final String INTERNAL_REOPEN_MAIL = "Team, Pls note that the Ticket Id %s has been re-opened by %s , pls respond on priority";
|
|
|
80 |
private static final String INTERNAL_REOPEN_ACTIVITY_MESSAGE = "Hi,My ticket is not resolved yet,so I have reopened it";
|
| 24699 |
govind |
81 |
|
| 24417 |
govind |
82 |
@Autowired
|
| 24620 |
govind |
83 |
JavaMailSender mailSender;
|
|
|
84 |
|
|
|
85 |
@Autowired
|
| 24417 |
govind |
86 |
private CsService csService;
|
|
|
87 |
|
|
|
88 |
@Autowired
|
|
|
89 |
private CookiesProcessor cookiesProcessor;
|
|
|
90 |
|
|
|
91 |
@Autowired
|
|
|
92 |
private TicketCategoryRepository ticketCategoryRepository;
|
|
|
93 |
|
|
|
94 |
@Autowired
|
|
|
95 |
private TicketSubCategoryRepository ticketSubCategoryRepository;
|
|
|
96 |
|
|
|
97 |
@Autowired
|
|
|
98 |
private RegionRepository regionRepository;
|
|
|
99 |
|
|
|
100 |
@Autowired
|
|
|
101 |
private TargetSlabService targetSlabService;
|
|
|
102 |
|
|
|
103 |
@Autowired
|
|
|
104 |
private RetailerService retailerService;
|
|
|
105 |
|
|
|
106 |
@Autowired
|
|
|
107 |
private MVCResponseSender mvcResponseSender;
|
|
|
108 |
|
|
|
109 |
@Autowired
|
|
|
110 |
private AuthRepository authRepository;
|
|
|
111 |
|
|
|
112 |
@Autowired
|
|
|
113 |
private PositionRepository positionRepository;
|
|
|
114 |
|
|
|
115 |
@Autowired
|
|
|
116 |
private TicketRepository ticketRepository;
|
|
|
117 |
|
|
|
118 |
@Autowired
|
|
|
119 |
private RoleManager roleManager;
|
|
|
120 |
|
|
|
121 |
@Autowired
|
|
|
122 |
private ActivityRepository activityRepository;
|
|
|
123 |
|
| 24500 |
govind |
124 |
@Autowired
|
| 27270 |
tejbeer |
125 |
private ActivityAttachmentRepository activityAttachmentRepository;
|
|
|
126 |
|
|
|
127 |
@Autowired
|
| 24500 |
govind |
128 |
private TicketAssignedRepository ticketAssignedRepository;
|
| 24569 |
govind |
129 |
|
|
|
130 |
@Autowired
|
| 24557 |
govind |
131 |
private PartnerRegionRepository partnerRegionRepository;
|
| 24500 |
govind |
132 |
|
| 25570 |
tejbeer |
133 |
@Autowired
|
|
|
134 |
PartnersPositionRepository partnersPositionRepository;
|
|
|
135 |
|
|
|
136 |
@Autowired
|
|
|
137 |
FofoStoreRepository fofoStoreRepository;
|
|
|
138 |
|
| 27270 |
tejbeer |
139 |
@Autowired
|
|
|
140 |
DocumentRepository documentRepository;
|
|
|
141 |
|
| 24417 |
govind |
142 |
@GetMapping(value = "/cs/createCategory")
|
|
|
143 |
public String getCreateCategory(HttpServletRequest request, Model model) {
|
|
|
144 |
List<TicketCategory> ticketCategories = ticketCategoryRepository.selectAll();
|
|
|
145 |
model.addAttribute("ticketCategories", ticketCategories);
|
|
|
146 |
return "create-ticket-category";
|
|
|
147 |
}
|
|
|
148 |
|
|
|
149 |
@PostMapping(value = "/cs/createCategory")
|
|
|
150 |
public String createCategory(HttpServletRequest request, @RequestParam(name = "name") String name,
|
|
|
151 |
@RequestParam(name = "description") String description, Model model) throws ProfitMandiBusinessException {
|
|
|
152 |
|
|
|
153 |
TicketCategory ticketCategory = ticketCategoryRepository.selectByName(name);
|
|
|
154 |
if (ticketCategory != null) {
|
|
|
155 |
throw new ProfitMandiBusinessException("name", name, "already exists!");
|
|
|
156 |
}
|
|
|
157 |
ticketCategory = new TicketCategory();
|
|
|
158 |
ticketCategory.setName(name);
|
|
|
159 |
ticketCategory.setDescription(description);
|
|
|
160 |
ticketCategoryRepository.persist(ticketCategory);
|
|
|
161 |
return "create-ticket-category";
|
|
|
162 |
}
|
|
|
163 |
|
|
|
164 |
@GetMapping(value = "/cs/createSubCategory")
|
|
|
165 |
public String getCreateSubCategory(HttpServletRequest request, Model model) {
|
|
|
166 |
List<TicketCategory> ticketCategories = ticketCategoryRepository.selectAll();
|
|
|
167 |
model.addAttribute("ticketCategories", ticketCategories);
|
|
|
168 |
return "create-ticket-sub-category";
|
|
|
169 |
}
|
|
|
170 |
|
|
|
171 |
@GetMapping(value = "/cs/getSubCategoryByCategoryId")
|
|
|
172 |
public String getSubCategoryByCategoryId(HttpServletRequest request,
|
|
|
173 |
@RequestParam(name = "ticketCategoryId", defaultValue = "") int ticketCategoryId, Model model) {
|
|
|
174 |
List<TicketSubCategory> ticketSubCategories = ticketSubCategoryRepository.selectAll(ticketCategoryId);
|
|
|
175 |
TicketCategory ticketCategory = ticketCategoryRepository.selectById(ticketCategoryId);
|
|
|
176 |
model.addAttribute("ticketSubCategories", ticketSubCategories);
|
|
|
177 |
model.addAttribute("ticketCategory", ticketCategory);
|
|
|
178 |
return "ticket-sub-category";
|
|
|
179 |
}
|
|
|
180 |
|
|
|
181 |
@PostMapping(value = "/cs/createSubCategory")
|
|
|
182 |
public String createSubCategory(HttpServletRequest request,
|
|
|
183 |
@RequestParam(name = "categoryId", defaultValue = "0") int categoryId,
|
|
|
184 |
@RequestParam(name = "name") String name, @RequestParam(name = "description") String description,
|
|
|
185 |
Model model) throws ProfitMandiBusinessException {
|
|
|
186 |
|
|
|
187 |
TicketSubCategory ticketSubCategory = ticketSubCategoryRepository.selectTicketSubCategory(categoryId, name);
|
|
|
188 |
if (ticketSubCategory != null) {
|
|
|
189 |
throw new ProfitMandiBusinessException("name & categoryId", name + " " + categoryId, "already exists!");
|
|
|
190 |
}
|
|
|
191 |
|
|
|
192 |
ticketSubCategory = new TicketSubCategory();
|
| 27124 |
amit.gupta |
193 |
ticketSubCategory.setCategoryId(categoryId);
|
| 24417 |
govind |
194 |
ticketSubCategory.setName(name);
|
|
|
195 |
ticketSubCategory.setDescription(description);
|
|
|
196 |
ticketSubCategoryRepository.persist(ticketSubCategory);
|
|
|
197 |
return "create-ticket-sub-category";
|
|
|
198 |
}
|
|
|
199 |
|
|
|
200 |
@GetMapping(value = "/cs/createRegion")
|
|
|
201 |
public String createRegion(HttpServletRequest request, Model model) {
|
|
|
202 |
List<Region> regions = regionRepository.selectAll();
|
|
|
203 |
model.addAttribute("regions", regions);
|
|
|
204 |
return "create-region";
|
|
|
205 |
}
|
|
|
206 |
|
|
|
207 |
@PostMapping(value = "/cs/createRegion")
|
|
|
208 |
public String createRegion(HttpServletRequest request, @RequestParam(name = "name") String name,
|
|
|
209 |
@RequestParam(name = "description") String description, Model model) throws Exception {
|
|
|
210 |
Region region = regionRepository.selectByName(name);
|
|
|
211 |
if (region != null) {
|
|
|
212 |
throw new ProfitMandiBusinessException("name", name, "already exists!");
|
|
|
213 |
}
|
|
|
214 |
region = new Region();
|
|
|
215 |
region.setName(name);
|
|
|
216 |
region.setDescription(description);
|
|
|
217 |
regionRepository.persist(region);
|
|
|
218 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
|
|
219 |
return "response";
|
|
|
220 |
}
|
|
|
221 |
|
| 24557 |
govind |
222 |
@GetMapping(value = "/cs/getPartners")
|
| 24569 |
govind |
223 |
public String getPartners(HttpServletRequest request,
|
|
|
224 |
@RequestParam(name = "regionId", defaultValue = "0") int regionId, Model model) {
|
| 24557 |
govind |
225 |
List<Integer> fofoIds = targetSlabService.getfofoIdsFromfofoStore();
|
| 24569 |
govind |
226 |
List<Integer> addedfofoIds = partnerRegionRepository.selectByRegionId(regionId).stream().map(x -> x.getFofoId())
|
|
|
227 |
.collect(Collectors.toList());
|
| 24557 |
govind |
228 |
Map<Integer, CustomRetailer> fofoRetailers = retailerService.getFofoRetailers(fofoIds);
|
|
|
229 |
model.addAttribute("fofoRetailers", fofoRetailers);
|
|
|
230 |
model.addAttribute("addedfofoIds", addedfofoIds);
|
|
|
231 |
return "added-region-partners";
|
|
|
232 |
}
|
| 24569 |
govind |
233 |
|
| 25570 |
tejbeer |
234 |
@GetMapping(value = "/cs/getPartnersByRegion")
|
|
|
235 |
public String getPartnersByRegion(HttpServletRequest request,
|
|
|
236 |
@RequestParam(name = "regionId", defaultValue = "0") int regionId, Model model) {
|
|
|
237 |
List<Integer> fofoIds = null;
|
|
|
238 |
fofoIds = partnerRegionRepository.selectByRegionId(regionId).stream().map(x -> x.getFofoId())
|
|
|
239 |
.collect(Collectors.toList());
|
|
|
240 |
|
|
|
241 |
if (fofoIds.contains(0)) {
|
|
|
242 |
fofoIds = fofoStoreRepository.selectAll().stream().filter(x -> x.isActive()).collect(Collectors.toList())
|
|
|
243 |
.stream().map(x -> x.getId()).collect(Collectors.toList());
|
|
|
244 |
|
|
|
245 |
}
|
|
|
246 |
Map<Integer, CustomRetailer> fofoRetailers = retailerService.getFofoRetailers(fofoIds);
|
|
|
247 |
|
|
|
248 |
model.addAttribute("fofoRetailers", fofoRetailers);
|
|
|
249 |
return "added-subregion-partners";
|
|
|
250 |
}
|
|
|
251 |
|
| 24417 |
govind |
252 |
@GetMapping(value = "/cs/createPartnerRegion")
|
|
|
253 |
public String createPartnerRegion(HttpServletRequest request, Model model) {
|
|
|
254 |
List<Region> regions = regionRepository.selectAll();
|
|
|
255 |
model.addAttribute("regions", regions);
|
|
|
256 |
return "create-partner-region";
|
|
|
257 |
}
|
|
|
258 |
|
|
|
259 |
@PostMapping(value = "/cs/createPartnerRegion")
|
|
|
260 |
public String createPartnerRegion(HttpServletRequest request, @RequestParam(name = "regionId") int regionId,
|
|
|
261 |
@RequestBody List<Integer> selectedFofoIds, Model model) throws Exception {
|
| 24557 |
govind |
262 |
partnerRegionRepository.delete(regionId);
|
|
|
263 |
LOGGER.info("successfully removed");
|
|
|
264 |
LOGGER.info(selectedFofoIds.size());
|
| 24417 |
govind |
265 |
csService.addPartnerToRegion(regionId, selectedFofoIds);
|
|
|
266 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
|
|
267 |
return "response";
|
|
|
268 |
}
|
|
|
269 |
|
|
|
270 |
@GetMapping(value = "/cs/createPosition")
|
| 24500 |
govind |
271 |
public String createPosition(HttpServletRequest request,
|
|
|
272 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
| 24471 |
govind |
273 |
@RequestParam(name = "limit", defaultValue = "10") int limit, Model model) {
|
| 25570 |
tejbeer |
274 |
List<AuthUser> authUsers = authRepository.selectAllActiveUser();
|
| 24417 |
govind |
275 |
List<TicketCategory> ticketCategories = ticketCategoryRepository.selectAll();
|
|
|
276 |
List<Region> regions = regionRepository.selectAll();
|
|
|
277 |
model.addAttribute("escalationTypes", EscalationType.values());
|
|
|
278 |
model.addAttribute("authUsers", authUsers);
|
|
|
279 |
model.addAttribute("ticketCategories", ticketCategories);
|
|
|
280 |
model.addAttribute("regions", regions);
|
| 24500 |
govind |
281 |
|
|
|
282 |
List<Position> positions = positionRepository.selectAll(offset, limit);
|
|
|
283 |
LOGGER.info(positions);
|
|
|
284 |
Map<Integer, AuthUser> authUserIdAndAuthUserMap = csService
|
|
|
285 |
.getAuthUserIdAndAuthUserMapUsingPositions(positions);
|
|
|
286 |
Map<Integer, TicketCategory> categoryIdAndCategoryMap = csService
|
|
|
287 |
.getCategoryIdAndCategoryUsingPositions(positions);
|
|
|
288 |
Map<Integer, Region> regionIdAndRegionMap = csService.getRegionIdAndRegionMap(positions);
|
| 25570 |
tejbeer |
289 |
|
|
|
290 |
Map<Integer, List<CustomRetailer>> positionIdAndpartnerRegionMap = csService
|
|
|
291 |
.getpositionIdAndpartnerRegionMap(positions);
|
|
|
292 |
|
|
|
293 |
Map<Integer, List<CustomRetailer>> addedpositionIdAndCustomRetailerMap = csService
|
|
|
294 |
.getPositionCustomRetailerMap(positions);
|
|
|
295 |
LOGGER.info("fofoIdAndCustomRetailerMap" + addedpositionIdAndCustomRetailerMap);
|
| 24500 |
govind |
296 |
long size = positionRepository.selectAllCount();
|
|
|
297 |
|
| 24471 |
govind |
298 |
if (size < limit) {
|
|
|
299 |
model.addAttribute("end", offset + size);
|
|
|
300 |
} else {
|
|
|
301 |
model.addAttribute("end", offset + limit);
|
|
|
302 |
}
|
| 25570 |
tejbeer |
303 |
|
| 24471 |
govind |
304 |
model.addAttribute("start", offset + 1);
|
|
|
305 |
model.addAttribute("size", size);
|
|
|
306 |
model.addAttribute("positions", positions);
|
|
|
307 |
model.addAttribute("authUserIdAndAuthUserMap", authUserIdAndAuthUserMap);
|
|
|
308 |
model.addAttribute("categoryIdAndCategoryMap", categoryIdAndCategoryMap);
|
|
|
309 |
model.addAttribute("regionIdAndRegionMap", regionIdAndRegionMap);
|
| 25570 |
tejbeer |
310 |
model.addAttribute("positionIdAndCustomRetailerMap", addedpositionIdAndCustomRetailerMap);
|
|
|
311 |
model.addAttribute("positionIdAndpartnerRegionMap", positionIdAndpartnerRegionMap);
|
|
|
312 |
|
| 24417 |
govind |
313 |
return "create-position";
|
|
|
314 |
}
|
| 24500 |
govind |
315 |
|
| 24471 |
govind |
316 |
@GetMapping(value = "/cs/position-paginated")
|
| 24500 |
govind |
317 |
public String positionPaginated(HttpServletRequest request,
|
|
|
318 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
| 24471 |
govind |
319 |
@RequestParam(name = "limit", defaultValue = "10") int limit, Model model) {
|
| 24500 |
govind |
320 |
|
|
|
321 |
List<Position> positions = positionRepository.selectAll(offset, limit);
|
|
|
322 |
Map<Integer, AuthUser> authUserIdAndAuthUserMap = csService
|
|
|
323 |
.getAuthUserIdAndAuthUserMapUsingPositions(positions);
|
|
|
324 |
Map<Integer, TicketCategory> categoryIdAndCategoryMap = csService
|
|
|
325 |
.getCategoryIdAndCategoryUsingPositions(positions);
|
|
|
326 |
Map<Integer, Region> regionIdAndRegionMap = csService.getRegionIdAndRegionMap(positions);
|
| 25570 |
tejbeer |
327 |
|
|
|
328 |
Map<Integer, List<CustomRetailer>> positionIdAndpartnerRegionMap = csService
|
|
|
329 |
.getpositionIdAndpartnerRegionMap(positions);
|
|
|
330 |
|
|
|
331 |
Map<Integer, List<CustomRetailer>> addedpositionIdAndCustomRetailerMap = csService
|
|
|
332 |
.getPositionCustomRetailerMap(positions);
|
|
|
333 |
|
| 24471 |
govind |
334 |
model.addAttribute("positions", positions);
|
|
|
335 |
model.addAttribute("authUserIdAndAuthUserMap", authUserIdAndAuthUserMap);
|
|
|
336 |
model.addAttribute("categoryIdAndCategoryMap", categoryIdAndCategoryMap);
|
|
|
337 |
model.addAttribute("regionIdAndRegionMap", regionIdAndRegionMap);
|
| 25570 |
tejbeer |
338 |
model.addAttribute("positionIdAndCustomRetailerMap", addedpositionIdAndCustomRetailerMap);
|
|
|
339 |
model.addAttribute("positionIdAndpartnerRegionMap", positionIdAndpartnerRegionMap);
|
|
|
340 |
|
| 24471 |
govind |
341 |
return "position-paginated";
|
|
|
342 |
}
|
| 24417 |
govind |
343 |
|
|
|
344 |
@PostMapping(value = "/cs/createPosition")
|
| 25570 |
tejbeer |
345 |
public String createPosition(HttpServletRequest request, @RequestBody CreatePositionModel createPositionModel,
|
|
|
346 |
Model model) throws Exception {
|
| 24417 |
govind |
347 |
|
| 25570 |
tejbeer |
348 |
Position position = positionRepository.selectPosition(createPositionModel.getAuthUserId(),
|
|
|
349 |
createPositionModel.getCategoryId(), createPositionModel.getRegionId(),
|
|
|
350 |
createPositionModel.getEscalationType());
|
| 24417 |
govind |
351 |
if (position == null) {
|
|
|
352 |
position = new Position();
|
| 25570 |
tejbeer |
353 |
position.setAuthUserId(createPositionModel.getAuthUserId());
|
|
|
354 |
position.setCategoryId(createPositionModel.getCategoryId());
|
|
|
355 |
position.setEscalationType(createPositionModel.getEscalationType());
|
|
|
356 |
position.setRegionId(createPositionModel.getRegionId());
|
| 24417 |
govind |
357 |
position.setCreateTimestamp(LocalDateTime.now());
|
|
|
358 |
positionRepository.persist(position);
|
| 25570 |
tejbeer |
359 |
|
|
|
360 |
for (int fofoId : createPositionModel.getFofoIds()) {
|
|
|
361 |
|
|
|
362 |
PartnerPosition partnerPosition = new PartnerPosition();
|
|
|
363 |
partnerPosition.setFofoId(fofoId);
|
|
|
364 |
partnerPosition.setRegionId(createPositionModel.getRegionId());
|
|
|
365 |
partnerPosition.setPositionId(position.getId());
|
|
|
366 |
partnersPositionRepository.persist(partnerPosition);
|
|
|
367 |
LOGGER.info("partnerPosition" + partnerPosition);
|
|
|
368 |
}
|
|
|
369 |
|
| 24417 |
govind |
370 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
|
|
371 |
} else {
|
| 25570 |
tejbeer |
372 |
throw new ProfitMandiBusinessException("Position", createPositionModel.getAuthUserId(), "already exists!");
|
| 24417 |
govind |
373 |
}
|
|
|
374 |
return "response";
|
|
|
375 |
}
|
|
|
376 |
|
| 25570 |
tejbeer |
377 |
@PostMapping(value = "/cs/updatePartnerPosition")
|
|
|
378 |
public String updatePartnerPosition(HttpServletRequest request, @RequestParam(name = "regionId") int regionId,
|
|
|
379 |
@RequestBody List<Integer> selectedFofoIds, @RequestParam(name = "positionId") int positionId, Model model)
|
|
|
380 |
throws Exception {
|
|
|
381 |
|
|
|
382 |
partnersPositionRepository.delete(positionId);
|
|
|
383 |
for (int fofoId : selectedFofoIds) {
|
|
|
384 |
PartnerPosition partnerPosition = new PartnerPosition();
|
|
|
385 |
partnerPosition.setFofoId(fofoId);
|
|
|
386 |
partnerPosition.setRegionId(regionId);
|
|
|
387 |
partnerPosition.setPositionId(positionId);
|
|
|
388 |
partnersPositionRepository.persist(partnerPosition);
|
|
|
389 |
}
|
|
|
390 |
|
|
|
391 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
|
|
392 |
|
|
|
393 |
return "response";
|
|
|
394 |
}
|
|
|
395 |
|
| 24417 |
govind |
396 |
@GetMapping(value = "/cs/createTicket")
|
| 24824 |
govind |
397 |
public String createTicket(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
|
|
|
398 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 24500 |
govind |
399 |
List<TicketCategory> ticketCategories = csService.getAllTicketCategotyFromSubCategory();
|
| 24824 |
govind |
400 |
model.addAttribute("roleType", roleManager.isAdmin(loginDetails.getRoleIds()));
|
| 24417 |
govind |
401 |
model.addAttribute("ticketCategories", ticketCategories);
|
|
|
402 |
return "create-ticket";
|
|
|
403 |
}
|
|
|
404 |
|
|
|
405 |
@GetMapping(value = "/cs/getSubCategoriesByCategoryId")
|
|
|
406 |
public String getSubCategoriesByCategoryId(HttpServletRequest request,
|
|
|
407 |
@RequestParam(name = "categoryId", defaultValue = "0") int categoryId, Model model) {
|
|
|
408 |
List<TicketSubCategory> ticketSubCategories = ticketSubCategoryRepository.selectAll(categoryId);
|
|
|
409 |
LOGGER.info(ticketSubCategories);
|
|
|
410 |
model.addAttribute("ticketSubCategories", ticketSubCategories);
|
|
|
411 |
return "ticket-sub-categories";
|
|
|
412 |
}
|
|
|
413 |
|
|
|
414 |
@PostMapping(value = "/cs/createTicket")
|
|
|
415 |
public String createTicket(HttpServletRequest request, @RequestParam(name = "categoryId") int categoryId,
|
|
|
416 |
@RequestParam(name = "subCategoryId") int subCategoryId, @RequestParam(name = "message") String message,
|
|
|
417 |
Model model) throws Exception {
|
|
|
418 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 24837 |
govind |
419 |
List<Ticket> tickets = ticketRepository.selectAllResolvedMarkedTicketByCreator(loginDetails.getFofoId());
|
| 24620 |
govind |
420 |
if (tickets.size() > 3 || tickets.size() == 3) {
|
|
|
421 |
model.addAttribute("response", mvcResponseSender.createResponseString(false));
|
|
|
422 |
} else {
|
|
|
423 |
csService.createTicket(loginDetails.getFofoId(), categoryId, subCategoryId, message);
|
|
|
424 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
|
|
425 |
}
|
| 24417 |
govind |
426 |
return "response";
|
|
|
427 |
}
|
|
|
428 |
|
|
|
429 |
@GetMapping(value = "/cs/myticket")
|
| 24699 |
govind |
430 |
public String getTicket(HttpServletRequest request,
|
|
|
431 |
@RequestParam(name = "orderby", defaultValue = "DESCENDING") SortOrder sortOrder,
|
|
|
432 |
@RequestParam(name = "ticketStatus", defaultValue = "OPENED") TicketStatus ticketStatus,
|
| 24787 |
govind |
433 |
@RequestParam(name = "ticketSearchType", defaultValue = "") TicketSearchType ticketSearchType,
|
|
|
434 |
@RequestParam(name = "searchTerm", defaultValue = "0") int searchTerm,
|
| 24699 |
govind |
435 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
| 24417 |
govind |
436 |
@RequestParam(name = "limit", defaultValue = "10") int limit, Model model)
|
|
|
437 |
throws ProfitMandiBusinessException {
|
|
|
438 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
|
|
439 |
List<Ticket> tickets = null;
|
| 24500 |
govind |
440 |
List<TicketAssigned> ticketAssigneds = null;
|
| 24417 |
govind |
441 |
long size = 0;
|
| 24500 |
govind |
442 |
Map<Integer, AuthUser> authUserIdAndAuthUserMap = null;
|
| 24417 |
govind |
443 |
if (roleManager.isAdmin(new HashSet<>(loginDetails.getRoleIds()))) {
|
|
|
444 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
| 24787 |
govind |
445 |
if (ticketSearchType == null) {
|
| 24791 |
govind |
446 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
|
|
447 |
tickets = ticketRepository.selectAllByAssignee(authUser.getId(), Optional.empty(), sortOrder, null,
|
|
|
448 |
searchTerm, offset, limit);
|
|
|
449 |
size = ticketRepository.selectAllCountByAssignee(authUser.getId(), Optional.empty(), null,
|
|
|
450 |
searchTerm);
|
|
|
451 |
} else {
|
| 24787 |
govind |
452 |
tickets = ticketRepository.selectAllByAssignee(authUser.getId(),
|
| 27124 |
amit.gupta |
453 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), sortOrder, null, searchTerm, offset,
|
| 24787 |
govind |
454 |
limit);
|
|
|
455 |
size = ticketRepository.selectAllCountByAssignee(authUser.getId(),
|
| 27124 |
amit.gupta |
456 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), null, searchTerm);
|
| 24791 |
govind |
457 |
}
|
|
|
458 |
|
| 24787 |
govind |
459 |
} else {
|
| 24791 |
govind |
460 |
|
|
|
461 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
|
|
462 |
tickets = ticketRepository.selectAllByAssignee(authUser.getId(), Optional.empty(), sortOrder,
|
|
|
463 |
ticketSearchType, searchTerm, offset, limit);
|
|
|
464 |
size = ticketRepository.selectAllCountByAssignee(authUser.getId(), Optional.empty(),
|
|
|
465 |
ticketSearchType, searchTerm);
|
|
|
466 |
} else {
|
| 24787 |
govind |
467 |
tickets = ticketRepository.selectAllByAssignee(authUser.getId(),
|
| 27124 |
amit.gupta |
468 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), sortOrder, ticketSearchType,
|
| 24787 |
govind |
469 |
searchTerm, offset, limit);
|
|
|
470 |
size = ticketRepository.selectAllCountByAssignee(authUser.getId(),
|
| 27124 |
amit.gupta |
471 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), ticketSearchType, searchTerm);
|
| 24791 |
govind |
472 |
}
|
| 24787 |
govind |
473 |
}
|
| 24824 |
govind |
474 |
// LOGGER.info(size + "size");
|
| 24791 |
govind |
475 |
if (tickets.size() > 0) {
|
|
|
476 |
ticketAssigneds = ticketAssignedRepository
|
|
|
477 |
.selectByTicketIds(tickets.stream().map(x -> x.getId()).collect(Collectors.toList()));
|
|
|
478 |
authUserIdAndAuthUserMap = csService.getAuthUserIdAndAuthUserMap(ticketAssigneds);
|
|
|
479 |
Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = csService.getPartnerByFofoIds(tickets);
|
|
|
480 |
model.addAttribute("fofoIdsAndCustomRetailer", fofoIdsAndCustomRetailer);
|
| 24787 |
govind |
481 |
}
|
| 24620 |
govind |
482 |
|
| 24417 |
govind |
483 |
} else {
|
| 24699 |
govind |
484 |
tickets = ticketRepository.selectAllByCreator(loginDetails.getFofoId(),
|
| 24751 |
govind |
485 |
Optional.of(TicketStatus.OPENED.equals(ticketStatus)), sortOrder, offset, limit);
|
| 24699 |
govind |
486 |
size = ticketRepository.selectAllCountByCreator(loginDetails.getFofoId(),
|
| 24751 |
govind |
487 |
Optional.of(TicketStatus.OPENED.equals(ticketStatus)));
|
| 24699 |
govind |
488 |
}
|
|
|
489 |
authUserIdAndAuthUserMap = csService.getTicketIdAndAuthUserMapUsingTickets(tickets);
|
| 24500 |
govind |
490 |
|
| 24417 |
govind |
491 |
if (size < limit) {
|
|
|
492 |
model.addAttribute("end", offset + size);
|
|
|
493 |
} else {
|
|
|
494 |
model.addAttribute("end", offset + limit);
|
|
|
495 |
}
|
|
|
496 |
model.addAttribute("start", offset + 1);
|
|
|
497 |
model.addAttribute("size", size);
|
| 24500 |
govind |
498 |
model.addAttribute("roleType", roleManager.isAdmin(new HashSet<>(loginDetails.getRoleIds())));
|
| 24417 |
govind |
499 |
Map<Integer, TicketSubCategory> subCategoryIdAndSubCategoryMap = csService
|
|
|
500 |
.getSubCategoryIdAndSubCategoryMap(tickets);
|
|
|
501 |
model.addAttribute("tickets", tickets);
|
| 24620 |
govind |
502 |
model.addAttribute("resolved", ActivityType.RESOLVED);
|
|
|
503 |
model.addAttribute("resolved-accepted", ActivityType.RESOLVED_ACCEPTED);
|
|
|
504 |
model.addAttribute("resolved-rejected", ActivityType.RESOLVED_REJECTED);
|
| 24417 |
govind |
505 |
model.addAttribute("authUserIdAndAuthUserMap", authUserIdAndAuthUserMap);
|
|
|
506 |
model.addAttribute("subCategoryIdAndSubCategoryMap", subCategoryIdAndSubCategoryMap);
|
| 24699 |
govind |
507 |
model.addAttribute("ticketStatusValues", TicketStatus.values());
|
|
|
508 |
model.addAttribute("orderByValues", SortOrder.values());
|
|
|
509 |
model.addAttribute("selectedticketStatus", ticketStatus);
|
|
|
510 |
model.addAttribute("selectedorderby", sortOrder);
|
| 24787 |
govind |
511 |
model.addAttribute("ticketSearchTypes", TicketSearchType.values());
|
|
|
512 |
model.addAttribute("ticketSearchType", ticketSearchType);
|
|
|
513 |
model.addAttribute("searchTerm", searchTerm);
|
| 24417 |
govind |
514 |
return "ticket";
|
|
|
515 |
}
|
| 24500 |
govind |
516 |
|
| 24417 |
govind |
517 |
@GetMapping(value = "/cs/myticketPaginated")
|
| 24500 |
govind |
518 |
public String getMyTicketPaginated(HttpServletRequest request,
|
| 24699 |
govind |
519 |
@RequestParam(name = "orderby", defaultValue = "DESCENDING") SortOrder sortOrder,
|
|
|
520 |
@RequestParam(name = "ticketStatus", defaultValue = "OPENED") TicketStatus ticketStatus,
|
| 24787 |
govind |
521 |
@RequestParam(name = "ticketSearchType", defaultValue = "") TicketSearchType ticketSearchType,
|
|
|
522 |
@RequestParam(name = "searchTerm", defaultValue = "0") int searchTerm,
|
| 24500 |
govind |
523 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
| 24417 |
govind |
524 |
@RequestParam(name = "limit", defaultValue = "10") int limit, Model model)
|
|
|
525 |
throws ProfitMandiBusinessException {
|
|
|
526 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
|
|
527 |
List<Ticket> tickets = null;
|
| 24500 |
govind |
528 |
List<TicketAssigned> ticketAssigneds = null;
|
| 24824 |
govind |
529 |
|
| 24500 |
govind |
530 |
Map<Integer, AuthUser> authUserIdAndAuthUserMap = null;
|
| 24824 |
govind |
531 |
|
| 24417 |
govind |
532 |
if (roleManager.isAdmin(new HashSet<>(loginDetails.getRoleIds()))) {
|
|
|
533 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
| 24791 |
govind |
534 |
if (ticketSearchType == null) {
|
|
|
535 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
|
|
536 |
tickets = ticketRepository.selectAllByAssignee(authUser.getId(), Optional.empty(), sortOrder, null,
|
|
|
537 |
searchTerm, offset, limit);
|
|
|
538 |
} else {
|
|
|
539 |
tickets = ticketRepository.selectAllByAssignee(authUser.getId(),
|
| 27195 |
amit.gupta |
540 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), sortOrder, null, searchTerm, offset,
|
| 24791 |
govind |
541 |
limit);
|
|
|
542 |
}
|
| 24787 |
govind |
543 |
|
|
|
544 |
} else {
|
| 24791 |
govind |
545 |
|
|
|
546 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
|
|
547 |
tickets = ticketRepository.selectAllByAssignee(authUser.getId(), Optional.empty(), sortOrder,
|
|
|
548 |
ticketSearchType, searchTerm, offset, limit);
|
|
|
549 |
} else {
|
|
|
550 |
tickets = ticketRepository.selectAllByAssignee(authUser.getId(),
|
| 27195 |
amit.gupta |
551 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), sortOrder, ticketSearchType,
|
| 24791 |
govind |
552 |
searchTerm, offset, limit);
|
|
|
553 |
}
|
| 24787 |
govind |
554 |
}
|
| 24747 |
govind |
555 |
ticketAssigneds = ticketAssignedRepository
|
|
|
556 |
.selectByTicketIds(tickets.stream().map(x -> x.getId()).collect(Collectors.toList()));
|
| 24620 |
govind |
557 |
authUserIdAndAuthUserMap = csService.getAuthUserIdAndAuthUserMap(ticketAssigneds);
|
|
|
558 |
Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = csService.getPartnerByFofoIds(tickets);
|
|
|
559 |
model.addAttribute("fofoIdsAndCustomRetailer", fofoIdsAndCustomRetailer);
|
| 24417 |
govind |
560 |
} else {
|
| 24747 |
govind |
561 |
tickets = ticketRepository.selectAllByCreator(loginDetails.getFofoId(),
|
| 24751 |
govind |
562 |
Optional.of(TicketStatus.OPENED.equals(ticketStatus)), sortOrder, offset, limit);
|
| 24500 |
govind |
563 |
authUserIdAndAuthUserMap = csService.getTicketIdAndAuthUserMapUsingTickets(tickets);
|
| 24417 |
govind |
564 |
}
|
| 24500 |
govind |
565 |
model.addAttribute("roleType", roleManager.isAdmin(new HashSet<>(loginDetails.getRoleIds())));
|
| 24417 |
govind |
566 |
Map<Integer, TicketSubCategory> subCategoryIdAndSubCategoryMap = csService
|
|
|
567 |
.getSubCategoryIdAndSubCategoryMap(tickets);
|
|
|
568 |
model.addAttribute("tickets", tickets);
|
|
|
569 |
model.addAttribute("authUserIdAndAuthUserMap", authUserIdAndAuthUserMap);
|
|
|
570 |
model.addAttribute("subCategoryIdAndSubCategoryMap", subCategoryIdAndSubCategoryMap);
|
| 24699 |
govind |
571 |
model.addAttribute("resolved", ActivityType.RESOLVED);
|
|
|
572 |
model.addAttribute("resolved-accepted", ActivityType.RESOLVED_ACCEPTED);
|
|
|
573 |
model.addAttribute("resolved-rejected", ActivityType.RESOLVED_REJECTED);
|
| 24417 |
govind |
574 |
return "ticket-paginated";
|
|
|
575 |
}
|
|
|
576 |
|
|
|
577 |
@GetMapping(value = "/cs/getActivities")
|
|
|
578 |
public String getActivity(HttpServletRequest request,
|
|
|
579 |
@RequestParam(name = "ticketId", defaultValue = "0") int ticketId, Model model) throws Exception {
|
| 24824 |
govind |
580 |
List<Activity> allactivities = activityRepository.selectAll(ticketId);
|
| 27270 |
tejbeer |
581 |
List<List<ActivityAttachment>> activityAttachments = allactivities.stream().map(x -> x.getActivityAttachment())
|
|
|
582 |
.collect(Collectors.toList());
|
|
|
583 |
for (List<ActivityAttachment> aA : activityAttachments) {
|
|
|
584 |
// List<ActivityAttachment> documentId = aA.stream().map(x ->
|
|
|
585 |
// x).collect(Collectors.toList());
|
|
|
586 |
for (ActivityAttachment attachment : aA) {
|
|
|
587 |
Document document = documentRepository.selectById(attachment.getDocumentId());
|
|
|
588 |
attachment.setDocumentName(document.getDisplayName());
|
|
|
589 |
activityAttachmentRepository.persist(attachment);
|
|
|
590 |
}
|
|
|
591 |
}
|
| 24824 |
govind |
592 |
List<Activity> activities = null;
|
| 24572 |
amit.gupta |
593 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 24620 |
govind |
594 |
if (roleManager.isAdmin(loginDetails.getRoleIds())) {
|
| 24824 |
govind |
595 |
Set<Integer> authUserIds = allactivities.stream().map(x -> x.getCreatedBy()).collect(Collectors.toSet());
|
| 24572 |
amit.gupta |
596 |
List<AuthUser> users = authRepository.selectAllAuthUserByIds(new ArrayList<>(authUserIds));
|
| 24620 |
govind |
597 |
Map<Integer, String> authUserNameMap = users.stream()
|
|
|
598 |
.collect(Collectors.toMap(AuthUser::getId, x -> x.getFirstName() + " " + x.getLastName()));
|
| 24824 |
govind |
599 |
allactivities.stream().forEach(x -> x.setName(authUserNameMap.get(x.getCreatedBy())));
|
|
|
600 |
activities = allactivities;
|
|
|
601 |
} else {
|
| 27139 |
amit.gupta |
602 |
activities = allactivities.stream().filter(x -> ActivityType.PARTNER_ACTIVITIES.contains(x.getType()))
|
| 24824 |
govind |
603 |
.collect(Collectors.toList());
|
| 24572 |
amit.gupta |
604 |
}
|
| 24417 |
govind |
605 |
if (activities == null) {
|
|
|
606 |
throw new ProfitMandiBusinessException("Activity", ticketId, "No Activity Found");
|
|
|
607 |
}
|
|
|
608 |
model.addAttribute("response", mvcResponseSender.createResponseString(activities));
|
|
|
609 |
return "response";
|
|
|
610 |
|
|
|
611 |
}
|
|
|
612 |
|
|
|
613 |
@PostMapping(value = "/cs/createActivity")
|
|
|
614 |
public String createActivity(HttpServletRequest request,
|
|
|
615 |
@RequestParam(name = "ticketId", defaultValue = "0") int ticketId,
|
| 24500 |
govind |
616 |
@RequestParam(name = "assigneeId", defaultValue = "0") int assigneeId,
|
| 24824 |
govind |
617 |
@RequestParam(name = "internal", defaultValue = "true") boolean internal,
|
| 27270 |
tejbeer |
618 |
@RequestParam(name = "message", defaultValue = "") String message, @RequestBody List<Integer> documentIds,
|
|
|
619 |
|
|
|
620 |
Model model) throws Exception {
|
|
|
621 |
|
|
|
622 |
LOGGER.info("documentIds" + documentIds);
|
| 24417 |
govind |
623 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 24500 |
govind |
624 |
Ticket ticket = ticketRepository.selectById(ticketId);
|
| 27150 |
amit.gupta |
625 |
List<TicketAssigned> ticketAssignedList = ticketAssignedRepository.selectByTicketIds(Arrays.asList(ticketId));
|
| 27270 |
tejbeer |
626 |
List<Integer> authUserIds = ticketAssignedList.stream().map(x -> x.getAssineeId()).collect(Collectors.toList());
|
|
|
627 |
authUserIds.add(ticketAssignedList.get(ticketAssignedList.size() - 1).getManagerId());
|
|
|
628 |
Map<Integer, AuthUser> authUsersMap = authRepository.selectAllAuthUserByIds(authUserIds).stream()
|
|
|
629 |
.collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| 24500 |
govind |
630 |
if (ticket.getCloseTimestamp() == null) {
|
| 27124 |
amit.gupta |
631 |
Activity activity = new Activity();
|
|
|
632 |
activity.setCreatedBy(0);
|
|
|
633 |
activity.setCreateTimestamp(LocalDateTime.now());
|
| 27150 |
amit.gupta |
634 |
String subject = null;
|
| 27270 |
tejbeer |
635 |
String mailMessage = null;
|
| 27159 |
amit.gupta |
636 |
activity.setMessage(message);
|
| 24500 |
govind |
637 |
if (!roleManager.isAdmin(new HashSet<>(loginDetails.getRoleIds()))) {
|
| 27150 |
amit.gupta |
638 |
CustomRetailer customRetailer = retailerService.getFofoRetailers(true).get(loginDetails.getFofoId());
|
| 24500 |
govind |
639 |
activity.setType(ActivityType.COMMUNICATION_IN);
|
| 27270 |
tejbeer |
640 |
subject = String.format("Ticket Update #%s by franchisee %s", ticket.getId(),
|
|
|
641 |
customRetailer.getBusinessName() + "(" + customRetailer.getCode() + ")");
|
| 27197 |
amit.gupta |
642 |
mailMessage = String.format("Franchisee message - %s", message);
|
| 24500 |
govind |
643 |
} else {
|
| 27156 |
amit.gupta |
644 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
| 27164 |
amit.gupta |
645 |
activity.setCreatedBy(authUser.getId());
|
| 27162 |
amit.gupta |
646 |
authUsersMap.remove(authUser.getId());
|
| 27150 |
amit.gupta |
647 |
subject = String.format("Ticket Update #%s by %s", ticket.getId(), authUser.getName());
|
| 27197 |
amit.gupta |
648 |
mailMessage = String.format("%s's message - %s", authUser.getFirstName(), message);
|
| 24824 |
govind |
649 |
if (internal) {
|
|
|
650 |
activity.setType(ActivityType.COMMUNICATION_INTERNAL);
|
| 27124 |
amit.gupta |
651 |
// String subject = String.format(ACTIVITY_SUBJECT, ticket.getId());
|
| 24824 |
govind |
652 |
} else {
|
| 27186 |
amit.gupta |
653 |
String updatedBy = "SD Team";
|
| 27192 |
amit.gupta |
654 |
CustomRetailer customRetailer = retailerService.getFofoRetailers(true).get(ticket.getFofoId());
|
| 27186 |
amit.gupta |
655 |
subject = String.format("Ticket Update #%s by %s", ticket.getId(), updatedBy);
|
| 27197 |
amit.gupta |
656 |
String partnerMessage = String.format("%s's message - %s", updatedBy, message);
|
|
|
657 |
this.activityRelatedMail(customRetailer.getEmail(), null, "subject", partnerMessage);
|
| 24824 |
govind |
658 |
activity.setType(ActivityType.COMMUNICATION_OUT);
|
|
|
659 |
}
|
| 24500 |
govind |
660 |
}
|
| 27124 |
amit.gupta |
661 |
activityRepository.persist(activity);
|
| 27270 |
tejbeer |
662 |
|
|
|
663 |
for (Integer documentId : documentIds) {
|
|
|
664 |
ActivityAttachment activityAttachment = new ActivityAttachment();
|
|
|
665 |
activityAttachment.setActivityId(activity.getId());
|
|
|
666 |
activityAttachment.setDocumentId(documentId);
|
|
|
667 |
activityAttachmentRepository.persist(activityAttachment);
|
|
|
668 |
}
|
|
|
669 |
|
| 27124 |
amit.gupta |
670 |
csService.addActivity(ticket, activity);
|
| 27150 |
amit.gupta |
671 |
AuthUser authUser = authUsersMap.remove(authUserIds.get(0));
|
| 27270 |
tejbeer |
672 |
if (authUser == null) {
|
| 27163 |
amit.gupta |
673 |
authUser = authUsersMap.remove(authUserIds.get(1));
|
|
|
674 |
}
|
| 27150 |
amit.gupta |
675 |
model.addAttribute("response", mvcResponseSender.createResponseString(authUser));
|
| 27285 |
tejbeer |
676 |
String[] cc = authUsersMap.entrySet().stream().map(x -> x.getValue().getEmailId()).toArray(String[]::new);
|
| 27197 |
amit.gupta |
677 |
this.activityRelatedMail(authUser.getEmailId(), cc, subject, mailMessage);
|
| 24417 |
govind |
678 |
} else {
|
|
|
679 |
throw new ProfitMandiBusinessException("Ticket", ticket.getId(), "Already closed ticket");
|
|
|
680 |
}
|
|
|
681 |
return "response";
|
|
|
682 |
}
|
| 24500 |
govind |
683 |
|
| 24620 |
govind |
684 |
private void activityRelatedMail(String to, String[] cc, String subject, String message)
|
|
|
685 |
throws ProfitMandiBusinessException {
|
|
|
686 |
try {
|
|
|
687 |
Utils.sendMailWithAttachments(mailSender, to, cc, subject, message, null);
|
|
|
688 |
} catch (Exception e) {
|
|
|
689 |
throw new ProfitMandiBusinessException("Ticket Activity", to, "Could not send ticket activity mail");
|
|
|
690 |
}
|
|
|
691 |
}
|
|
|
692 |
|
| 24500 |
govind |
693 |
@PostMapping(value = "/cs/closeTicket")
|
| 24417 |
govind |
694 |
public String closeTicket(HttpServletRequest request,
|
| 24439 |
govind |
695 |
@RequestParam(name = "ticketId", defaultValue = "0") int ticketId,
|
| 24500 |
govind |
696 |
@RequestParam(name = "happyCode") String happyCode, Model model) throws Exception {
|
|
|
697 |
Ticket ticket = ticketRepository.selectById(ticketId);
|
|
|
698 |
if (ticket.getHappyCode().equals(happyCode)) {
|
|
|
699 |
ticket.setCloseTimestamp(LocalDateTime.now());
|
|
|
700 |
ticketRepository.persist(ticket);
|
|
|
701 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
|
|
702 |
} else {
|
|
|
703 |
throw new ProfitMandiBusinessException("Ticket", ticketId, "Happy Code can't match");
|
| 24439 |
govind |
704 |
}
|
| 24417 |
govind |
705 |
return "response";
|
|
|
706 |
}
|
| 24500 |
govind |
707 |
|
|
|
708 |
@GetMapping(value = "/cs/managerTicket")
|
| 27124 |
amit.gupta |
709 |
public String getManagerTickets(HttpServletRequest request,
|
| 24699 |
govind |
710 |
@RequestParam(name = "orderby", defaultValue = "DESCENDING") SortOrder sortOrder,
|
|
|
711 |
@RequestParam(name = "ticketStatus", defaultValue = "OPENED") TicketStatus ticketStatus,
|
| 24747 |
govind |
712 |
@RequestParam(name = "ticketSearchType", defaultValue = "") TicketSearchType ticketSearchType,
|
|
|
713 |
@RequestParam(name = "searchTerm", defaultValue = "0") int searchTerm,
|
| 24500 |
govind |
714 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
|
|
715 |
@RequestParam(name = "limit", defaultValue = "10") int limit, Model model)
|
|
|
716 |
throws ProfitMandiBusinessException {
|
| 24439 |
govind |
717 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
|
|
718 |
long size = 0;
|
| 24500 |
govind |
719 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
|
|
720 |
List<Ticket> tickets = null;
|
| 24569 |
govind |
721 |
Map<Integer, List<AuthUser>> authUserListMap = null;
|
| 27318 |
amit.gupta |
722 |
if (ticketSearchType == null) {
|
|
|
723 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
|
|
724 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder, Optional.empty(), null,
|
|
|
725 |
searchTerm, offset, limit);
|
|
|
726 |
size = ticketRepository.selectAllCountByManagerTicket(authUser.getId(), Optional.empty(), null, 0);
|
|
|
727 |
} else {
|
|
|
728 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder,
|
|
|
729 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), null, searchTerm, offset, limit);
|
|
|
730 |
size = ticketRepository.selectAllCountByManagerTicket(authUser.getId(),
|
|
|
731 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), null, 0);
|
|
|
732 |
}
|
| 24500 |
govind |
733 |
} else {
|
| 27318 |
amit.gupta |
734 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
|
|
735 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder, Optional.empty(),
|
|
|
736 |
ticketSearchType, searchTerm, offset, limit);
|
|
|
737 |
size = ticketRepository.selectAllCountByManagerTicket(authUser.getId(), Optional.empty(),
|
|
|
738 |
ticketSearchType, searchTerm);
|
| 24747 |
govind |
739 |
} else {
|
| 27318 |
amit.gupta |
740 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder,
|
|
|
741 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), ticketSearchType, searchTerm, offset,
|
|
|
742 |
limit);
|
|
|
743 |
size = ticketRepository.selectAllCountByManagerTicket(authUser.getId(),
|
|
|
744 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), ticketSearchType, searchTerm);
|
| 24747 |
govind |
745 |
}
|
|
|
746 |
|
| 24439 |
govind |
747 |
}
|
| 27318 |
amit.gupta |
748 |
authUserListMap = csService.getAssignedAuthList(tickets);
|
|
|
749 |
|
|
|
750 |
if (tickets.size() > 0) {
|
|
|
751 |
Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = csService.getPartnerByFofoIds(tickets);
|
|
|
752 |
model.addAttribute("fofoIdsAndCustomRetailer", fofoIdsAndCustomRetailer);
|
|
|
753 |
}
|
| 24439 |
govind |
754 |
if (size < limit) {
|
|
|
755 |
model.addAttribute("end", offset + size);
|
|
|
756 |
} else {
|
|
|
757 |
model.addAttribute("end", offset + limit);
|
|
|
758 |
}
|
|
|
759 |
model.addAttribute("start", offset + 1);
|
|
|
760 |
model.addAttribute("size", size);
|
|
|
761 |
model.addAttribute("tickets", tickets);
|
| 24500 |
govind |
762 |
|
| 24439 |
govind |
763 |
Map<Integer, TicketSubCategory> subCategoryIdAndSubCategoryMap = csService
|
|
|
764 |
.getSubCategoryIdAndSubCategoryMap(tickets);
|
| 24699 |
govind |
765 |
model.addAttribute("ticketStatusValues", TicketStatus.values());
|
|
|
766 |
model.addAttribute("orderByValues", SortOrder.values());
|
|
|
767 |
model.addAttribute("selectedticketStatus", ticketStatus);
|
|
|
768 |
model.addAttribute("selectedorderby", sortOrder);
|
| 24439 |
govind |
769 |
model.addAttribute("tickets", tickets);
|
| 24747 |
govind |
770 |
model.addAttribute("ticketSearchTypes", TicketSearchType.values());
|
| 24750 |
govind |
771 |
model.addAttribute("ticketSearchType", ticketSearchType);
|
| 24747 |
govind |
772 |
model.addAttribute("searchTerm", searchTerm);
|
| 24500 |
govind |
773 |
model.addAttribute("authUserListMap", authUserListMap);
|
| 24439 |
govind |
774 |
model.addAttribute("subCategoryIdAndSubCategoryMap", subCategoryIdAndSubCategoryMap);
|
|
|
775 |
return "managerTicket";
|
|
|
776 |
}
|
| 24500 |
govind |
777 |
|
|
|
778 |
@GetMapping(value = "/cs/managerTicket-paginated")
|
| 27205 |
amit.gupta |
779 |
public String getManagerTicketsPaginated(HttpServletRequest request,
|
| 24699 |
govind |
780 |
@RequestParam(name = "orderby", defaultValue = "DESCENDING") SortOrder sortOrder,
|
|
|
781 |
@RequestParam(name = "ticketStatus", defaultValue = "OPENED") TicketStatus ticketStatus,
|
| 24747 |
govind |
782 |
@RequestParam(name = "ticketSearchType", defaultValue = "") TicketSearchType ticketSearchType,
|
|
|
783 |
@RequestParam(name = "searchTerm", defaultValue = "0") int searchTerm,
|
| 24500 |
govind |
784 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
|
|
785 |
@RequestParam(name = "limit", defaultValue = "10") int limit, Model model)
|
|
|
786 |
throws ProfitMandiBusinessException {
|
| 24467 |
govind |
787 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 24500 |
govind |
788 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
| 24557 |
govind |
789 |
Map<Integer, List<AuthUser>> authUserListMap = null;
|
| 24500 |
govind |
790 |
List<Ticket> tickets = null;
|
| 27318 |
amit.gupta |
791 |
if (ticketSearchType == null) {
|
|
|
792 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
|
|
793 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder, Optional.empty(), null,
|
|
|
794 |
searchTerm, offset, limit);
|
| 24787 |
govind |
795 |
|
| 24747 |
govind |
796 |
} else {
|
| 27318 |
amit.gupta |
797 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder,
|
|
|
798 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), null, searchTerm, offset, limit);
|
| 24787 |
govind |
799 |
|
| 27318 |
amit.gupta |
800 |
}
|
|
|
801 |
} else {
|
|
|
802 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
|
|
803 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder, Optional.empty(),
|
|
|
804 |
ticketSearchType, searchTerm, offset, limit);
|
| 24787 |
govind |
805 |
|
| 27318 |
amit.gupta |
806 |
} else {
|
|
|
807 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder,
|
|
|
808 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), ticketSearchType, searchTerm, offset,
|
|
|
809 |
limit);
|
| 24747 |
govind |
810 |
}
|
| 27318 |
amit.gupta |
811 |
|
| 24467 |
govind |
812 |
}
|
| 27318 |
amit.gupta |
813 |
authUserListMap = csService.getAssignedAuthList(tickets);
|
|
|
814 |
if (tickets.size() > 0) {
|
|
|
815 |
Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = csService.getPartnerByFofoIds(tickets);
|
|
|
816 |
model.addAttribute("fofoIdsAndCustomRetailer", fofoIdsAndCustomRetailer);
|
|
|
817 |
}
|
| 24467 |
govind |
818 |
model.addAttribute("tickets", tickets);
|
|
|
819 |
Map<Integer, TicketSubCategory> subCategoryIdAndSubCategoryMap = csService
|
|
|
820 |
.getSubCategoryIdAndSubCategoryMap(tickets);
|
|
|
821 |
model.addAttribute("tickets", tickets);
|
| 24500 |
govind |
822 |
model.addAttribute("authUserListMap", authUserListMap);
|
| 24467 |
govind |
823 |
model.addAttribute("subCategoryIdAndSubCategoryMap", subCategoryIdAndSubCategoryMap);
|
|
|
824 |
return "managerTicket-paginated";
|
|
|
825 |
}
|
| 24500 |
govind |
826 |
|
|
|
827 |
@GetMapping(value = "/cs/edit-ticket")
|
|
|
828 |
public String getEditTicket(HttpServletRequest request,
|
|
|
829 |
@RequestParam(name = "ticketId", defaultValue = "0") int ticketId, Model model) {
|
|
|
830 |
Ticket ticket = ticketRepository.selectById(ticketId);
|
|
|
831 |
List<TicketCategory> ticketCategories = csService.getAllTicketCategotyFromSubCategory();
|
|
|
832 |
TicketSubCategory ticketSubCategory = ticketSubCategoryRepository.selectById(ticket.getSubCategoryId());
|
|
|
833 |
List<TicketSubCategory> ticketSubCategories = ticketSubCategoryRepository
|
| 27124 |
amit.gupta |
834 |
.selectAll(ticketSubCategory.getCategoryId());
|
|
|
835 |
List<AuthUser> authUsers = new ArrayList<>();
|
| 24467 |
govind |
836 |
model.addAttribute("ticket", ticket);
|
|
|
837 |
model.addAttribute("ticketCategories", ticketCategories);
|
|
|
838 |
model.addAttribute("ticketSubCategories", ticketSubCategories);
|
| 24575 |
govind |
839 |
model.addAttribute("ticketSubCategory", ticketSubCategory);
|
| 24500 |
govind |
840 |
model.addAttribute("authUsers", authUsers);
|
| 24467 |
govind |
841 |
return "edit-ticket-modal";
|
|
|
842 |
}
|
| 24500 |
govind |
843 |
|
|
|
844 |
@PostMapping(value = "/cs/edit-ticket")
|
|
|
845 |
public String editTicket(HttpServletRequest request,
|
|
|
846 |
@RequestParam(name = "ticketId", defaultValue = "0") int ticketId,
|
|
|
847 |
@RequestParam(name = "subCategoryId", defaultValue = "0") int subCategoryId,
|
|
|
848 |
@RequestParam(name = "categoryId", defaultValue = "0") int categoryId,
|
|
|
849 |
@RequestParam(name = "authUserId", defaultValue = "0") int authUserId, Model model) throws Exception {
|
| 27152 |
amit.gupta |
850 |
LOGGER.info("Ticket Id {}, CategoryId {}, SubCategory Id {}", ticketId, categoryId, subCategoryId);
|
| 24500 |
govind |
851 |
Ticket ticket = ticketRepository.selectById(ticketId);
|
| 27124 |
amit.gupta |
852 |
csService.updateTicket(categoryId, subCategoryId, ticket);
|
|
|
853 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
| 24467 |
govind |
854 |
return "response";
|
| 27124 |
amit.gupta |
855 |
|
| 24467 |
govind |
856 |
}
|
| 24500 |
govind |
857 |
|
|
|
858 |
@DeleteMapping(value = "/cs/removePosition")
|
|
|
859 |
public String removePosition(HttpServletRequest request,
|
|
|
860 |
@RequestParam(name = "positionId", defaultValue = "0") int positionId, Model model) throws Exception {
|
| 24471 |
govind |
861 |
positionRepository.delete(positionId);
|
|
|
862 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
|
|
863 |
return "response";
|
|
|
864 |
}
|
| 24620 |
govind |
865 |
|
|
|
866 |
@PostMapping(value = "/cs/create-last-activity")
|
|
|
867 |
public String createlastActivity(HttpServletRequest request, @RequestParam(name = "ticketId") int ticketId,
|
|
|
868 |
@RequestParam(name = "lastactivity") ActivityType lastActivity, Model model) throws Exception {
|
|
|
869 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
|
|
870 |
Ticket ticket = ticketRepository.selectById(ticketId);
|
|
|
871 |
Activity activity = new Activity();
|
|
|
872 |
String subject = String.format(ACTIVITY_SUBJECT, ticket.getId());
|
|
|
873 |
if (roleManager.isAdmin(loginDetails.getRoleIds())) {
|
|
|
874 |
ticket.setLastActivity(lastActivity);
|
|
|
875 |
String to = retailerService.getFofoRetailer(ticket.getFofoId()).getEmail();
|
| 24699 |
govind |
876 |
String message = String.format(PARTNER_RESOLVED_TICKET_MAIL, ticketId, "REOPEN");
|
| 24620 |
govind |
877 |
activity.setMessage(message);
|
|
|
878 |
activity.setCreatedBy(authRepository.selectByEmailOrMobile(loginDetails.getEmailId()).getId());
|
|
|
879 |
activity.setTicketId(ticketId);
|
|
|
880 |
activity.setCreateTimestamp(LocalDateTime.now());
|
|
|
881 |
activity.setType(ActivityType.COMMUNICATION_OUT);
|
| 24621 |
govind |
882 |
this.activityRelatedMail(to, null, subject, message);
|
| 24620 |
govind |
883 |
} else {
|
|
|
884 |
if (ActivityType.RESOLVED_ACCEPTED == lastActivity) {
|
|
|
885 |
ticket.setLastActivity(lastActivity);
|
|
|
886 |
ticket.setCloseTimestamp(LocalDateTime.now());
|
| 27139 |
amit.gupta |
887 |
activity.setMessage(ActivityType.RESOLVED_ACCEPTED.toString());
|
| 24620 |
govind |
888 |
activity.setCreatedBy(0);
|
|
|
889 |
activity.setTicketId(ticketId);
|
|
|
890 |
activity.setType(ActivityType.COMMUNICATION_IN);
|
|
|
891 |
activity.setCreateTimestamp(LocalDateTime.now());
|
|
|
892 |
} else {
|
| 24699 |
govind |
893 |
String message = String.format(INTERNAL_REOPEN_MAIL, ticketId,
|
|
|
894 |
retailerService.getFofoRetailer(loginDetails.getFofoId()).getBusinessName());
|
| 24620 |
govind |
895 |
String to = authRepository.selectById(ticket.getL1AuthUser()).getEmailId();
|
| 27270 |
tejbeer |
896 |
String[] ccTo = authRepository
|
|
|
897 |
.selectAllAuthUserByIds(Arrays.asList(ticket.getL2AuthUser(), ticket.getL3AuthUser(),
|
|
|
898 |
ticket.getL4AuthUser(), ticket.getL5AuthUser()))
|
|
|
899 |
.stream().map(x -> x.getEmailId()).toArray(String[]::new);
|
| 24620 |
govind |
900 |
ticket.setLastActivity(lastActivity);
|
| 24638 |
govind |
901 |
ticket.setUpdateTimestamp(LocalDateTime.now());
|
|
|
902 |
ticketAssignedRepository.deleteByTicketId(ticketId);
|
| 24699 |
govind |
903 |
TicketAssigned ticketAssigned = new TicketAssigned();
|
| 24638 |
govind |
904 |
ticketAssigned.setAssineeId(ticket.getL1AuthUser());
|
|
|
905 |
ticketAssigned.setTicketId(ticketId);
|
|
|
906 |
ticketAssignedRepository.persist(ticketAssigned);
|
| 24620 |
govind |
907 |
activity.setMessage(INTERNAL_REOPEN_ACTIVITY_MESSAGE);
|
|
|
908 |
activity.setCreatedBy(0);
|
|
|
909 |
activity.setTicketId(ticketId);
|
|
|
910 |
activity.setType(ActivityType.COMMUNICATION_IN);
|
|
|
911 |
activity.setCreateTimestamp(LocalDateTime.now());
|
| 27139 |
amit.gupta |
912 |
this.activityRelatedMail(to, ccTo, subject, message);
|
| 24699 |
govind |
913 |
this.activityRelatedMail(retailerService.getFofoRetailer(loginDetails.getFofoId()).getEmail(), null,
|
|
|
914 |
subject, String.format(PARTNER_REOPEN, ticketId));
|
| 24620 |
govind |
915 |
}
|
|
|
916 |
|
|
|
917 |
}
|
|
|
918 |
activityRepository.persist(activity);
|
|
|
919 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
|
|
920 |
return "response";
|
|
|
921 |
}
|
|
|
922 |
|
| 24417 |
govind |
923 |
}
|