|  |  |  | 
|---|
|  |  |  | import com.doumee.dao.business.model.Category; | 
|---|
|  |  |  | import com.doumee.dao.business.model.JkCustomer; | 
|---|
|  |  |  | import com.doumee.dao.business.model.JkSketch; | 
|---|
|  |  |  | import com.doumee.dao.business.model.JkSketchLine; | 
|---|
|  |  |  | import com.doumee.service.business.JkSketchService; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageData; | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID修改") | 
|---|
|  |  |  | @PostMapping("/updateSketchLine") | 
|---|
|  |  |  | @CloudRequiredPermission("business:jksketch:update") | 
|---|
|  |  |  | public ApiResponse updateSketchLine(@RequestBody JkSketch jkSketch, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | jkSketch.setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | JkSketch model = jkSketchService.updateSketchLine(jkSketch); | 
|---|
|  |  |  | jkSketchService.startEditSketchLineAsync(model);//异步优化 | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID重新计算当前线路的距离") | 
|---|
|  |  |  | @PostMapping("/initOriginDistance") | 
|---|
|  |  |  | @CloudRequiredPermission("business:jksketch:update") | 
|---|
|  |  |  | 
|---|
|  |  |  | @CloudRequiredPermission("business:jksketch:update") | 
|---|
|  |  |  | public ApiResponse distanceCustomer(@RequestBody JkSketch model, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | model.setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | Category category =  jkSketchService.checkDataValid(model);//异步计算 | 
|---|
|  |  |  | Category category =  jkSketchService.checkDataValid(model); | 
|---|
|  |  |  | jkSketchService.distanceCustomer(category);//异步计算 | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @CloudRequiredPermission("business:jksketch:create") | 
|---|
|  |  |  | public ApiResponse<String> importExcel (@ApiParam(value = "file") MultipartFile file,  String dateInfo, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | List<JkSketch> list = jkSketchService.importBatch(file,dateInfo,this.getLoginUser(token)); | 
|---|
|  |  |  | if(list!=null){ | 
|---|
|  |  |  | for(JkSketch model :list){ | 
|---|
|  |  |  | jkSketchService.startInitOriginDistanceBatch(model); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ApiResponse.success("导入成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|