Subversion Repositories SmartDukaan

Rev

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

Rev 32865 Rev 33081
Line 6... Line 6...
6
import com.spice.profitmandi.common.util.Utils;
6
import com.spice.profitmandi.common.util.Utils;
7
import com.spice.profitmandi.dao.entity.auth.AuthUser;
7
import com.spice.profitmandi.dao.entity.auth.AuthUser;
8
import com.spice.profitmandi.dao.entity.cs.*;
8
import com.spice.profitmandi.dao.entity.cs.*;
9
import com.spice.profitmandi.dao.entity.dtr.Document;
9
import com.spice.profitmandi.dao.entity.dtr.Document;
10
import com.spice.profitmandi.dao.entity.fofo.ActivityType;
10
import com.spice.profitmandi.dao.entity.fofo.ActivityType;
11
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
-
 
12
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
11
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
13
import com.spice.profitmandi.dao.enumuration.cs.TicketStatus;
12
import com.spice.profitmandi.dao.enumuration.cs.TicketStatus;
14
import com.spice.profitmandi.dao.model.CreatePositionModel;
13
import com.spice.profitmandi.dao.model.CreatePositionModel;
15
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
14
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
16
import com.spice.profitmandi.dao.repository.cs.*;
15
import com.spice.profitmandi.dao.repository.cs.*;
Line 110... Line 109...
110
        model.addAttribute("ticketCategories", ticketCategories);
109
        model.addAttribute("ticketCategories", ticketCategories);
111
        return "create-ticket-category";
110
        return "create-ticket-category";
112
    }
111
    }
113
 
112
 
114
    @PostMapping(value = "/cs/createCategory")
113
    @PostMapping(value = "/cs/createCategory")
-
 
114
    public String createCategory(HttpServletRequest request,
-
 
115
                                 @RequestParam(name = "name") String name,
-
 
116
                                 @RequestParam(name = "categoryType") int categoryType,
115
    public String createCategory(HttpServletRequest request, @RequestParam(name = "name") String name, @RequestParam(name = "description") String description, Model model) throws ProfitMandiBusinessException {
117
                                 @RequestParam(name = "description") String description,
116
 
-
 
-
 
118
                                 Model model) throws ProfitMandiBusinessException {
117
        TicketCategory ticketCategory = ticketCategoryRepository.selectByName(name);
119
        TicketCategory ticketCategory = ticketCategoryRepository.selectByName(name);
118
        if (ticketCategory != null) {
120
        if (ticketCategory != null) {
119
            throw new ProfitMandiBusinessException("name", name, "already exists!");
121
            throw new ProfitMandiBusinessException("name", name, "already exists!");
120
        }
122
        }
-
 
123
 
121
        ticketCategory = new TicketCategory();
124
        ticketCategory = new TicketCategory();
122
        ticketCategory.setName(name);
125
        ticketCategory.setName(name);
123
        ticketCategory.setDescription(description);
126
        ticketCategory.setDescription(description);
-
 
127
 
-
 
128
        ticketCategory.setCategoryType(categoryType == 1);
124
        ticketCategoryRepository.persist(ticketCategory);
129
        ticketCategoryRepository.persist(ticketCategory);
125
        return "create-ticket-category";
130
        return "create-ticket-category";
126
    }
131
    }
127
 
132
 
-
 
133
 
128
    @GetMapping(value = "/cs/createSubCategory")
134
    @GetMapping(value = "/cs/createSubCategory")
129
    public String getCreateSubCategory(HttpServletRequest request, Model model) {
135
    public String getCreateSubCategory(HttpServletRequest request, Model model) {
130
        List<TicketCategory> ticketCategories = ticketCategoryRepository.selectAll();
136
        List<TicketCategory> ticketCategories = ticketCategoryRepository.selectAll();
131
        model.addAttribute("ticketCategories", ticketCategories);
137
        model.addAttribute("ticketCategories", ticketCategories);
132
        return "create-ticket-sub-category";
138
        return "create-ticket-sub-category";
Line 134... Line 140...
134
 
140
 
135
    @GetMapping(value = "/cs/getSubCategoryByCategoryId")
141
    @GetMapping(value = "/cs/getSubCategoryByCategoryId")
136
    public String getSubCategoryByCategoryId(HttpServletRequest request, @RequestParam(name = "ticketCategoryId", defaultValue = "") int ticketCategoryId, Model model) {
142
    public String getSubCategoryByCategoryId(HttpServletRequest request, @RequestParam(name = "ticketCategoryId", defaultValue = "") int ticketCategoryId, Model model) {
137
        List<TicketSubCategory> ticketSubCategories = ticketSubCategoryRepository.selectAll(ticketCategoryId);
143
        List<TicketSubCategory> ticketSubCategories = ticketSubCategoryRepository.selectAll(ticketCategoryId);
138
        TicketCategory ticketCategory = ticketCategoryRepository.selectById(ticketCategoryId);
144
        TicketCategory ticketCategory = ticketCategoryRepository.selectById(ticketCategoryId);
-
 
145
        LOGGER.info("ticketSubCategories {}", ticketSubCategories);
-
 
146
        LOGGER.info("ticketCategory {}", ticketCategory);
139
        model.addAttribute("ticketSubCategories", ticketSubCategories);
147
        model.addAttribute("ticketSubCategories", ticketSubCategories);
140
        model.addAttribute("ticketCategory", ticketCategory);
148
        model.addAttribute("ticketCategory", ticketCategory);
141
        return "ticket-sub-category";
149
        return "ticket-sub-category";
142
    }
150
    }
143
 
151