Merge remote-tracking branch 'origin/master'

master
chen 4 years ago
commit 7bfa9f6034
  1. 12
      dq-financial-api/src/main/java/com/daqing/financial/crms/CustomerControllerApi.java
  2. 12
      dq-financial-api/src/main/java/com/daqing/financial/crms/CustomerWorkbenchControllerApi.java
  3. 9
      dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java
  4. 16
      dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerWorkbenchController.java
  5. 4
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/CustomerService.java
  6. 4
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/CustomerWorkbenchService.java
  7. 12
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java
  8. 16
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerWorkbenchServiceImpl.java
  9. 2
      dq-framework-common/src/main/java/com/daqing/framework/model/response/ResponseResult.java

@ -43,24 +43,12 @@ public interface CustomerControllerApi {
@ApiOperation(value = "新增个人类型客户信息", notes = "新增个人类型客户信息") @ApiOperation(value = "新增个人类型客户信息", notes = "新增个人类型客户信息")
ResponseResult savePersonal(CustomerPersonalTOI customerPersonalTOI); ResponseResult savePersonal(CustomerPersonalTOI customerPersonalTOI);
/**
* 新增企业类型客户信息
*/
@ApiOperation(value = "新增企业类型客户信息", notes = "新增企业类型客户信息")
ResponseResult saveCompany(CustomerCompanyTOI customerCompanyTOI);
/** /**
* 更新个人类型客户信息 * 更新个人类型客户信息
*/ */
@ApiOperation(value = "更新个人类型客户信息", notes = "更新个人类型客户信息") @ApiOperation(value = "更新个人类型客户信息", notes = "更新个人类型客户信息")
ResponseResult updatePersonal(CustomerPersonalTOU customerPersonalTOU); ResponseResult updatePersonal(CustomerPersonalTOU customerPersonalTOU);
/**
* 更新企业类型客户信息
*/
@ApiOperation(value = "更新企业类型客户信息", notes = "更新企业类型客户信息")
ResponseResult updateCompany(CustomerCompanyTOU customerCompanyTOU);
/** /**
* 导入excel数据 * 导入excel数据
*/ */

@ -43,24 +43,12 @@ public interface CustomerWorkbenchControllerApi {
@ApiOperation(value = "新增个人类型客户信息", notes = "新增个人类型客户信息") @ApiOperation(value = "新增个人类型客户信息", notes = "新增个人类型客户信息")
ResponseResult savePersonal(CustomerPersonalTOI customerPersonalTOI); ResponseResult savePersonal(CustomerPersonalTOI customerPersonalTOI);
/**
* 新增企业
*/
@ApiOperation(value = "新增企业类型客户信息", notes = "新增企业类型客户信息")
ResponseResult saveCompany(CustomerCompanyTOI customerCompanyTOI);
/** /**
* 更新个人类型客户信息 * 更新个人类型客户信息
*/ */
@ApiOperation(value = "更新个人类型客户信息", notes = "更新个人类型客户信息") @ApiOperation(value = "更新个人类型客户信息", notes = "更新个人类型客户信息")
ResponseResult updatePersonal(CustomerPersonalTOU customerPersonalTOU); ResponseResult updatePersonal(CustomerPersonalTOU customerPersonalTOU);
/**
* 更新企业类型客户信息
*/
@ApiOperation(value = "更新企业类型客户信息", notes = "更新企业类型客户信息")
ResponseResult updateCompany(CustomerCompanyTOU customerCompanyTOU);
/** /**
* 通过审核 * 通过审核
*/ */

@ -1,6 +1,7 @@
package com.daqing.financial.crms.controller; package com.daqing.financial.crms.controller;
import com.daqing.financial.crms.CustomerControllerApi; import com.daqing.financial.crms.CustomerControllerApi;
import com.daqing.financial.crms.model.request.CompanyCustomerRequest;
import com.daqing.financial.crms.service.CustomerService; import com.daqing.financial.crms.service.CustomerService;
import com.daqing.framework.domain.crms.CompanyCustomerEntity; import com.daqing.framework.domain.crms.CompanyCustomerEntity;
import com.daqing.framework.domain.crms.CustomerEntity; import com.daqing.framework.domain.crms.CustomerEntity;
@ -100,8 +101,8 @@ public class CustomerController implements CustomerControllerApi {
* 保存企业类型客户信息 * 保存企业类型客户信息
*/ */
@PostMapping("/saveCompany") @PostMapping("/saveCompany")
public ResponseResult saveCompany(@RequestBody @Valid CustomerCompanyTOI customerCompanyTOI) { public ResponseResult saveCompany(@RequestBody @Valid CompanyCustomerRequest companyCustomerRequest) {
boolean result = customerService.saveCustomerCompany(customerCompanyTOI); boolean result = customerService.insertCompany(companyCustomerRequest);
return result ? ResponseResult.SUCCESS() : new ResponseResult(CommonCode.SAVE_FAIL); return result ? ResponseResult.SUCCESS() : new ResponseResult(CommonCode.SAVE_FAIL);
} }
@ -118,8 +119,8 @@ public class CustomerController implements CustomerControllerApi {
* 更新企业类型客户信息 * 更新企业类型客户信息
*/ */
@PostMapping("/updateCompany") @PostMapping("/updateCompany")
public ResponseResult updateCompany(@RequestBody @Valid CustomerCompanyTOU customerCompanyTOU) { public ResponseResult updateCompany(@RequestBody @Valid CompanyCustomerRequest companyCustomerRequest) {
boolean result = customerService.updateCustomerCompany(customerCompanyTOU); boolean result = customerService.updateCompanyNew(companyCustomerRequest);
return result ? ResponseResult.SUCCESS() : new ResponseResult(CommonCode.UPDATE_FAIL); return result ? ResponseResult.SUCCESS() : new ResponseResult(CommonCode.UPDATE_FAIL);
} }

@ -79,7 +79,7 @@ public class CustomerWorkbenchController implements CustomerWorkbenchControllerA
/** /**
* 新增个人 * 新增个人
*/ */
@PostMapping("/savePersonal") @PostMapping("/savePersonal") // ..................................
@Override @Override
public ResponseResult savePersonal(@RequestBody CustomerPersonalTOI customerPersonalTOI) { public ResponseResult savePersonal(@RequestBody CustomerPersonalTOI customerPersonalTOI) {
@ -91,19 +91,19 @@ public class CustomerWorkbenchController implements CustomerWorkbenchControllerA
/** /**
* 新增企业 * 新增企业
*/ */
@PostMapping("/saveCompany") /*@PostMapping("/saveCompany")
@Override @Override
public ResponseResult saveCompany(@RequestBody CustomerCompanyTOI customerCompanyTOI) { public ResponseResult saveCompany(@RequestBody CustomerCompanyTOI customerCompanyTOI) {
boolean result = customerWorkbenchService.saveCompany(customerCompanyTOI); boolean result = customerWorkbenchService.saveCompany(customerCompanyTOI);
return result ? ResponseResult.SUCCESS() : new ResponseResult(CommonCode.SAVE_FAIL); return result ? ResponseResult.SUCCESS() : new ResponseResult(CommonCode.SAVE_FAIL);
} }*/
/** /**
* 修改个人 * 修改个人
*/ */
@PostMapping("/updatePersonal") @PostMapping("/updatePersonal") // ..............................
@Override @Override
public ResponseResult updatePersonal(@RequestBody CustomerPersonalTOU customerPersonalTOU) { public ResponseResult updatePersonal(@RequestBody CustomerPersonalTOU customerPersonalTOU) {
@ -115,14 +115,14 @@ public class CustomerWorkbenchController implements CustomerWorkbenchControllerA
/** /**
* 修改企业 * 修改企业
*/ */
@PostMapping("/updateCompany") /*@PostMapping("/updateCompany")
@Override @Override
public ResponseResult updateCompany(@RequestBody CustomerCompanyTOU customerCompanyTOU) { public ResponseResult updateCompany(@RequestBody CustomerCompanyTOU customerCompanyTOU) {
Boolean result = customerWorkbenchService.updateCompany(customerCompanyTOU); Boolean result = customerWorkbenchService.updateCompany(customerCompanyTOU);
return result ? ResponseResult.SUCCESS() : new ResponseResult(CommonCode.UPDATE_FAIL); return result ? ResponseResult.SUCCESS() : new ResponseResult(CommonCode.UPDATE_FAIL);
} }*/
/** /**
* 通过审核 * 通过审核
@ -161,7 +161,7 @@ public class CustomerWorkbenchController implements CustomerWorkbenchControllerA
/** /**
* 新增企业() * 新增企业()
*/ */
@ApiOperation(value = "新增企业(新)") @ApiOperation(value = "新增企业(新)") // .............................
@PostMapping("/insertCompany") @PostMapping("/insertCompany")
public ResponseResult insertCompany(@RequestBody CompanyCustomerRequest companyCustomerReq) { public ResponseResult insertCompany(@RequestBody CompanyCustomerRequest companyCustomerReq) {
@ -173,7 +173,7 @@ public class CustomerWorkbenchController implements CustomerWorkbenchControllerA
/** /**
* 修改企业() * 修改企业()
*/ */
@ApiOperation(value = "修改企业(新)") @ApiOperation(value = "修改企业(新)")// ......................................
@PostMapping("/updateCompanyNew") @PostMapping("/updateCompanyNew")
public ResponseResult updateCompanyNew(@RequestBody CompanyCustomerRequest companyCustomerReq) { public ResponseResult updateCompanyNew(@RequestBody CompanyCustomerRequest companyCustomerReq) {

@ -33,11 +33,11 @@ public interface CustomerService extends IService<CustomerEntity> {
boolean saveCustomerPersonal(CustomerPersonalTOI customerPersonalTOI); boolean saveCustomerPersonal(CustomerPersonalTOI customerPersonalTOI);
boolean saveCustomerCompany(CustomerCompanyTOI customerCompanyTOI); /*boolean saveCustomerCompany(CustomerCompanyTOI customerCompanyTOI);*/
boolean updateCustomerPersonal(CustomerPersonalTOU customerPersonalTOU); boolean updateCustomerPersonal(CustomerPersonalTOU customerPersonalTOU);
boolean updateCustomerCompany(CustomerCompanyTOU customerCompanyTOU); /*boolean updateCustomerCompany(CustomerCompanyTOU customerCompanyTOU);*/
void excelExportCustomer(HttpServletResponse response); void excelExportCustomer(HttpServletResponse response);

@ -29,11 +29,11 @@ public interface CustomerWorkbenchService extends IService<CustomerEntity> {
Boolean savePersonal(CustomerPersonalTOI customerPersonalTOI); Boolean savePersonal(CustomerPersonalTOI customerPersonalTOI);
Boolean saveCompany(CustomerCompanyTOI customerCompanyTOI); /*Boolean saveCompany(CustomerCompanyTOI customerCompanyTOI);*/
Boolean updatePersonal(CustomerPersonalTOU customerPersonalTOU); Boolean updatePersonal(CustomerPersonalTOU customerPersonalTOU);
Boolean updateCompany(CustomerCompanyTOU customerCompanyTOU); /*Boolean updateCompany(CustomerCompanyTOU customerCompanyTOU);*/
Boolean pass(Long id,Long manager); Boolean pass(Long id,Long manager);

@ -219,7 +219,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
BeanUtils.copyProperties(customerPersonalTOI, customerEntity); BeanUtils.copyProperties(customerPersonalTOI, customerEntity);
BeanUtils.copyProperties(customerPersonalTOI, personalCustomerEntity); BeanUtils.copyProperties(customerPersonalTOI, personalCustomerEntity);
//TODO 设置客户编号 //TODO 设置客户编号
customerEntity.setCode(((int) (Math.random() * 100 + 1)) + ""); customerEntity.setCode(((int) (Math.random() * 1000000 + 1)) + "");
customerEntity.setCreateTime(new Date()); customerEntity.setCreateTime(new Date());
customerEntity.setMotifyTime(new Date()); customerEntity.setMotifyTime(new Date());
customerEntity.setType(CrmsConstant.CustomerType.PERSONAL_CUSTOMER.getType()); customerEntity.setType(CrmsConstant.CustomerType.PERSONAL_CUSTOMER.getType());
@ -235,14 +235,13 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
* 插入企业类型客户信息 * 插入企业类型客户信息
*/ */
@Transactional @Transactional
@Override
public boolean saveCustomerCompany(CustomerCompanyTOI customerCompanyTOI) { public boolean saveCustomerCompany(CustomerCompanyTOI customerCompanyTOI) {
CustomerEntity customerEntity = new CustomerEntity(); CustomerEntity customerEntity = new CustomerEntity();
CompanyCustomerEntity companyCustomerEntity = new CompanyCustomerEntity(); CompanyCustomerEntity companyCustomerEntity = new CompanyCustomerEntity();
BeanUtils.copyProperties(customerCompanyTOI, customerEntity); BeanUtils.copyProperties(customerCompanyTOI, customerEntity);
BeanUtils.copyProperties(customerCompanyTOI, companyCustomerEntity); BeanUtils.copyProperties(customerCompanyTOI, companyCustomerEntity);
//TODO 设置客户编号 //TODO 设置客户编号
customerEntity.setCode(((int) (Math.random() * 100 + 1)) + ""); customerEntity.setCode(((int) (Math.random() * 1000000 + 1)) + "");
customerEntity.setCreateTime(new Date()); customerEntity.setCreateTime(new Date());
customerEntity.setMotifyTime(new Date()); customerEntity.setMotifyTime(new Date());
customerEntity.setType(CrmsConstant.CustomerType.COMPANY_CUSTOMER.getType()); customerEntity.setType(CrmsConstant.CustomerType.COMPANY_CUSTOMER.getType());
@ -276,8 +275,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
/** /**
* 更新企业类型客户信息 * 更新企业类型客户信息
*/ */
@Transactional /*@Transactional
@Override
public boolean updateCustomerCompany(CustomerCompanyTOU customerCompanyTOU) { public boolean updateCustomerCompany(CustomerCompanyTOU customerCompanyTOU) {
CustomerEntity customerEntity = new CustomerEntity(); CustomerEntity customerEntity = new CustomerEntity();
CompanyCustomerEntity companyCustomerEntity = new CompanyCustomerEntity(); CompanyCustomerEntity companyCustomerEntity = new CompanyCustomerEntity();
@ -288,7 +286,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
companyCustomerEntity.setCustomerId(customerEntity.getId()); companyCustomerEntity.setCustomerId(customerEntity.getId());
boolean company = companyCustomerDao.updateCompanyCustomer(companyCustomerEntity); boolean company = companyCustomerDao.updateCompanyCustomer(companyCustomerEntity);
return customer && company; return customer && company;
} }*/
/** /**
* 导出数据到excel * 导出数据到excel
@ -562,7 +560,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
BeanUtils.copyProperties(companyCustomerReq, customerEntity); BeanUtils.copyProperties(companyCustomerReq, customerEntity);
BeanUtils.copyProperties(companyCustomerReq, companyCustomerEntity); BeanUtils.copyProperties(companyCustomerReq, companyCustomerEntity);
//TODO 设置客户编号 //TODO 设置客户编号
customerEntity.setCode(((int) (Math.random() * 100 + 1)) + ""); customerEntity.setCode(((int) (Math.random() * 1000000 + 1)) + "");
customerEntity.setMotifyTime(new Date()); customerEntity.setMotifyTime(new Date());
customerEntity.setCreateTime(new Date()); customerEntity.setCreateTime(new Date());
customerEntity.setManager(companyCustomerReq.getManager()); customerEntity.setManager(companyCustomerReq.getManager());

@ -143,7 +143,7 @@ public class CustomerWorkbenchServiceImpl extends ServiceImpl<CustomerWorkbenchD
/** /**
* 新增企业 * 新增企业
*/ */
@Transactional /* @Transactional
@Override @Override
public Boolean saveCompany(CustomerCompanyTOI customerCompanyTOI) { public Boolean saveCompany(CustomerCompanyTOI customerCompanyTOI) {
@ -155,7 +155,7 @@ public class CustomerWorkbenchServiceImpl extends ServiceImpl<CustomerWorkbenchD
// status = 2; // status = 2;
// Boolean result = save(customerId,status); // Boolean result = save(customerId,status);
return result; return result;
} }*/
/** /**
* 修改个人 * 修改个人
@ -172,14 +172,14 @@ public class CustomerWorkbenchServiceImpl extends ServiceImpl<CustomerWorkbenchD
/** /**
* 修改企业 * 修改企业
*/ */
@Transactional /*@Transactional
@Override @Override
public Boolean updateCompany(CustomerCompanyTOU customerCompanyTOU) { public Boolean updateCompany(CustomerCompanyTOU customerCompanyTOU) {
Long userId = Long.parseLong(this.getUserId()); Long userId = Long.parseLong(this.getUserId());
customerCompanyTOU.setManager(userId); customerCompanyTOU.setManager(userId);
return customerService.updateCustomerCompany(customerCompanyTOU); return customerService.updateCustomerCompany(customerCompanyTOU);
} }*/
/** /**
* 通过审核 * 通过审核
@ -289,8 +289,8 @@ public class CustomerWorkbenchServiceImpl extends ServiceImpl<CustomerWorkbenchD
@Transactional @Transactional
public Boolean insertCompany(CompanyCustomerRequest companyCustomerReq) { public Boolean insertCompany(CompanyCustomerRequest companyCustomerReq) {
// Long userId = Long.parseLong(this.getUserId()); Long userId = Long.parseLong(this.getUserId());
// companyCustomerReq.setManager(userId); // 从redis获取当前登录用户 companyCustomerReq.setManager(userId); // 从redis获取当前登录用户
boolean result = customerService.insertCompany(companyCustomerReq); boolean result = customerService.insertCompany(companyCustomerReq);
return result; return result;
} }
@ -301,8 +301,8 @@ public class CustomerWorkbenchServiceImpl extends ServiceImpl<CustomerWorkbenchD
@Transactional @Transactional
public Boolean updateCompanyNew(CompanyCustomerRequest companyCustomerReq) { public Boolean updateCompanyNew(CompanyCustomerRequest companyCustomerReq) {
// Long userId = Long.parseLong(this.getUserId()); Long userId = Long.parseLong(this.getUserId());
// companyCustomerReq.setManager(userId); companyCustomerReq.setManager(userId);
return customerService.updateCompanyNew(companyCustomerReq); return customerService.updateCompanyNew(companyCustomerReq);
} }
} }

@ -57,7 +57,7 @@ public class ResponseResult<T> {
} }
public static ResponseResult FAIL(Object t) { public static ResponseResult FAIL(Object t) {
return new ResponseResult<>(false, 99999, t, "操作失败!"); return new ResponseResult<>(false, 99999, t, "操作失败,请检查客户经理是否为公司已存在员工或者文件和数据格式!");
} }
public ResponseResult SUCCESS_DATA(T t){ public ResponseResult SUCCESS_DATA(T t){

Loading…
Cancel
Save