package com.doumee.cloud.admin; 
 | 
  
 | 
import com.doumee.api.BaseController; 
 | 
import com.doumee.config.annotation.CloudRequiredPermission; 
 | 
import com.doumee.core.annotation.excel.ExcelExporter; 
 | 
import com.doumee.core.annotation.pr.PreventRepeat; 
 | 
import com.doumee.core.utils.Constants; 
 | 
import com.doumee.dao.business.model.JkCustomerNavigation; 
 | 
import com.doumee.dao.business.model.JkSketchCustomer; 
 | 
import com.doumee.service.business.JkSketchCustomerService; 
 | 
import com.doumee.service.business.third.model.ApiResponse; 
 | 
import com.doumee.service.business.third.model.PageData; 
 | 
import com.doumee.service.business.third.model.PageWrap; 
 | 
import io.swagger.annotations.Api; 
 | 
import io.swagger.annotations.ApiOperation; 
 | 
import org.springframework.beans.factory.annotation.Autowired; 
 | 
import org.springframework.web.bind.annotation.*; 
 | 
  
 | 
import javax.servlet.http.HttpServletResponse; 
 | 
import java.util.ArrayList; 
 | 
import java.util.List; 
 | 
  
 | 
/** 
 | 
 * @author 江蹄蹄 
 | 
 * @date 2025/09/28 09:01 
 | 
 */ 
 | 
@Api(tags = "交控-线路优化线路客户记录信息表") 
 | 
@RestController 
 | 
@RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/business/jkSketchCustomer") 
 | 
public class JkSketchCustomerCloudController extends BaseController { 
 | 
  
 | 
    @Autowired 
 | 
    private JkSketchCustomerService jkSketchCustomerService; 
 | 
  
 | 
    @PreventRepeat 
 | 
    @ApiOperation("新建") 
 | 
    @PostMapping("/create") 
 | 
    @CloudRequiredPermission("business:jksketchcustomer:create") 
 | 
    public ApiResponse create(@RequestBody JkSketchCustomer jkSketchCustomer) { 
 | 
        return ApiResponse.success(jkSketchCustomerService.create(jkSketchCustomer)); 
 | 
    } 
 | 
  
 | 
    @ApiOperation("根据ID删除") 
 | 
    @GetMapping("/delete/{id}") 
 | 
    @CloudRequiredPermission("business:jksketchcustomer:delete") 
 | 
    public ApiResponse deleteById(@PathVariable Integer id) { 
 | 
        jkSketchCustomerService.deleteById(id); 
 | 
        return ApiResponse.success(null); 
 | 
    } 
 | 
  
 | 
    @ApiOperation("批量删除") 
 | 
    @GetMapping("/delete/batch") 
 | 
    @CloudRequiredPermission("business:jksketchcustomer:delete") 
 | 
    public ApiResponse deleteByIdInBatch(@RequestParam String ids) { 
 | 
        String [] idArray = ids.split(","); 
 | 
        List<Integer> idList = new ArrayList<>(); 
 | 
        for (String id : idArray) { 
 | 
            idList.add(Integer.valueOf(id)); 
 | 
        } 
 | 
        jkSketchCustomerService.deleteByIdInBatch(idList); 
 | 
        return ApiResponse.success(null); 
 | 
    } 
 | 
  
 | 
    @ApiOperation("根据ID修改") 
 | 
    @PostMapping("/updateById") 
 | 
    @CloudRequiredPermission("business:jksketchcustomer:update") 
 | 
    public ApiResponse updateById(@RequestBody JkSketchCustomer jkSketchCustomer) { 
 | 
        jkSketchCustomerService.updateById(jkSketchCustomer); 
 | 
        return ApiResponse.success(null); 
 | 
    } 
 | 
  
 | 
    @ApiOperation("分页查询") 
 | 
    @PostMapping("/page") 
 | 
    @CloudRequiredPermission("business:jksketchcustomer:query") 
 | 
    public ApiResponse<PageData<JkSketchCustomer>> findPage (@RequestBody PageWrap<JkSketchCustomer> pageWrap) { 
 | 
        return ApiResponse.success(jkSketchCustomerService.findPage(pageWrap)); 
 | 
    } 
 | 
  
 | 
    @ApiOperation("列表查询") 
 | 
    @PostMapping("/allList") 
 | 
    @CloudRequiredPermission("business:jksketchcustomer:query") 
 | 
    public ApiResponse<List<JkSketchCustomer>> allList (@RequestBody JkSketchCustomer pageWrap) { 
 | 
        return ApiResponse.success(jkSketchCustomerService.findList(pageWrap)); 
 | 
    } 
 | 
    @ApiOperation("列表查询") 
 | 
    @PostMapping("/allMapList") 
 | 
    @CloudRequiredPermission("business:jksketchcustomer:query") 
 | 
    public ApiResponse<List<JkCustomerNavigation> > allMapList (@RequestBody JkSketchCustomer pageWrap) { 
 | 
        return ApiResponse.success(jkSketchCustomerService.allMapList(pageWrap)); 
 | 
    } 
 | 
  
 | 
    @ApiOperation("导出Excel") 
 | 
    @PostMapping("/exportExcel") 
 | 
    @CloudRequiredPermission("business:jksketchcustomer:exportExcel") 
 | 
    public void exportExcel (@RequestBody PageWrap<JkSketchCustomer> pageWrap, HttpServletResponse response) { 
 | 
        ExcelExporter.build(JkSketchCustomer.class).export(jkSketchCustomerService.findPage(pageWrap).getRecords(), "交控-线路优化线路客户记录信息表", response); 
 | 
    } 
 | 
  
 | 
    @ApiOperation("根据ID查询") 
 | 
    @GetMapping("/{id}") 
 | 
    @CloudRequiredPermission("business:jksketchcustomer:query") 
 | 
    public ApiResponse findById(@PathVariable Integer id) { 
 | 
        return ApiResponse.success(jkSketchCustomerService.findById(id)); 
 | 
    } 
 | 
} 
 |