| Line 1099... |
Line 1099... |
| 1099 |
@ApiImplicitParams({
|
1099 |
@ApiImplicitParams({
|
| 1100 |
|
1100 |
|
| 1101 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
1101 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 1102 |
public ResponseEntity<?> createTicket(HttpServletRequest request) throws ProfitMandiBusinessException {
|
1102 |
public ResponseEntity<?> createTicket(HttpServletRequest request) throws ProfitMandiBusinessException {
|
| 1103 |
List<TicketCategory> ticketCategories = csService.getAllTicketCategotyFromSubCategory();
|
1103 |
List<TicketCategory> ticketCategories = csService.getAllTicketCategotyFromSubCategory();
|
| - |
|
1104 |
|
| 1104 |
return responseSender.ok(ticketCategories);
|
1105 |
return responseSender.ok(ticketCategories);
|
| 1105 |
}
|
1106 |
}
|
| 1106 |
|
1107 |
|
| 1107 |
@RequestMapping(value = "/getSubCategoriesByCategoryId", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
1108 |
@RequestMapping(value = "/getSubCategoriesByCategoryId", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 1108 |
@ApiImplicitParams({
|
1109 |
@ApiImplicitParams({
|
| Line 1120... |
Line 1121... |
| 1120 |
|
1121 |
|
| 1121 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
1122 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 1122 |
public ResponseEntity<?> createTicket(HttpServletRequest request, @RequestParam(name = "categoryId") int categoryId,
|
1123 |
public ResponseEntity<?> createTicket(HttpServletRequest request, @RequestParam(name = "categoryId") int categoryId,
|
| 1123 |
@RequestParam(name = "subCategoryId") int subCategoryId, @RequestParam(name = "message") String message,
|
1124 |
@RequestParam(name = "subCategoryId") int subCategoryId, @RequestParam(name = "message") String message,
|
| 1124 |
@RequestParam(name = "fofoId") int fofoId) throws Exception {
|
1125 |
@RequestParam(name = "fofoId") int fofoId) throws Exception {
|
| - |
|
1126 |
|
| - |
|
1127 |
int id = (int) request.getAttribute("userId");
|
| - |
|
1128 |
|
| - |
|
1129 |
LOGGER.info("id" + id);
|
| - |
|
1130 |
|
| - |
|
1131 |
User user = userRepository.selectById(id);
|
| - |
|
1132 |
|
| - |
|
1133 |
AuthUser authUser = authRepository.selectByEmailOrMobile(user.getEmailId());
|
| - |
|
1134 |
|
| 1125 |
List<Ticket> tickets = ticketRepository.selectAllResolvedMarkedTicketByCreator(fofoId);
|
1135 |
List<Ticket> tickets = ticketRepository.selectAllResolvedMarkedTicketByCreator(fofoId);
|
| 1126 |
if (tickets.size() > 3 || tickets.size() == 3) {
|
1136 |
if (tickets.size() > 3 || tickets.size() == 3) {
|
| 1127 |
return responseSender.ok(false);
|
1137 |
return responseSender.ok(false);
|
| 1128 |
} else {
|
1138 |
} else {
|
| 1129 |
csService.createTicket(fofoId, categoryId, subCategoryId, message);
|
1139 |
csService.createTicket(fofoId, categoryId, subCategoryId, message);
|
| 1130 |
|
1140 |
|
| - |
|
1141 |
PartnerCollectionRemark pcr = new PartnerCollectionRemark();
|
| - |
|
1142 |
pcr.setFofoId(fofoId);
|
| - |
|
1143 |
pcr.setAuthId(authUser.getId());
|
| - |
|
1144 |
pcr.setMessage("Ticket Created");
|
| - |
|
1145 |
pcr.setRemark(CollectionRemark.TICKET_CREATED);
|
| - |
|
1146 |
pcr.setCreateTimestamp(LocalDateTime.now());
|
| - |
|
1147 |
partnerCollectionRemarkRepository.persist(pcr);
|
| - |
|
1148 |
|
| 1131 |
}
|
1149 |
}
|
| 1132 |
return responseSender.ok(true);
|
1150 |
return responseSender.ok(true);
|
| 1133 |
}
|
1151 |
}
|
| 1134 |
|
1152 |
|
| 1135 |
@RequestMapping(value = "/getCollectionRemark", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
1153 |
@RequestMapping(value = "/getCollectionRemark", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|