Commit bc0815d5 authored by lcl's avatar lcl

返回通用类型修改

parent 7162837f
...@@ -14,7 +14,7 @@ import java.util.HashMap; ...@@ -14,7 +14,7 @@ import java.util.HashMap;
*/ */
@Data @Data
@NoArgsConstructor @NoArgsConstructor
public class R<T> extends HashMap<String, Object> implements Serializable { public class R<T> implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
......
...@@ -6,7 +6,7 @@ import com.dsk.biz.domain.vo.ContactInfoListVo; ...@@ -6,7 +6,7 @@ import com.dsk.biz.domain.vo.ContactInfoListVo;
import com.dsk.biz.service.IContactInfoService; import com.dsk.biz.service.IContactInfoService;
import com.dsk.common.annotation.RepeatSubmit; import com.dsk.common.annotation.RepeatSubmit;
import com.dsk.common.core.controller.BaseController; import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult; import com.dsk.common.core.domain.R;
import com.dsk.common.core.domain.PageQuery; import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo; import com.dsk.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -41,8 +41,8 @@ public class ContactInfoController extends BaseController { ...@@ -41,8 +41,8 @@ public class ContactInfoController extends BaseController {
*/ */
// @PreAuthorize("@ss.hasPermi('contact:info')") // @PreAuthorize("@ss.hasPermi('contact:info')")
@GetMapping("/{id}") @GetMapping("/{id}")
public AjaxResult info(@PathVariable Long id){ public R<ContactInfo> info(@PathVariable Long id){
return AjaxResult.success(baseService.selectById(id)); return R.ok(baseService.selectById(id));
} }
/** /**
...@@ -51,8 +51,8 @@ public class ContactInfoController extends BaseController { ...@@ -51,8 +51,8 @@ public class ContactInfoController extends BaseController {
// @PreAuthorize("@ss.hasPermi('contact:info:add')") // @PreAuthorize("@ss.hasPermi('contact:info:add')")
@PostMapping() @PostMapping()
@RepeatSubmit() @RepeatSubmit()
public AjaxResult add(@RequestBody ContactInfo baen){ public R<Void> add(@RequestBody ContactInfo baen){
return AjaxResult.success(baseService.insert(baen)); return toAjax(baseService.insert(baen));
} }
/** /**
...@@ -61,8 +61,8 @@ public class ContactInfoController extends BaseController { ...@@ -61,8 +61,8 @@ public class ContactInfoController extends BaseController {
// @PreAuthorize("@ss.hasPermi('contact:info:edit')") // @PreAuthorize("@ss.hasPermi('contact:info:edit')")
@PutMapping() @PutMapping()
@RepeatSubmit() @RepeatSubmit()
public AjaxResult edit(@RequestBody ContactInfo baen){ public R<Void> edit(@RequestBody ContactInfo baen){
return AjaxResult.success(baseService.update(baen)); return toAjax(baseService.update(baen));
} }
/** /**
...@@ -71,8 +71,8 @@ public class ContactInfoController extends BaseController { ...@@ -71,8 +71,8 @@ public class ContactInfoController extends BaseController {
// @PreAuthorize("@ss.hasPermi('contact:info:del')") // @PreAuthorize("@ss.hasPermi('contact:info:del')")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@RepeatSubmit() @RepeatSubmit()
public AjaxResult del(@PathVariable("id") Long id){ public R<Void> del(@PathVariable("id") Long id){
return AjaxResult.success(baseService.deleteById(id)); return toAjax(baseService.deleteById(id));
} }
} }
...@@ -7,10 +7,12 @@ import com.dsk.biz.domain.bo.CustomerBusinessSearchDto; ...@@ -7,10 +7,12 @@ import com.dsk.biz.domain.bo.CustomerBusinessSearchDto;
import com.dsk.biz.domain.bo.CustomerSearchDto; import com.dsk.biz.domain.bo.CustomerSearchDto;
import com.dsk.biz.domain.vo.CustomerBusinessListVo; import com.dsk.biz.domain.vo.CustomerBusinessListVo;
import com.dsk.biz.domain.vo.CustomerListVo; import com.dsk.biz.domain.vo.CustomerListVo;
import com.dsk.biz.domain.vo.CustomerVo;
import com.dsk.biz.service.ICustomerService; import com.dsk.biz.service.ICustomerService;
import com.dsk.common.annotation.Log; import com.dsk.common.annotation.Log;
import com.dsk.common.annotation.RepeatSubmit; import com.dsk.common.annotation.RepeatSubmit;
import com.dsk.common.core.controller.BaseController; import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.PageQuery; import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.domain.R; import com.dsk.common.core.domain.R;
import com.dsk.common.core.page.TableDataInfo; import com.dsk.common.core.page.TableDataInfo;
...@@ -53,7 +55,7 @@ public class CustomerController extends BaseController { ...@@ -53,7 +55,7 @@ public class CustomerController extends BaseController {
*/ */
@SaCheckPermission("'customer:info')") @SaCheckPermission("'customer:info')")
@GetMapping("/{customerId}") @GetMapping("/{customerId}")
public R info(@PathVariable("customerId") String customerId) { public R<CustomerVo> info(@PathVariable("customerId") String customerId) {
return R.ok(baseService.info(customerId)); return R.ok(baseService.info(customerId));
} }
...@@ -63,7 +65,7 @@ public class CustomerController extends BaseController { ...@@ -63,7 +65,7 @@ public class CustomerController extends BaseController {
@SaCheckPermission("'customer:add')") @SaCheckPermission("'customer:add')")
@PostMapping() @PostMapping()
@RepeatSubmit @RepeatSubmit
public R add(@RequestBody Customer customer) { public R<Void> add(@RequestBody Customer customer) {
return toAjax(baseService.add(customer)); return toAjax(baseService.add(customer));
} }
...@@ -73,7 +75,7 @@ public class CustomerController extends BaseController { ...@@ -73,7 +75,7 @@ public class CustomerController extends BaseController {
// @SaCheckPermission("'customer:claim'") // @SaCheckPermission("'customer:claim'")
@PostMapping("/claim") @PostMapping("/claim")
@RepeatSubmit @RepeatSubmit
public R claim(@RequestBody Customer customer) { public R<Map<String, Object>> claim(@RequestBody Customer customer) {
if (ObjectUtils.isEmpty(customer.getUipId())) throw new BeanException("城投uipId不能为空"); if (ObjectUtils.isEmpty(customer.getUipId())) throw new BeanException("城投uipId不能为空");
boolean add = baseService.add(customer); boolean add = baseService.add(customer);
if (add) { if (add) {
...@@ -90,15 +92,15 @@ public class CustomerController extends BaseController { ...@@ -90,15 +92,15 @@ public class CustomerController extends BaseController {
@SaCheckPermission("'customer:edit'") @SaCheckPermission("'customer:edit'")
@PutMapping() @PutMapping()
@RepeatSubmit @RepeatSubmit
public R edit(@RequestBody Customer customer) { public R<Void> edit(@RequestBody Customer customer) {
return R.ok(baseService.edit(customer)); return toAjax(baseService.edit(customer));
} }
/** /**
* 获取个人客户列表 * 获取个人客户列表
*/ */
@GetMapping("/user/list") @GetMapping("/user/list")
public R userList() { public R<List<Customer>> userList() {
return R.ok(baseService.selectUserList()); return R.ok(baseService.selectUserList());
} }
...@@ -114,7 +116,8 @@ public class CustomerController extends BaseController { ...@@ -114,7 +116,8 @@ public class CustomerController extends BaseController {
@Log(title = "客户数据导入", businessType = BusinessType.IMPORT) @Log(title = "客户数据导入", businessType = BusinessType.IMPORT)
//@SaCheckPermission("'customer:importData'") //@SaCheckPermission("'customer:importData'")
@PostMapping("/importData") @PostMapping("/importData")
public R importData(@RequestPart("file") MultipartFile file) throws Exception { // public R<List<String>> importData(@RequestPart("file") MultipartFile file) throws Exception {
public AjaxResult importData(@RequestPart("file") MultipartFile file) throws Exception {
List<Customer> customerList = ExcelUtil.importExcel(file.getInputStream(), Customer.class); List<Customer> customerList = ExcelUtil.importExcel(file.getInputStream(), Customer.class);
List<String> resultList = new ArrayList<>(); List<String> resultList = new ArrayList<>();
int successCount = 0; int successCount = 0;
...@@ -129,7 +132,7 @@ public class CustomerController extends BaseController { ...@@ -129,7 +132,7 @@ public class CustomerController extends BaseController {
resultList.add(customer.getCompanyName().concat(":").concat(e.getMessage())); resultList.add(customer.getCompanyName().concat(":").concat(e.getMessage()));
} }
} }
R success = R.ok(resultList); AjaxResult success = AjaxResult.success(resultList);
success.put("successCount", successCount); success.put("successCount", successCount);
return success; return success;
} }
...@@ -138,7 +141,7 @@ public class CustomerController extends BaseController { ...@@ -138,7 +141,7 @@ public class CustomerController extends BaseController {
* 客户状态 * 客户状态
*/ */
@GetMapping("/status/{companyName}") @GetMapping("/status/{companyName}")
public R status(@PathVariable String companyName) { public R<Integer> status(@PathVariable String companyName) {
return R.ok(baseService.status(companyName)); return R.ok(baseService.status(companyName));
} }
...@@ -148,7 +151,7 @@ public class CustomerController extends BaseController { ...@@ -148,7 +151,7 @@ public class CustomerController extends BaseController {
*/ */
@PutMapping("/cancelClaim/{companyName}") @PutMapping("/cancelClaim/{companyName}")
@RepeatSubmit @RepeatSubmit
public R cancelClaim(@PathVariable String companyName) { public R<Void> cancelClaim(@PathVariable String companyName) {
return toAjax(baseService.cancelClaim(companyName)); return toAjax(baseService.cancelClaim(companyName));
} }
...@@ -157,7 +160,7 @@ public class CustomerController extends BaseController { ...@@ -157,7 +160,7 @@ public class CustomerController extends BaseController {
*/ */
@PutMapping("/historyClaim/{companyName}") @PutMapping("/historyClaim/{companyName}")
@RepeatSubmit @RepeatSubmit
public R historyClaim(@PathVariable String companyName) { public R<Void> historyClaim(@PathVariable String companyName) {
return toAjax(baseService.historyClaim(companyName)); return toAjax(baseService.historyClaim(companyName));
} }
} }
...@@ -6,8 +6,8 @@ import com.dsk.biz.domain.vo.CustomerFollowRecordListVo; ...@@ -6,8 +6,8 @@ import com.dsk.biz.domain.vo.CustomerFollowRecordListVo;
import com.dsk.biz.service.ICustomerFollowRecordService; import com.dsk.biz.service.ICustomerFollowRecordService;
import com.dsk.common.annotation.RepeatSubmit; import com.dsk.common.annotation.RepeatSubmit;
import com.dsk.common.core.controller.BaseController; import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.PageQuery; import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.domain.R;
import com.dsk.common.core.page.TableDataInfo; import com.dsk.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -40,8 +40,8 @@ public class CustomerFollowRecordController extends BaseController { ...@@ -40,8 +40,8 @@ public class CustomerFollowRecordController extends BaseController {
// @PreAuthorize("@ss.hasPermi('customer:follow:record:add')") // @PreAuthorize("@ss.hasPermi('customer:follow:record:add')")
@PostMapping() @PostMapping()
@RepeatSubmit @RepeatSubmit
public AjaxResult add(@RequestBody CustomerFollowRecord followRecord){ public R<Void> add(@RequestBody CustomerFollowRecord followRecord){
return AjaxResult.success(baseService.add(followRecord)); return toAjax(baseService.add(followRecord));
} }
/** /**
...@@ -50,8 +50,8 @@ public class CustomerFollowRecordController extends BaseController { ...@@ -50,8 +50,8 @@ public class CustomerFollowRecordController extends BaseController {
// @PreAuthorize("@ss.hasPermi('customer:follow:record:del')") // @PreAuthorize("@ss.hasPermi('customer:follow:record:del')")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@RepeatSubmit @RepeatSubmit
public AjaxResult del(@PathVariable("id") Long id){ public R<Void> del(@PathVariable("id") Long id){
return AjaxResult.success(baseService.del(id)); return toAjax(baseService.del(id));
} }
} }
package com.dsk.biz.controller; package com.dsk.biz.controller;
import com.dsk.biz.domain.bo.CustomerSearchDto; import com.dsk.biz.domain.bo.CustomerSearchDto;
import com.dsk.biz.domain.vo.CustomerAnalyzeVo;
import com.dsk.biz.service.ICustomerOverviewService; import com.dsk.biz.service.ICustomerOverviewService;
import com.dsk.common.core.controller.BaseController; import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult; import com.dsk.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/** /**
* 客户概览 * 客户概览
* @author lcl * @author lcl
...@@ -25,23 +29,23 @@ public class CustomerOverviewController extends BaseController { ...@@ -25,23 +29,23 @@ public class CustomerOverviewController extends BaseController {
* 客户统计 * 客户统计
*/ */
@GetMapping("/statistics") @GetMapping("/statistics")
public AjaxResult statistics(){ public R<Map<String, Object>> statistics(){
return AjaxResult.success(baseService.statistics(new CustomerSearchDto())); return R.ok(baseService.statistics(new CustomerSearchDto()));
} }
/** /**
* 客户合作情况 * 客户合作情况
*/ */
@GetMapping("/cooperation/top") @GetMapping("/cooperation/top")
public AjaxResult cooperationTop(){ public R<List<CustomerAnalyzeVo>> cooperationTop(){
return AjaxResult.success(baseService.cooperationTop(new CustomerSearchDto())); return R.ok(baseService.cooperationTop(new CustomerSearchDto()));
} }
/** /**
* 客户信资评级 * 客户信资评级
*/ */
@GetMapping("/credit/level") @GetMapping("/credit/level")
public AjaxResult creditLevel(){ public R<List<Map<String, Object>>> creditLevel(){
return AjaxResult.success(baseService.creditLevel(new CustomerSearchDto())); return R.ok(baseService.creditLevel(new CustomerSearchDto()));
} }
} }
package com.dsk.biz.service; package com.dsk.biz.service;
import com.dsk.biz.domain.CustomerFollowRecord; import com.dsk.biz.domain.CustomerFollowRecord;
import com.dsk.biz.domain.bo.CustomerFollowRecordSearchDto; import com.dsk.biz.domain.bo.CustomerFollowRecordSearchDto;
import com.dsk.biz.domain.vo.CustomerFollowRecordListVo; import com.dsk.biz.domain.vo.CustomerFollowRecordListVo;
import com.dsk.common.core.domain.PageQuery; import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo; import com.dsk.common.core.page.TableDataInfo;
import java.util.List;
/** /**
* 客户跟进记录(CustomerFollowRecord)表服务接口 * 客户跟进记录(CustomerFollowRecord)表服务接口
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment