zero 1 год назад
Родитель
Сommit
7ae500ded0

+ 4 - 2
src/main/java/com/example/xiaoshiweixinback/controller/ProductCategoryController.java

@@ -25,8 +25,10 @@ import java.util.List;
 @RestController
 @RequiredArgsConstructor
 public class ProductCategoryController {
+
     private final ProductCategoryService productCategoryService;
     private final AssoPersonCategoryService assoPersonCategoryService;
+
     @Operation(summary = "查询产品类别")
     @PostMapping("/queryCategory")
     private Response queryProductCategory(@RequestBody ProductCategoryDTO productCategoryDTO) {
@@ -45,8 +47,8 @@ public class ProductCategoryController {
     @PostMapping("/concernCategory")
     private Response concernCategory(@RequestBody ConcernCategoryDTO concernCategoryDTO) {
         assoPersonCategoryService.concernCategory(concernCategoryDTO);
-        Records records =new Records();
-         records.setData("关注成功");
+        Records records = new Records();
+        records.setData("关注成功");
         return Response.success(records);
     }
 }

+ 7 - 6
src/main/java/com/example/xiaoshiweixinback/controller/TicketController.java

@@ -22,31 +22,32 @@ import org.springframework.web.bind.annotation.RestController;
 @RequiredArgsConstructor
 public class TicketController {
     private final TicketService ticketService;
+
     @Operation(summary = "添加工单")
     @PostMapping("/addTicket")
-    public Response addTicket(@RequestBody TicketAddDTO ticketAddDTO){
-        Integer id  =ticketService.addorUpdateTicket(ticketAddDTO);
-        Records records =new Records();
+    public Response addTicket(@RequestBody TicketAddDTO ticketAddDTO) {
+        Integer id = ticketService.addorUpdateTicket(ticketAddDTO);
+        Records records = new Records();
         records.setData(id);
         return Response.success(records);
     }
 
 
-    public Response queryHotProduct(@RequestBody ProductDTO productDTO){
+    public Response queryHotProduct(@RequestBody ProductDTO productDTO) {
 //        Records records =productService.queryHotProduct(productDTO);
         return Response.success("records");
     }
 
     @Operation(summary = "更新工单进度")
     @PostMapping("/updateTicketProcess")
-    public Response updateTicketProcess(@RequestBody ProductDTO productDTO){
+    public Response updateTicketProcess(@RequestBody ProductDTO productDTO) {
 //        Records records =productService.queryHotProduct(productDTO);
         return Response.success("records");
     }
 
     @Operation(summary = "查询工单")
     @PostMapping("/queryTicket")
-    public Response queryTicket(@RequestBody TicketQueryDTO ticketQueryDTO){
+    public Response queryTicket(@RequestBody TicketQueryDTO ticketQueryDTO) {
         Records records = ticketService.queryTickets(ticketQueryDTO);
         return Response.success(records);
     }

+ 3 - 2
src/main/java/com/example/xiaoshiweixinback/controller/VIPController.java

@@ -18,11 +18,12 @@ import org.springframework.web.bind.annotation.RestController;
 @RestController
 @RequiredArgsConstructor
 public class VIPController {
-    private  final VipService vipService;
+    private final VipService vipService;
+
     @Operation(summary = "查询会员")
     @PostMapping("/vip")
     private Response queryProductCategory() {
-        Records records =vipService.getAllVip();
+        Records records = vipService.getAllVip();
         return Response.success(records);
     }
 

+ 1 - 1
src/main/java/com/example/xiaoshiweixinback/service/ProductService.java

@@ -148,7 +148,7 @@ public class ProductService extends ServiceImpl<ProductMapper, Product> {
     @Transactional(rollbackFor = Exception.class)
     public Product updateProduct(ProductAddDTO productAddDTO) {
         Product product = new Product();
-        product=this.getById(productAddDTO.getId());
+        product = this.getById(productAddDTO.getId());
         product.setName(productAddDTO.getName());
         product.setDescription(productAddDTO.getDescription());
         product.setSearchCondition(productAddDTO.getSearchCondition());

+ 6 - 6
src/main/java/com/example/xiaoshiweixinback/service/TicketService.java

@@ -44,8 +44,8 @@ public class TicketService extends ServiceImpl<TicketMapper, Ticket> {
             PersonnelVO personnelVO = cacheUtil.getLoginUser(loginUtils.getId());
             ticket.setCreateId(personnelVO.getUuid());
             ticket.setTicketProgress(0);
-        String num =    BatchNoUtil.getBatchNo();
-        ticket.setNum(num);
+            String num = BatchNoUtil.getBatchNo();
+            ticket.setNum(num);
         } else {
             ticket = this.getById(ticket.getId());
             ticket.setName(ticketAddDTO.getName());
@@ -83,13 +83,13 @@ public class TicketService extends ServiceImpl<TicketMapper, Ticket> {
         List<TicketVO> ticketVOS = this.loadTicketVO(tickets);
         Records records = new Records();
         records.setData(ticketVOS);
-        records.setCurrent((long)pageNum);
-        records.setSize((long)pageSize);
+        records.setCurrent((long) pageNum);
+        records.setSize((long) pageSize);
         records.setTotal(ticketPage.getTotal());
         return records;
     }
 
-    public List<TicketVO> loadTicketVO(List<Ticket> tickets){
+    public List<TicketVO> loadTicketVO(List<Ticket> tickets) {
         List<TicketVO> ticketVOS = new ArrayList<>();
         if (!tickets.isEmpty()) {
             List<String> createIds = new ArrayList<>();
@@ -153,7 +153,7 @@ public class TicketService extends ServiceImpl<TicketMapper, Ticket> {
     private Boolean ifHavePermission(String id) {
         PersonnelVO personnelVO = cacheUtil.getLoginUser(loginUtils.getId());
         personnelVO.getPersonType();
-        if (personnelVO.getPersonType().equals(0) || (id!=null&&personnelVO.getId().equals(id))) {
+        if (personnelVO.getPersonType().equals(0) || (id != null && personnelVO.getId().equals(id))) {
             return true;
         }
         return false;

+ 7 - 2
src/main/java/com/example/xiaoshiweixinback/service/VipService.java

@@ -16,13 +16,18 @@ import java.util.List;
  */
 @Service
 public class VipService extends ServiceImpl<VipMapper, Vip> {
-    public Records  getAllVip() {
+
+    /**
+     * 查询会员
+     * @return
+     */
+    public Records getAllVip() {
         Records records = new Records();
         LambdaQueryWrapper<Vip> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.ne(Vip::getVipType, 0);
         List<Vip> vipList = this.list(queryWrapper);
         records.setData(vipList);
-       return records;
+        return records;
     }
 }